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.
Note:
The pricing plan createOnlineOrder()
and the createOfflineOrder()
APIs
replace the deprecated paid plans orderPlan()
API.
The deprecated API will continue to work, but will not receive updates.
To keep any existing code compatible with future changes, see the
migration instructions.
Payment of an offline order is handled in 1 of 2 ways:
- When creating the order, select
true
in thepaid
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
.
ID of the plan being ordered.
Member ID for the buyer.
Additional options for creating the offline order.