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à khi giải quyết sẽ trả về 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": 551,
"storageId": 1,
"createdDate": "2026-04-15T14:20:29.645Z",
"statusIdentifier": "inProgress",
"statusLocalizeInfos": {
"title": "In progress"
},
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"paymentStrategy": "once",
"totalSum": "300",
"totalSumRaw": "300",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Cash"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2,
"isGift": false
}
],
"paymentUrl": null,
"discountConfig": {
"orderDiscounts": [],
"productDiscounts": [],
"coupon": null,
"settings": {
"allowStacking": false,
"maxDiscountValue": null,
"allowGiftStacking": false,
"maxBonusPaymentPercent": null,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"giftRefundPolicy": "KEEP_GIFT"
},
"additionalDiscountsMarkers": [],
"totalRaw": 300,
"totalSumWithDiscount": 300,
"excludedGiftProductIds": [],
"bonus": {
"availableBalance": 0,
"maxBonusDiscount": 0,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"bonusApplied": 0
},
"bonusApplied": 0,
"totalDue": 300
},
"isPartial": false,
"isCompleted": null
},
{
"id": 550,
"storageId": 1,
"createdDate": "2026-04-14T14:53:59.484Z",
"statusIdentifier": "inProgress",
"statusLocalizeInfos": {
"title": "In progress"
},
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"paymentStrategy": "once",
"totalSum": "300",
"totalSumRaw": "300",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Cash"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2,
"isGift": false
}
],
"paymentUrl": null,
"discountConfig": {
"orderDiscounts": [],
"productDiscounts": [],
"coupon": null,
"settings": {
"allowStacking": false,
"maxDiscountValue": null,
"allowGiftStacking": false,
"maxBonusPaymentPercent": null,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"giftRefundPolicy": "KEEP_GIFT"
},
"additionalDiscountsMarkers": [],
"totalRaw": 300,
"totalSumWithDiscount": 300,
"excludedGiftProductIds": [],
"bonus": {
"availableBalance": 0,
"maxBonusDiscount": 0,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"bonusApplied": 0
},
"bonusApplied": 0,
"totalDue": 300
},
"isPartial": false,
"isCompleted": null
},
{
"id": 549,
"storageId": 1,
"createdDate": "2026-04-14T13:22:58.354Z",
"statusIdentifier": "inProgress",
"statusLocalizeInfos": {
"title": "In progress"
},
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"paymentStrategy": "once",
"totalSum": "300",
"totalSumRaw": "300",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Cash"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2,
"isGift": false
}
],
"paymentUrl": null,
"discountConfig": {
"orderDiscounts": [],
"productDiscounts": [],
"coupon": null,
"settings": {
"allowStacking": false,
"maxDiscountValue": null,
"allowGiftStacking": false,
"maxBonusPaymentPercent": null,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"giftRefundPolicy": "KEEP_GIFT"
},
"additionalDiscountsMarkers": [],
"totalRaw": 300,
"totalSumWithDiscount": 300,
"excludedGiftProductIds": [],
"bonus": {
"availableBalance": 0,
"maxBonusDiscount": 0,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"bonusApplied": 0
},
"bonusApplied": 0,
"totalDue": 300
},
"isPartial": false,
"isCompleted": null
},
"..."
],
"total": 357
}
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": "Cash"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2
}
],
"isCompleted": false
}
]
items.id: number
Định danh của đối tượng.
ví dụ: 125
items.storageId: number
Định danh của đối tượng lưu trữ đơn hàng.
ví dụ: 1
items.createdDate: string
Ngày khi đơn hàng được tạo.
ví dụ: "2023-10-01T12:00:00Z"
items.statusIdentifier: string
Định danh văn bản của trạng thái đơn hàng.
ví dụ: "order-status-1"
items.formIdentifier: string
Định danh văn bản của biểu mẫu.
ví dụ: "bar-orders-form"
items.formData: IOrdersFormData[]
Dữ liệu được gửi bởi biểu mẫu liên kết với cửa hàng đơn hàng.
ví dụ:
[
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
]
formData.marker: string
Marker của trường biểu mẫu.
ví dụ: "name_1"
formData.type: string
Loại giá trị.
ví dụ: "string"
formData.value: string
Giá trị.
ví dụ: "Name"
items.attributeSetIdentifier: string | null
Định danh văn bản của bộ thuộc tính.
ví dụ: "attribute-set-1"
items.totalSum: string
Tổng số tiền đơn hàng.
ví dụ: "100.00"
items.currency: string
Tiền tệ được sử dụng để thanh toán cho đơn hàng.
ví dụ: "USD"
items.paymentAccountIdentifier: string | null
Định danh văn bản cho thanh toán đơn hàng.
ví dụ: "payment-1"
items.paymentAccountLocalizeInfos: ILocalizeInfo
Tên tài khoản thanh toán với việc xem xét địa phương hóa.
ví dụ:
{
"title": "Cash"
}
items.products: IOrderProducts[]
Mảng các sản phẩm được thêm vào đơn hàng.
ví dụ:
[
{
"id": 1,
"name": "Product 1",
"quantity": 2
}
]
products.id: number
ID sản phẩm.
ví dụ: 2957
products.quantity: number
Số lượng sản phẩm.
ví dụ: 1
products.title: string
Tiêu đề sản phẩm.
ví dụ: "Cosmo"
products.sku: string | null
SKU sản phẩm.
ví dụ: "SKU"
products.previewImage: IPicture | null
Hình ảnh xem trước sản phẩm.
ví dụ:
{
"filename": "image.jpg",
"downloadLink": "https://example.com/image.jpg",
"size": 102400,
"previewLink": "https://example.com/image-preview.jpg"
}
previewImage.filename: string
Tên tệp.
ví dụ: "image.jpg"
previewImage.downloadLink: string
Liên kết URL để tải hình ảnh.
ví dụ: "https://example.com/image.jpg"
previewImage.size: number
Kích thước của hình ảnh tính bằng byte.
ví dụ: 102400
previewImage.previewLink: string
Liên kết URL để xem trước hình ảnh.
ví dụ: "https://example.com/image-preview.jpg"
products.price: number
Giá sản phẩm.
ví dụ: 150
products.isGift: boolean
Liệu sản phẩm có phải là quà tặng hay không.
ví dụ: false
items.paymentUrl: string | null
Liên kết thanh toán.
ví dụ: "https://example.com/pay/123"
items.isCompleted: boolean | null
Chỉ ra rằng đơn hàng đã được hoàn thành.
ví dụ: true
items.statusLocalizeInfos: ILocalizeInfo
Tên trạng thái đã được địa phương hóa.
total: number
Tổng số bản ghi đã tìm thấy.
ví dụ: 100