Nhảy đến nội dung

getAllOrdersByMarker

Lấy tất cả các đơn hàng từ đối tượng lưu trữ đơn hàng được tạo bởi người dùng. 🔐 Phương thức này yêu cầu ủy quyền.

Mô tả

Phương thức này lấy tất cả đối tượng lưu trữ đơn hàng theo marker. Phương thức sẽ thêm ngôn ngữ mặc định vào thân yêu cầu. Nếu bạn muốn thay đổi ngôn ngữ, chỉ cần truyền nó với tham số thứ hai. Nó trả về một Promise mà sẽ giải quyết thành một đối tượng IOrdersByMarkerEntity.

Orders.getAllOrdersByMarker(

marker*, langCode, offset, limit

);

Sơ đồ tham số

Sơ đồ

marker(bắt buộc): string
Định danh văn bản của đối tượng lưu trữ đơn hàng
ví dụ: "order_storage_1"

langCode: string
Mã ngôn ngữ. Mặc định: "en_US"
ví dụ: "en_US"

offset: number
Tham số offset. Mặc định: 0
ví dụ: 0

limit: number
Tham số limit. Mặc định: 30
ví dụ: 30

Theo mặc định, bạn có thể lấy 10 đối tượng. Điều này là do giới hạn bản ghi trong cài đặt quyền của module.
Để phân trang hoạt động chính xác, bạn cần cấu hình Quyền module theo nhu cầu của bạn trong phần tương ứng.

Ví dụ

Ví dụ tối thiểu

const response = await Orders.getAllOrdersByMarker('my-order');

Ví dụ với các thuộc tính

const response = await Orders.getAllOrdersByMarker('my-order', 'en_US', 0, 30);

Ví dụ phản hồi

{
"items": [
{
"id": 414,
"storageId": 1,
"createdDate": "2026-01-07T04:15:58.059Z",
"statusIdentifier": "inProgress",
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"totalSum": "300.00",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Tiền mặt"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2
}
],
"paymentUrl": null,
"isCompleted": null
},
{
"id": 413,
"storageId": 1,
"createdDate": "2026-01-07T04:11:18.556Z",
"statusIdentifier": "inProgress",
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"totalSum": "300.00",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Tiền mặt"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2
}
],
"paymentUrl": null,
"isCompleted": null
},
{
"id": 412,
"storageId": 1,
"createdDate": "2026-01-07T02:09:46.495Z",
"statusIdentifier": "inProgress",
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"totalSum": "300.00",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Tiền mặt"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2
}
],
"paymentUrl": null,
"isCompleted": null
},
"..."
],
"total": 231
}

Sơ đồ phản hồi

Sơ đồ: IOrdersByMarkerEntity

items: IOrderByMarkerEntity[]
Mảng các đối tượng lưu trữ đơn hàng.
ví dụ:

[
{
"id": 55,
"storageId": 1,
"createdDate": "2025-03-22T21:12:42.371Z",
"statusIdentifier": "inProgress",
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"totalSum": "300.00",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Tiền mặt"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2
}
],
"isCompleted": false
}
]

total: number
Tổng số bản ghi tìm thấy.
ví dụ: 100