Search.../

managementListOrders( )

Developer Preview

Lists pricing plan orders.

Description

The managementListOrders() function returns a Promise that resolves to a list of up to 50 pricing plan orders. You can specify options for filtering, sorting, and paginating the results.

This function returns the orders on the site. To list orders for the currently logged-in member, use memberListOrders().

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function managementListOrders(options: ManagementListOrdersOptions): Promise<ListOrdersResponse>

managementListOrders Parameters

NAME
TYPE
DESCRIPTION
options
Optional
ManagementListOrdersOptions

Filtering, sorting, and pagination options.

Returns

Return Type:

Promise<
ListOrdersResponse
>
NAME
TYPE
DESCRIPTION
orders
Array<
Order
>

List of orders.

pagingMetadata
PagingMetadataV2

Object containing paging-related data (number of orders returned, offset).

Was this helpful?

List pricing plan orders

Copy Code
1import { orders } from 'wix-pricing-plans.v2';
2import { elevate } from 'wix-auth';
3
4const elevatedManagementListOrders = elevate(orders.managementListOrders);
5
6export async function myManagementListOrdersFunction() {
7 try {
8 const ordersList = await elevatedManagementListOrders();
9
10 return ordersList;
11 } catch (error){
12 console.error(error);
13 // Handle the error
14 }
15}
16
17/* Promise resolves to:
18 * {
19 * "orders": [
20 * {
21 * "_createdDate": "2024-01-22T14:00:53.904Z",
22 * "_id": "14fac8ae-506e-4e7b-84d4-e9b094d0ddca",
23 * "_updatedDate": "2024-01-22T14:00:54.772Z",
24 * "buyer": {
25 * "contactId": "f5691fc2-0674-4eee-92c5-da06a05981a5",
26 * "memberId": "f5691fc2-0674-4eee-92c5-da06a05981a5"
27 * },
28 * "currentCycle": {
29 * "index": 1,
30 * "startedDate": "2024-01-22T14:00:53.904Z"
31 * },
32 * "cycles": [
33 * {
34 * "index": 1,
35 * "startedDate": "2024-01-22T14:00:53.904Z"
36 * }
37 * ],
38 * "formData": {
39 * "submissionData": {}
40 * },
41 * "lastPaymentStatus": "NOT_APPLICABLE",
42 * "orderMethod": "UNKNOWN",
43 * "pausePeriods": [],
44 * "planDescription": "",
45 * "planId": "aa0d8e0e-99ad-4c95-ac48-4955e37956c5",
46 * "planName": "Default",
47 * "planPrice": "0",
48 * "priceDetails": {
49 * "currency": "EUR",
50 * "discount": "0",
51 * "planPrice": "0",
52 * "singlePaymentUnlimited": true,
53 * "subtotal": "0.00",
54 * "total": "0"
55 * },
56 * "pricing": {
57 * "prices": [
58 * {
59 * "duration": {
60 * "cycleFrom": 1,
61 * "numberOfCycles": 1
62 * },
63 * "price": {
64 * "currency": "EUR",
65 * "discount": "0",
66 * "fees": [],
67 * "proration": "0",
68 * "subtotal": "0.00",
69 * "total": "0"
70 * }
71 * }
72 * ],
73 * "singlePaymentUnlimited": true
74 * },
75 * "priceDetails": {
76 * "currency": "EUR",
77 * "discount": "0",
78 * "planPrice": "0",
79 * "singlePaymentUnlimited": true,
80 * "subtotal": "0.00",
81 * "total": "0"
82 * },
83 * "startDate": "2024-01-22T14:00:53.904Z",
84 * "status": "ACTIVE",
85 * "statusNew": "ACTIVE",
86 * "subscriptionId": "19276032-d06f-4931-962f-79486d8b6bc0",
87 * "type": "ONLINE"
88 * }
89 * ],
90 * "pagingMetadata": {
91 * "count": 1,
92 * "hasNext": false,
93 * "offset": 0,
94 * "total": 1
95 * }
96 * }
97 */
98
99
List pricing plan orders with options

Copy Code
1import { orders } from 'wix-pricing-plans.v2';
2import { elevate } from 'wix-auth';
3
4/* Sample options value:
5 * {
6 * autoRenewCanceled: false,
7 * buyerIds: [
8 * '402ec90c-235a-45c4-b4cc-52204d5f6b00',
9 * '3fc889f6-18e8-4fd9-a509-27db9f037f26',
10 * 'fa16f1dc-0fbd-41c0-8efc-53333e3fce1e',
11 * '554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4',
12 * '695568ff-1dc2-49ff-83db-2b518d35692b',
13 * '554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4',
14 * 'f5691fc2-0674-4eee-92c5-da06a05981a5'
15 * ],
16 * fieldSet: 'BASIC',
17 * limit: 3,
18 * offset: 0,
19 * orderStatuses: [
20 * 'ACTIVE'
21 * ],
22 * paymentStatus: [
23 * 'PAID',
24 * 'NOT_APPLICABLE'
25 * ],
26 * planIds: [
27 * '0da57ac8-c3d0-4687-8aea-4100781b6386',
28 * 'df83348a-777d-46ab-8d62-a43c415bdb11',
29 * '3a3e0ac2-a9e3-4bfd-ade3-bec3bab34d4b',
30 * 'cb4a8c57-273a-4567-94e3-cc43d5d339f2',
31 * 'df83348a-777d-46ab-8d62-a43c415bdb11',
32 * 'aa0d8e0e-99ad-4c95-ac48-4955e37956c5',
33 * 'aa0d8e0e-99ad-4c95-ac48-4955e37956c5'
34 * ],
35 * sorting: {
36 * fieldName: 'createdDate',
37 * order: 'ASC'
38 * };
39 */
40
41const elevatedManagementListOrders = elevate(orders.managementListOrders);
42
43export async function myManagementListOrdersFunction(options) {
44 try {
45 const ordersList = await elevatedManagementListOrders(options);
46
47 return ordersList;
48 } catch (error) {
49 console.error(error);
50 // Handle the error
51 }
52}
53
54/* Promise resolves to:
55 * {
56 * "orders": [
57 * {
58 * "_createdDate": "2024-01-28T09:49:21.041Z",
59 * "_id": "82d99338-5653-459a-a751-b57483f7cfb5",
60 * "_updatedDate": "2024-02-04T10:42:58.888Z",
61 * "autoRenewCanceled": false,
62 * "buyer": {
63 * "contactId": "554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4",
64 * "memberId": "554c9e11-f4d8-4579-ac3a-a17f7e6cb0b4"
65 * },
66 * "currentCycle": {
67 * "endedDate": "2024-04-27T09:49:21.041Z",
68 * "index": 0,
69 * "startedDate": "2024-01-28T09:49:21.041Z"
70 * },
71 * "cycles": [
72 * {
73 * "endedDate": "2024-04-27T09:49:21.041Z",
74 * "index": 0,
75 * "startedDate": "2024-01-28T09:49:21.041Z"
76 * }
77 * ],
78 * "endDate": "2026-07-29T09:49:21.041Z",
79 * "earliestEndDate": "2026-04-27T09:49:21.041Z",
80 * "formData": {
81 * "submissionData": {}
82 * },
83 * "freeTrialDays": 90,
84 * "lastPaymentStatus": "PAID",
85 * "orderMethod": "UNKNOWN",
86 * "pausePeriods": [],
87 * "planDescription": "3 mo free trial with discount for 1 year",
88 * "planId": "cb4a8c57-273a-4567-94e3-cc43d5d339f2",
89 * "planName": "Beginner's Plan",
90 * "planPrice": "50",
91 * "priceDetails": {
92 * "currency": "USD",
93 * "discount": "0",
94 * "freeTrialDays": 90,
95 * "planPrice": "50",
96 * "subtotal": "50.00",
97 * "total": "50.00"
98 * },
99 * "pricing": {
100 * "prices": [
101 * {
102 * "duration": {
103 * "cycleFrom": 1,
104 * "numberOfCycles": 2
105 * },
106 * "price": {
107 * "currency": "USD",
108 * "discount": "0",
109 * "fees": [],
110 * "proration": "0",
111 * "subtotal": "50.00",
112 * "total": "50.00"
113 * }
114 * }
115 * ],
116 * "singlePaymentUnlimited": true
117 * },
118 * "startDate": "2024-01-28T09:49:21.041Z",
119 * "status": "ACTIVE",
120 * "statusNew": "ACTIVE",
121 * "subscriptionId": "305f8fc9-3724-4cac-9f67-4e29f2c46def",
122 * "type": "OFFLINE",
123 * "wixPayOrderId": "2f0e79d8-f15d-46c6-ac1a-10ec7a2030fb"
124 * }
125 * ],
126 * "pagingMetadata": {
127 * "count": 1,
128 * "hasNext": false,
129 * "offset": 0,
130 * "total": 1
131 * }
132 * }
133 */
134