انتقل إلى المحتوى الرئيسي

getAllOrdersByMarker

الحصول على جميع الطلبات من كائن تخزين الطلبات الذي أنشأه المستخدم. 🔐 تتطلب هذه الطريقة التفويض.

الوصف

تسترجع هذه الطريقة جميع الطلبات من تخزين الطلبات المحدد بواسطة علامته، مع وجود ترقيم الصفحات. تعيد Promise التي تحل إلى كائن IOrdersByMarkerEntity يحتوي على الطلبات المرقمة.

Orders.getAllOrdersByMarker(

marker*, langCode, offset, limit

);

مخطط المعاملات

المخطط

marker(required): string
معرف نصي لكائن تخزين الطلبات
مثال: "order_storage_1"

langCode: string
رمز اللغة. الافتراضي: "en_US"
مثال: "en_US"

offset: number
معامل الإزاحة. الافتراضي: 0
مثال: 0

limit: number
معامل الحد. الافتراضي: 30
مثال: 30

بشكل افتراضي، يمكنك استرجاع 10 كائنات. وذلك بسبب حد السجلات في إعدادات أذونات الوحدة.
لعمل الترقيم بشكل صحيح، تحتاج إلى تكوين أذونات الوحدة وفقًا لاحتياجاتك في القسم المقابل.

جربها مباشرة

قم بتشغيل هذه الطريقة بشكل تفاعلي في JS SDK sandbox — قم بتوصيل عنوان URL لمشروعك ورمز التطبيق عند الزيارة الأولى، ثم افتح:

  • تاريخ الطلبات — استرجاع وعرض الطلبات السابقة للمستخدم حسب علامة التخزين.
  • اشتراك الطلب — تحقق مما إذا كان لدى المستخدم طلب اشتراك نشط.

أمثلة

مثال بسيط

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

مثال مع السمات

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

مثال على الاستجابة

{
"items": [
{
"id": 565,
"storageId": 1,
"createdDate": "2026-04-21T19:25:24.570Z",
"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": null,
"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": 564,
"storageId": 1,
"createdDate": "2026-04-21T19:23:38.644Z",
"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": null,
"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": 563,
"storageId": 1,
"createdDate": "2026-04-21T19:22:56.768Z",
"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": null,
"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": 371
}

مخطط الاستجابة

المخطط: IOrdersByMarkerEntity

items: IOrderByMarkerEntity[]
مصفوفة من كائنات تخزين الطلبات.
مثال:

[
{
"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
معرف الكائن.
مثال: 125

items.storageId: number
معرف كائن تخزين الطلبات.
مثال: 1

items.createdDate: string
تاريخ إنشاء الطلب.
مثال: "2023-10-01T12:00:00Z"

items.statusIdentifier: string
معرف نصي لحالة الطلب.
مثال: "order-status-1"

items.formIdentifier: string
معرف نصي للنموذج.
مثال: "bar-orders-form"

items.formData: IOrdersFormData[]
البيانات المقدمة من النموذج المرتبط بمخزن الطلبات.
مثال:

[
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
]

formData.marker: string
علامة حقل النموذج.
مثال: "name_1"

formData.type: string
نوع القيمة.
مثال: "string"

formData.value: string
القيمة.
مثال: "Name"

items.attributeSetIdentifier: string | null
معرف نصي لمجموعة السمات.
مثال: "attribute-set-1"

items.totalSum: string
إجمالي مبلغ الطلب.
مثال: "100.00"

items.currency: string
العملة المستخدمة لدفع الطلب.
مثال: "USD"

items.paymentAccountIdentifier: string | null
معرف نصي لدفع الطلب.
مثال: "payment-1"

items.paymentAccountLocalizeInfos: ILocalizeInfo
اسم حساب الدفع مع مراعاة التوطين.
مثال:

{
"title": "Cash"
}

items.products: IOrderProducts[]
مصفوفة من المنتجات المضافة إلى الطلب.
مثال:

[
{
"id": 1,
"name": "Product 1",
"quantity": 2
}
]

products.id: number
معرف المنتج.
مثال: 2957

products.quantity: number
كمية المنتج.
مثال: 1

products.title: string
عنوان المنتج.
مثال: "Cosmo"

products.sku: string | null
SKU المنتج.
مثال: "SKU"

products.previewImage: IPicture | null
صورة المعاينة للمنتج.
مثال:

{
"filename": "image.jpg",
"downloadLink": "https://example.com/image.jpg",
"size": 102400,
"previewLink": "https://example.com/image-preview.jpg"
}

previewImage.filename: string
اسم الملف.
مثال: "image.jpg"

previewImage.downloadLink: string
رابط URL لتنزيل الصورة.
مثال: "https://example.com/image.jpg"

previewImage.size: number
حجم الصورة بالبايت.
مثال: 102400

previewImage.previewLink: string
رابط URL لمعاينة الصورة.
مثال: "https://example.com/image-preview.jpg"

products.price: number
سعر المنتج.
مثال: 150

products.isGift: boolean
ما إذا كان المنتج هدية.
مثال: false

items.paymentUrl: string | null
رابط الدفع.
مثال: "https://example.com/pay/123"

items.isCompleted: boolean | null
تشير إلى أن الطلب قد اكتمل.
مثال: true

items.statusLocalizeInfos: ILocalizeInfo
اسم الحالة المترجم.

total: number
إجمالي عدد السجلات الموجودة.
مثال: 100