listCurrentMemberOrders( )


Lists orders for the currently logged-in member.

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.

Method Declaration
Copy
function listCurrentMemberOrders(
  filters: CurrentMemberFilterOptions,
  sorting: SortingOptions,
  paging: PaginationOptions,
): Promise<Array<Order>>;
Method Parameters
filtersCurrentMemberFilterOptions

Filter options for limiting which orders are listed.


sortingSortingOptions

Sorting options, such as by which property and in which direction.


pagingPaginationOptions

Pagination options, such as how many results are listed at a time.

Returns
Return Type:Promise<Array<Order>>
List orders for the currently logged-in member
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { orders } from "wix-pricing-plans-backend"; /* Sample filters object: * { * orderStatuses: ['PAUSED', 'CANCELED'] * } */ /* Sample sorting object: * { * fieldName: ['createdDate'], * order: ['ASC'] * } */ /* Sample paging object: * { * limit: 3, * skip: 1 * } */ export const myListCurrentMemberOrdersFunction = webMethod( Permissions.Anyone, async (filters, sorting, paging) => { try { const listedOrders = await orders.listCurrentMemberOrders( filters, sorting, paging, ); const firstOrderId = listedOrders.orders[0]._id; const firstOrderStatus = listedOrders.orders[0].status; return listedOrders; } catch (error) { console.error(error); } }, );
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?