memberGetOrder( )
Gets an order by ID for the currently logged-in member.
Description
The memberGetOrder()
function returns a Promise that resolves to information about a specified order for the currently logged-in member.
Syntax
function memberGetOrder(_id: string, options: MemberGetOrderOptions): Promise<Order>
memberGetOrder Parameters
NAME
TYPE
DESCRIPTION
Order ID.
Options for getting a logged-in member's order.
Returns
Requested order.
Return Type:
NAME
TYPE
DESCRIPTION
Date and time the order was created.
Order ID.
Date and time the order was updated.
Whether the order will be canceled at the next payment date.
If true
, the order status will be CANCELED
and the next payment won't be charged. Omitted for single payment orders.
The buyer's IDs. Includes memberId
and contactId
.
Currently, Pricing Plan purchases are limited to members only. contactId
is returned,
but a buyer will not be able to purchase a plan without a memberId
.
Details about the cancellation of an order.
Only present if the status is CANCELED
.
Current payment cycle for the order.
currentCycle
will be omitted if the order's status is CANCELED
or ENDED
, or if the startDate
hasn't passed yet.
Earliest end date and time that the plan for the order can expire.
Calculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use.
Information about the form submitted during the plan's checkout.
Free trial period for the order, in days.
Only available for recurring plans.
Status of the last payment for the order. Updated automatically for online orders. Updated manually by the site owner for offline orders.
Supported values:
PAID
: The last payment was paid.REFUNDED
: The last payment was refunded.FAILED
: The last payment transaction didn't complete.UNPAID
: The last payment wasn't paid.PENDING
: Awaiting payment.NOT_APPLICABLE
: No payment was necessary. For example, for free plans or free trials.
List of periods during which the order is paused.
Plan description at the time of purchase
ID of the plan purchased with the order.
Plan name at the time of purchase.
Plan price as it was at the moment of order creation.
Pricing model, price, and payment schedule for the order.
Start date and time for the ordered plan.
Status of the order. Supported values:
DRAFT
: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.PENDING
: Order has been purchased and its start date is set in the future.ACTIVE
: Order has been processed. The plan is available for use.PAUSED
: Order, and use of the plan, is paused. The order, and use of the plan, can be resumed.ENDED
: Order has completed its duration and is no longer available for use.CANCELED
: Order has been canceled.
ID of the related Wix subscription.
Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. See a Pricing Plans overview.
How the order was processed. Supported values:
"ONLINE"
: The buyer purchased the plan using the site."OFFLINE"
: The buyer made a manual, offline purchase without using the site.
Wix Pay order ID.
Provided by Wix whether the order is created online or offline. The field is omitted when the order is free.
Was this helpful?
memberGetOrder example
1import { orders } from 'wix-pricing-plans.v2';23 async function memberGetOrder(id, options) {4 try {5 const result = await orders.memberGetOrder(id, options);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13