Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
By default, this endpoint will retrieve all orders and return them sorted by createdDate
in DESC
, descending order.
sort.fieldName
supports endDate
and createdDate
fields and defaults to ASC
, ascending order.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function managementListOrders(
options: ManagementListOrdersOptions,
): Promise<ListOrdersResponse>;
Filtering, sorting, and pagination options.
import { orders } from "wix-pricing-plans.v2";
import { elevate } from "wix-auth";
const elevatedManagementListOrders = elevate(orders.managementListOrders);
export async function myManagementListOrdersFunction() {
try {
const ordersList = await elevatedManagementListOrders();
return ordersList;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "orders": [
* {
* "_createdDate": "2024-01-22T14:00:53.904Z",
* "_id": "14fac8ae-506e-4e7b-84d4-e9b094d0ddca",
* "_updatedDate": "2024-01-22T14:00:54.772Z",
* "buyer": {
* "contactId": "f5691fc2-0674-4eee-92c5-da06a05981a5",
* "memberId": "f5691fc2-0674-4eee-92c5-da06a05981a5"
* },
* "currentCycle": {
* "index": 1,
* "startedDate": "2024-01-22T14:00:53.904Z"
* },
* "cycles": [
* {
* "index": 1,
* "startedDate": "2024-01-22T14:00:53.904Z"
* }
* ],
* "formData": {
* "submissionData": {}
* },
* "lastPaymentStatus": "NOT_APPLICABLE",
* "orderMethod": "UNKNOWN",
* "pausePeriods": [],
* "planDescription": "",
* "planId": "aa0d8e0e-99ad-4c95-ac48-4955e37956c5",
* "planName": "Default",
* "planPrice": "0",
* "priceDetails": {
* "currency": "EUR",
* "discount": "0",
* "planPrice": "0",
* "singlePaymentUnlimited": true,
* "subtotal": "0.00",
* "total": "0"
* },
* "pricing": {
* "prices": [
* {
* "duration": {
* "cycleFrom": 1,
* "numberOfCycles": 1
* },
* "price": {
* "currency": "EUR",
* "discount": "0",
* "fees": [],
* "proration": "0",
* "subtotal": "0.00",
* "total": "0"
* }
* }
* ],
* "singlePaymentUnlimited": true
* },
* "priceDetails": {
* "currency": "EUR",
* "discount": "0",
* "planPrice": "0",
* "singlePaymentUnlimited": true,
* "subtotal": "0.00",
* "total": "0"
* },
* "startDate": "2024-01-22T14:00:53.904Z",
* "status": "ACTIVE",
* "statusNew": "ACTIVE",
* "subscriptionId": "19276032-d06f-4931-962f-79486d8b6bc0",
* "type": "ONLINE"
* }
* ],
* "pagingMetadata": {
* "count": 1,
* "hasNext": false,
* "offset": 0,
* "total": 1
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.