Skip to main content

getAllOrdersStorage

Getting all order storage objects. 🔐 This method requires authorization.

Description

This method retrieves all order storage objects configured for the project, with pagination. It returns a Promise that resolves to an array of IOrdersEntity objects.

Orders.getAllOrdersStorage(

langCode, offset, limit

);

Parameters schema

Schema

langCode: string
Language code. Default: "en_US"
example: "en_US"

offset: number
Optional parameter for pagination. Default: 0
example: 0

limit: number
Optional parameter for pagination. Default: 30
example: 30

By default, you can retrieve 10 objects. This is due to the record limit in the module's permissions settings.
For pagination to work correctly, you need to configure Module permissions according to your needs in the corresponding section.

Examples

Minimal example

const response = await Orders.getAllOrdersStorage();

Example with attributes

const response = await Orders.getAllOrdersStorage('en_US', 0, 30);

Example response

[
{
"id": 1,
"localizeInfos": {
"title": "My order"
},
"position": 1,
"identifier": "my_order",
"formIdentifier": "orderForm",
"generalTypeId": 21,
"paymentAccountIdentifiers": [
{
"identifier": "cash"
},
{
"identifier": "stripe"
}
]
}
]

Response schema

Schema: IOrdersEntity[]

id: number
Object identifier.
example: 1

localizeInfos: ILocalizeInfo
Name considering localization.
example:

{
"title": "Cash"
}

position: number | null
Position in orders storage.
example: 1

identifier: string
Textual identifier for the record field.
example: "order_storage_1"

formIdentifier: string
Textual identifier for the form used by the order storage.
example: "bar-orders-form"

generalTypeId: number | null
Type identifier.
example: 1

paymentAccountIdentifiers: IPaymentAccountIdentifiers[]
Array of textual identifiers of payment accounts used by the order storage.
example:

[
{
"identifier": "payment-1"
}
]

paymentAccountIdentifiers.identifier: string
Textual identifier of the payment account.
example: "payment-1"