listCurrentMemberOrders( )
Lists orders for the currently logged-in member.
Description
The listCurrentMemberOrders()
function returns a Promise that resolves to a list of up to 100 pricing plan orders.
You can specify options for filtering, sorting, and paginating the results.
Syntax
function listCurrentMemberOrders([filters: CurrentMemberFilterOptions], [sorting: SortingOptions], [paging: PaginationOptions]): Promise<Array<Order>>
listCurrentMemberOrders Parameters
NAME
TYPE
DESCRIPTION
Filter options for limiting which orders are listed.
Sorting options, such as by which property and in which direction.
Pagination options, such as how many results are listed at a time.
Returns
Fulfilled - Pricing plan orders for the current member that match the specified filtering, sorting, and pagination options.
Return Type:
NAME
TYPE
DESCRIPTION
Order ID.
ID of the plan that was ordered.
ID of the related Wix subscription.
Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. You can see all orders from your site's Subscriptions page in the Dashboard.
ID of the associated Wix Pay order.
Created by the createOnlineOrder()
or createfflineOrder()
function. For online orders, send this value as a parameter to the Wix Pay startPayment()
function to enable your buyer to pay for the order. wixPayOrderId
is omitted if the order is free.
The buyer's IDs. Includes memberId
and contactId
.
Currently, Pricing Plan orders are limited to members only. contactId
is returned, but a buyer will not be able to order a plan without a memberId
.
Deprecated. Use pricing
instead.
How the order was processed. Supported values:
"ONLINE"
. The buyer ordered the plan using the site."OFFLINE"
. The buyer made a manual, offline order without using the site.
Status of the order. Supported values:
"DRAFT"
. The order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use."PENDING"
. The order has been processed and its start date is set in the future. The plan isn't yet available for use."ACTIVE"
. The order has been processed. The plan is available for use."PAUSED"
. The order, and use of the plan, is paused. For example, if the buyer is away. The order, and use of the plan, can be resumed."ENDED"
. The order has completed its duration and is no longer available for use."CANCELED"
. The order has been canceled.
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.
Details about the cancellation of an order. Only present if the status
is "CANCELED"
.
Status of the last payment for the order. This is updated automatically for online orders. The site owner updates this manually 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.
Start date and time for the ordered plan.
List of periods during which this order is paused.
Free trial period, in days. Only available for recurring plans.
Earliest end date and time that the plan for this order can expire.
This is calculated by adding all pause periods to the original end date. Omitted if the order is active until canceled. Reserved for future use.
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.
Name of the plan at the time of the order.
Description of the plan at the time of the order.
Plan price as it was at the moment of order creation.
Date and time the order was created.
Date and time the order was last updated. For example, the date and time an order was paused, resumed, or canceled.
Was this helpful?
List orders for the currently logged-in member
1import { orders } from 'wix-pricing-plans-backend';23/* Sample filters object:4 * {5 * orderStatuses: ['PAUSED', 'CANCELED']6 * }7 */89/* Sample sorting object:10 * {11 * fieldName: ['createdDate'],12 * order: ['ASC']13 * }14 */1516/* Sample paging object:17 * {18 * limit: 3,19 * skip: 120 * }21 */2223export async function myListCurrentMemberOrdersFunction(filters, sorting, paging) {24 try {25 const listedOrders = await orders.listCurrentMemberOrders(filters, sorting, paging);26 const firstOrderId = listedOrders.orders[0]._id;27 const firstOrderStatus = listedOrders.orders[0].status;2829 return listedOrders;30 } catch (error) {31 console.error(error);32 }33}