postponeEndDate( )


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.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Orders
Learn more about app permissions.
Method Declaration
Copy
function postponeEndDate(_id: string, endDate: Date): Promise<void>;
Method Parameters
_idstringRequired

Order ID.


endDateDateRequired

New end date and time.

Must be later than the current end date and time.

JavaScript
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 */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?