> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: postponeEndDate(orderId: string, endDate: Date, options: Options)

# Method package: wixPricingPlansBackend

# Method menu location: wixPricingPlansBackend --> Orders --> postponeEndDate

# Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/orders/postpone-end-date.md

# Method Description:

Extends the duration of a pricing plan order by postponing the order's `endDate`.

The `postponeEndDate()` function returns a Promise that resolves when the order's end date is successfully changed.

 The new end date and time must be later than the order's current `endDate`.

 Postponing the end date of an order does not impact payments. For example, if the pricing plan is for a membership
 to an online lecture series, and you want to extend the duration of the series because the lecturer could not
 attend some sessions, you can postpone the end date of the orders for all relevant participants. The
 participants will not be billed additionally.

 Postponing an order causes the following changes:
 + The `endDate` for the order is adjusted to the new end date.
 The [`onOrderEndDatePostponed()`](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/events/on-order-end-date-postponed.md) and [`onOrderUpdated()`](https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/events/on-order-updated.md) event handlers run when an order's end date is postponed or made earlier.

 > **Note**: Only site visitors with the **Manage Pricing Plans** and **Manage Subscriptions** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions/roles)
 > can change the end date of orders. You can override the permissions by setting the function's `suppressAuth`
 > option to `true`.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Postpone the end of an order to a later date

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { orders } from 'wix-pricing-plans-backend';

// Sample orderId value: '5bc6d668-f09f-4f1d-98f2-289d4c209f2b'
//
// Sample endDate value: new Date('November 1, 2022 10:00:00')

export const myPostponeEndDateFunction = webMethod(Permissions.Anyone, async (orderId, endDate) => {
  try {
    const order = await orders.postponeEndDate(orderId, endDate);

    return order;
  } catch (error) {
    console.error(error);
  }
});

// Returns a promise that resolves to void
```

## Bring the end of an order forward to an earlier date, bypassing permission checks

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { orders } from 'wix-pricing-plans-backend';

/* Sample orderId value: '895fd8d9-f732-444f-a82b-19f7e55e9617'
 * 
 * Sample endDate value: new Date('Fri Jul 22 2022 17:50:26')
 *
 * Sample options object: 
 * { 
 *   suppressAuth : true 
 * }
 */

export const myPostponeEndDateWithOptionsFunction = webMethod(Permissions.Anyone, async (orderId, endDate, options) => {
  try {
    const order = await orders.postponeEndDate(orderId, endDate, options);

    return order;
  } catch (error) {
    console.error(error);
  }
});

// Returns a promise that resolves to void
```

---