Extends the duration of a pricing plan order by postponing the order's endDate
. Postponing the end date of an order does not impact payments.
New endDate
must be later than the order's current endDate
. Can't postpone orders that are unlimited.
Can't postpone an order with status
: PAUSED
.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function postponeEndDate(_id: string, endDate: Date): Promise<void>;
Order ID.
New end date and time.
Must be later than the current end date and time.
import { orders } from "wix-pricing-plans-backend";
import { elevate } from "wix-auth";
/* Sample _id value: '82d99338-5653-459a-a751-b57483f7cfb5'
*
* Sample endDate value: new Date('June 30, 2026 04:00:00')
*/
const elevatedPostponeEndDate = elevate(orders.postponeEndDate);
export async function myPostponeEndDateFunction(_id, endDate) {
try {
await elevatedPostponeEndDate(_id, endDate);
return;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise that resolves to void */
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.