getAllOrdersByMarker
Mengambil semua pesanan dari objek penyimpanan pesanan yang dibuat oleh pengguna. 🔐 Metode ini memerlukan otorisasi.
Deskripsi
Metode ini mengambil semua pesanan dari penyimpanan pesanan yang ditentukan berdasarkan penandanya, dengan paginasi. Ini mengembalikan sebuah Promise yang menyelesaikan menjadi objek IOrdersByMarkerEntity yang berisi pesanan yang dipaginasi.
Orders.getAllOrdersByMarker(
marker*,
langCode,
offset,
limit
);
Skema parameter
Skema
marker(required): string
Identifikasi tekstual dari objek penyimpanan pesanan
contoh: "order_storage_1"
langCode: string
Kode bahasa. Default: "en_US"
contoh: "en_US"
offset: number
Parameter offset. Default: 0
contoh: 0
limit: number
Parameter limit. Default: 30
contoh: 30
Secara default, Anda dapat mengambil 10 objek. Ini disebabkan oleh batasan rekaman dalam pengaturan izin modul.
Agar paginasi berfungsi dengan benar, Anda perlu mengonfigurasi Izin Modul sesuai kebutuhan Anda di bagian yang sesuai.
Contoh
Contoh minimal
const response = await Orders.getAllOrdersByMarker('my-order');
Contoh dengan atribut
const response = await Orders.getAllOrdersByMarker('my-order', 'en_US', 0, 30);
Contoh respons
{
"items": [
{
"id": 681,
"storageId": 1,
"createdDate": "2026-06-12T18:05:22.470Z",
"statusIdentifier": "inProgress",
"statusLocalizeInfos": {
"title": "In progress"
},
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"paymentStrategy": "once",
"totalSum": "285",
"totalSumRaw": "300",
"currency": "USD",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Cash"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": "",
"price": 150,
"quantity": 2,
"isGift": false
}
],
"paymentUrl": null,
"discountConfig": {
"orderDiscounts": [
{
"id": 2,
"identifier": "personal_discount",
"type": "PERSONAL_DISCOUNT",
"localizeInfos": {
"title": "Personal discount"
},
"startDate": "2026-04-21T18:26:19.815Z",
"endDate": "2028-03-21T19:26:24.741Z",
"discountValue": {
"value": 15,
"maxAmount": null,
"discountType": "FIXED_AMOUNT",
"applicability": "TO_ORDER"
},
"exclusions": null,
"position": 1,
"conditionLogic": "AND",
"gifts": [],
"userGroups": null,
"userExclusions": null,
"conditions": [],
"coupon": null
}
],
"productDiscounts": [],
"coupon": null,
"settings": {
"allowStacking": true,
"maxDiscountValue": 50,
"allowGiftStacking": false,
"maxBonusPaymentPercent": null,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"giftRefundPolicy": "KEEP_GIFT"
},
"additionalDiscountsMarkers": [],
"totalRaw": 300,
"totalSumWithDiscount": 285,
"excludedGiftProductIds": [],
"bonus": {
"availableBalance": 0,
"maxBonusDiscount": 0,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"bonusApplied": 0
},
"bonusApplied": 0,
"totalDue": 285
},
"isPartial": false,
"isCompleted": null
},
{
"id": 680,
"storageId": 1,
"createdDate": "2026-06-12T17:37:59.815Z",
"statusIdentifier": "inProgress",
"statusLocalizeInfos": {
"title": "In progress"
},
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"paymentStrategy": "once",
"totalSum": "285",
"totalSumRaw": "300",
"currency": "USD",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Cash"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": "",
"price": 150,
"quantity": 2,
"isGift": false
}
],
"paymentUrl": null,
"discountConfig": {
"orderDiscounts": [
{
"id": 2,
"identifier": "personal_discount",
"type": "PERSONAL_DISCOUNT",
"localizeInfos": {
"title": "Personal discount"
},
"startDate": "2026-04-21T18:26:19.815Z",
"endDate": "2028-03-21T19:26:24.741Z",
"discountValue": {
"value": 15,
"maxAmount": null,
"discountType": "FIXED_AMOUNT",
"applicability": "TO_ORDER"
},
"exclusions": null,
"position": 1,
"conditionLogic": "AND",
"gifts": [],
"userGroups": null,
"userExclusions": null,
"conditions": [],
"coupon": null
}
],
"productDiscounts": [],
"coupon": null,
"settings": {
"allowStacking": true,
"maxDiscountValue": 50,
"allowGiftStacking": false,
"maxBonusPaymentPercent": null,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"giftRefundPolicy": "KEEP_GIFT"
},
"additionalDiscountsMarkers": [],
"totalRaw": 300,
"totalSumWithDiscount": 285,
"excludedGiftProductIds": [],
"bonus": {
"availableBalance": 0,
"maxBonusDiscount": 0,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"bonusApplied": 0
},
"bonusApplied": 0,
"totalDue": 285
},
"isPartial": false,
"isCompleted": null
},
{
"id": 679,
"storageId": 1,
"createdDate": "2026-06-12T15:47:12.814Z",
"statusIdentifier": "inProgress",
"statusLocalizeInfos": {
"title": "In progress"
},
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"paymentStrategy": "once",
"totalSum": "285",
"totalSumRaw": "300",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Cash"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": "",
"price": 150,
"quantity": 2,
"isGift": false
}
],
"paymentUrl": null,
"discountConfig": {
"orderDiscounts": [
{
"id": 2,
"identifier": "personal_discount",
"type": "PERSONAL_DISCOUNT",
"localizeInfos": {
"title": "Personal discount"
},
"startDate": "2026-04-21T18:26:19.815Z",
"endDate": "2028-03-21T19:26:24.741Z",
"discountValue": {
"value": 15,
"maxAmount": null,
"discountType": "FIXED_AMOUNT",
"applicability": "TO_ORDER"
},
"exclusions": null,
"position": 1,
"conditionLogic": "AND",
"gifts": [],
"userGroups": null,
"userExclusions": null,
"conditions": [],
"coupon": null
}
],
"productDiscounts": [],
"coupon": null,
"settings": {
"allowStacking": true,
"maxDiscountValue": 50,
"allowGiftStacking": false,
"maxBonusPaymentPercent": null,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"giftRefundPolicy": "KEEP_GIFT"
},
"additionalDiscountsMarkers": [],
"totalRaw": 300,
"totalSumWithDiscount": 285,
"excludedGiftProductIds": [],
"bonus": {
"availableBalance": 0,
"maxBonusDiscount": 0,
"minBonusAmount": null,
"minOrderAmountForBonus": null,
"bonusApplied": 0
},
"bonusApplied": 0,
"totalDue": 285
},
"isPartial": false,
"isCompleted": null
},
"..."
],
"total": 429
}
Skema respons
Skema: IOrdersByMarkerEntity
items: IOrderByMarkerEntity[]
Array objek penyimpanan pesanan.
contoh:
[
{
"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
Identifikasi objek.
contoh: 125
items.storageId: number
Identifikasi objek penyimpanan pesanan.
contoh: 1
items.createdDate: string
Tanggal ketika pesanan dibuat.
contoh: "2023-10-01T12:00:00Z"
items.statusIdentifier: string
Identifikasi tekstual dari status pesanan.
contoh: "order-status-1"
items.formIdentifier: string
Identifikasi tekstual dari formulir.
contoh: "bar-orders-form"
items.formData: IOrdersFormData[]
Data yang diajukan oleh formulir yang terhubung ke penyimpanan pesanan.
contoh:
[
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
]
items.attributeSetIdentifier: string | null
Identifikasi tekstual dari set atribut.
contoh: "attribute-set-1"
items.totalSum: string
Jumlah total pesanan.
contoh: "100.00"
items.totalSumRaw: string
Jumlah total pesanan mentah dengan presisi penuh.
contoh: "100.00"
items.currency: string
Mata uang yang digunakan untuk membayar pesanan.
contoh: "USD"
items.paymentAccountIdentifier: string | null
Identifikasi tekstual untuk pembayaran pesanan.
contoh: "payment-1"
items.paymentAccountLocalizeInfos: ILocalizeInfo
Nama akun pembayaran dengan mempertimbangkan lokalisasi.
contoh:
{
"title": "Cash"
}
items.products: IOrderProducts[]
Array produk yang ditambahkan ke pesanan.
contoh:
[
{
"id": 1,
"name": "Product 1",
"quantity": 2
}
]
items.paymentUrl: string | null
Tautan pembayaran.
contoh: "https://example.com/pay/123"
items.isCompleted: boolean | null
Menunjukkan bahwa pesanan telah diselesaikan.
contoh: true
items.isPartial: boolean | null
Menunjukkan bahwa pesanan dibayar sebagian; null pada pesanan lama di mana ini tidak dilacak.
contoh: false
items.paymentStrategy: string
Strategi pembayaran dari pesanan.
contoh: "once"
items.statusLocalizeInfos: ILocalizeInfo
Nama status yang dilokalisasi.
items.discountConfig: IOrderDiscountConfig | null
Konfigurasi diskon yang diterapkan pada pesanan (orderDiscounts, productDiscounts, coupon, settings, bonus, totals); null pada pesanan lama tanpa konfigurasi diskon yang diselesaikan.
items.split: IOrderSplit
Konfigurasi pembayaran terpisah (bertingkat); hadir pada endpoint pesanan berdasarkan ID.
total: number
Total jumlah rekaman yang ditemukan.
contoh: 100
Contoh penggunaan
Panduan langkah demi langkah dalam dokumentasi:
- Riwayat pesanan — ambil dan tampilkan pesanan masa lalu pengguna berdasarkan penanda penyimpanan.
- Langganan pesanan — periksa apakah pengguna memiliki pesanan langganan yang aktif.
Coba secara langsung
Jalankan metode ini secara interaktif di JS SDK sandbox — sambungkan URL Proyek dan Token Aplikasi Anda pada kunjungan pertama, lalu buka:
- Riwayat pesanan — ambil dan tampilkan pesanan masa lalu pengguna berdasarkan penanda penyimpanan.
- Langganan pesanan — periksa apakah pengguna memiliki pesanan langganan yang aktif.