> 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`). > - 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: sitePricingPlans.listCurrentMemberOrders(filters: CurrentMemberFilterOptions, sorting: SortingOptions, paging: PaginationOptions) # Method Link: https://dev.wix.com/docs/sdk/frontend-modules/pricing-plans/orders/list-current-member-orders.md # Method Description: Lists the orders for the currently logged-in member. > **Note:** > + To work with the Pricing Plans API, a site needs to be published. > > + `listCurrentMemberOrders()` doesn't work in preview mode. # Method Permissions: # Method Permissions Scopes IDs: undefined # Method Code Examples: ## List the current member's orders on button click ```javascript import { orders } from '@wix/site-pricing-plans'; $w('#myListOrdersButton').onClick((event) => { orders.listCurrentMemberOrders() .then((ordersList) => { const firstOrder = ordersList[0]; const firstOrderStatus = ordersList[0].status; console.log('Your orders:', ordersList); return ordersList; }) .catch((error) => { console.error(error); }) }); /* In this case, a `myOrderList` array of two order items: * [ * { * "_id": "d9667014-b773-40b1-871d-041cedd9302e", * "planId": "60f0e90f-06f6-4b9c-8cd7-5a02d015d98b", * "subscriptionId": "14e11d7d-46e2-46be-a8a0-5484f595701c", * "buyer": { * "memberId": "0c9bca47-1f00-4b92-af1c-7852452e949a", * "contactId": "0c9bca47-1f00-4b92-af1c-7852452e949a" * }, * "priceDetails": { * "subtotal": "0", * "discount": "0", * "total": "0", * "planPrice": "0", * "currency": "EUR", * "singlePaymentForDuration": { * "count": 1, * "unit": "MONTH" * } * }, * "pricing": { * "singlePaymentForDuration": { * "count": 1, * "unit": "MONTH" * }, * "prices": [ * { * "duration": { * "cycleFrom": 1, * "numberOfCycles": 1 * }, * "price": { * "subtotal": "0", * "discount": "0", * "total": "0", * "currency": "EUR" * } * } * ] * }, * "type": "ONLINE", * "orderMethod": "UNKNOWN", * "status": "PENDING", * "lastPaymentStatus": "NOT_APPLICABLE", * "startDate": "2022-08-25T07:44:00.000Z", * "endDate": "2022-09-25T07:44:00.000Z", * "pausePeriods": [], * "earliestEndDate": "2022-09-25T07:44:00.000Z", * "planName": "Free Trial", * "planDescription": "Come try it out!", * "planPrice": "0", * "_createdDate": "2022-08-23T23:57:36.745Z", * "_updatedDate": "2022-08-23T23:57:37.126Z" * }, * { * "_id": "a8c4a1b2-b5e8-4b33-9693-057ec93e9a27", * "planId": "099e2c86-3b7e-4477-8c27-f77402b8cceb", * "subscriptionId": "f0cd38ff-a0a5-403c-9882-454e6badf64b", * "wixPayOrderId": "ad363d3d-dc48-45cf-8454-62bee1e750e9", * "buyer": { * "memberId": "0c9bca47-1f00-4b92-af1c-7852452e949a", * "contactId": "0c9bca47-1f00-4b92-af1c-7852452e949a" * }, * "priceDetails": { * "subtotal": "74.99", * "discount": "0", * "total": "74.99", * "planPrice": "74.99", * "currency": "EUR", * "subscription": { * "cycleDuration": { * "count": 1, * "unit": "MONTH" * }, * "cycleCount": 3 * } * }, * "pricing": { * "subscription": { * "cycleDuration": { * "count": 1, * "unit": "MONTH" * }, * "cycleCount": 3 * }, * "prices": [ * { * "duration": { * "cycleFrom": 1, * "numberOfCycles": 3 * }, * "price": { * "subtotal": "74.99", * "discount": "0", * "total": "74.99", * "currency": "EUR" * } * } * ] * }, * "type": "OFFLINE", * "orderMethod": "UNKNOWN", * "status": "CANCELED", * "autoRenewCanceled": true, * "cancellation": { * "cause": "OWNER_ACTION", * "effectiveAt": "IMMEDIATELY" * }, * "lastPaymentStatus": "PAID", * "startDate": "2022-07-22T17:50:26.000Z", * "endDate": "2022-07-22T13:00:21.694Z", * "pausePeriods": [], * "earliestEndDate": "2022-10-22T17:50:26.000Z", * "planName": "Platinum Pro", * "planDescription": "", * "planPrice": "74.99", * "_createdDate": "2022-07-22T12:30:48.472Z", * "_updatedDate": "2022-07-22T13:00:21.785Z" * } * ] */ ``` ## Filter, sort, and list the current member's orders for given plan and order statuses ```javascript import { orders } from '@wix/site-pricing-plans'; /* Sample filters object: * { * 'orderStatuses': ['PAUSED', 'CANCELED'] * } */ /* Sample sorting object: * { * 'fieldName': '_createdDate', * 'order': 'DESC' * } */ /* Sample paging object: * { * 'limit': 2 * } */ $w('#listMyOrdersButton').onClick((event) => { orders.listCurrentMemberOrders(filters, sorting, paging) .then((ordersList) => { const firstOrderId = ordersList[0]._id; const firstCreatedDate = ordersList[0]._createdDate; console.log('Your list of filtered and sorted orders:', ordersList); return ordersList; }) .catch((error) => { console.error(error); }) }); /* Promise resolves to: * [ * { * "_id": "06d7ce1a-0a94-4395-841f-4af3f09913ab", * "planId": "9f4ad2f3-d948-4daf-b517-eb2206b01ea1", * "subscriptionId": "f6abaa62-dfbd-4ab4-b483-c42d4c91e753", * "wixPayOrderId": "e4afdb18-1943-4769-8f82-26a0b07ed82d", * "buyer": { * "memberId": "0c9bca47-1f00-4b92-af1c-7852452e949a", * "contactId": "0c9bca47-1f00-4b92-af1c-7852452e949a" * }, * "priceDetails": { * "subtotal": "10.00", * "discount": "0", * "total": "10.00", * "planPrice": "10.00", * "currency": "USD", * "singlePaymentUnlimited": true * }, * "pricing": { * "singlePaymentUnlimited": true, * "prices": [ * { * "duration": { * "cycleFrom": 1, * "numberOfCycles": 1 * }, * "price": { * "subtotal": "10.00", * "discount": "0", * "total": "10.00", * "currency": "USD" * } * } * ] * }, * "type": "OFFLINE", * "orderMethod": "UNKNOWN", * "status": "CANCELED", * "cancellation": { * "cause": "MEMBER_ACTION", * "effectiveAt": "IMMEDIATELY" * }, * "lastPaymentStatus": "PAID", * "startDate": "2022-04-17T14:51:19.506Z", * "endDate": "2022-05-03T13:33:11.588Z", * "pausePeriods": [], * "planName": "Gold", * "planDescription": "Gold membership to the MyGame World of Online Gaming", * "planPrice": "10.00", * "_createdDate": "2022-04-17T14:51:33.886Z", * "_updatedDate": "2022-05-03T13:33:11.620Z" * }, * { * "_id": "01822c51-cde0-4cc0-a8ed-6beb7f9491dc", * "planId": "6d7537c5-beac-44a3-bea3-b947ddc56b31", * "subscriptionId": "ad747b09-d4c7-466f-8e3d-37a32076bfba", * "wixPayOrderId": "cf140d00-2a49-41b3-954b-6f9f0712b799", * "buyer": { * "memberId": "0c9bca47-1f00-4b92-af1c-7852452e949a", * "contactId": "0c9bca47-1f00-4b92-af1c-7852452e949a" * }, * "priceDetails": { * "subtotal": "14.99", * "discount": "0", * "total": "14.99", * "planPrice": "14.99", * "currency": "EUR", * "subscription": { * "cycleDuration": { * "count": 1, * "unit": "MONTH" * }, * "cycleCount": 0 * } * }, * "pricing": { * "subscription": { * "cycleDuration": { * "count": 1, * "unit": "MONTH" * }, * "cycleCount": 0 * }, * "prices": [ * { * "duration": { * "cycleFrom": 1 * }, * "price": { * "subtotal": "14.99", * "discount": "0", * "total": "14.99", * "currency": "EUR" * } * } * ] * }, * "type": "OFFLINE", * "orderMethod": "UNKNOWN", * "status": "CANCELED", * "autoRenewCanceled": true, * "cancellation": { * "cause": "OWNER_ACTION", * "effectiveAt": "IMMEDIATELY" * }, * "lastPaymentStatus": "PAID", * "startDate": "2022-06-01T13:45:53.129Z", * "endDate": "2022-05-25T21:52:37.108Z", * "pausePeriods": [], * "planName": "2x Week", * "planDescription": "", * "planPrice": "14.99", * "_createdDate": "2022-05-25T21:40:36.700Z", * "_updatedDate": "2022-05-25T21:52:37.205Z" * } * ] */ ``` ## List the current member's orders in a table ```javascript import { orders } from '@wix/site-pricing-plans'; // The "columns" constant is used to set // the properties of the table columns. const columns = [ { id: 'orderID', dataPath: '_id', label: 'Order', width: 15, visible: true, type: 'string' }, { id: 'planName', dataPath: 'planName', label: 'Plan', width: 15, visible: true, type: 'string' }, { id: 'planID', dataPath: 'planId', label: 'Plan ID', width: 15, visible: true, type: 'string' }, { id: 'subID', dataPath: 'subscriptionId', label: 'Subscription ID', width: 15, visible: true, type: 'string' }, { id: 'wixPayID', dataPath: 'wixPayOrderId', label: 'Wix Pay ID', width: 15, visible: true, type: 'string' }, { id: 'type', dataPath: 'type', label: 'Type', width: 8, visible: true, type: 'string' }, { id: 'status', dataPath: 'status', label: 'Status', width: 8, visible: true, type: 'string' } ]; $w('#listMyOrdersButton').onClick((event) => { $w('#myOrdersTable').rows = []; $w('#myOrdersTable').columns = columns; orders.listCurrentMemberOrders() .then((myOrdersList) => { $w('#myOrdersTable').rows = myOrdersList; }) .catch((error) => { console.error(error); }); }); ```