createOfflineOrder( )


Creates an order for a buyer who purchased the plan with an offline transaction.

The createOfflineOrder() function returns a Promise that resolves to an Order object when the order has been created.

Payment of an offline order is handled in 1 of 2 ways:

  • When creating the order, select true in the paid request parameter.
  • After creation, with the markAsPaid() function.

Creating a non-free offline order causes:

  • The order's status is set to "PENDING" if the start date is in the future. Otherwise, the status is set to "ACTIVE".
  • The order's last payment status is set to "UNPAID" or "PAID".

Creating a free offline order causes:

  • The order's status is set to "PENDING" if the start date is in the future. Otherwise, the status is set to "ACTIVE".
  • The order's last payment status is set to "NOT_APPLICABLE".

The onOrderCreated() event handler runs when an offline order is created.

Note: Only site visitors with the Manage Pricing Plans and Manage Subscriptions permissions can create offline orders. You can override the permissions by setting the function's suppressAuth option to true.

Method Declaration
Copy
Method Parameters
planIdstringRequired

ID of the plan being ordered.


buyerIdstringRequired

Member ID for the buyer.


optionsCreateOfflineOrderOptions

Additional options for creating the offline order.

Returns
Return Type:Promise<Order>
Did this help?