مطوّرو ليتس بيتزاv1.0.0

مرجع الواجهة

بيئة الاختبار

Tools that exist on the sandbox only: test orders.

POSTPlace a test order#

POST/partner/v1/sandbox/orders

Sandbox only (403 SANDBOX_ONLY on production). Scopes orders:read and orders:status. A real order on the sandbox, made the way a customer’s is (quote, then order), so it reaches your feed, your webhooks and your connector like any order — at a branch your key may act on. Lines absent = one Margherita. Then move it with your status calls, or let the sandbox branch staff do it.

المصادقة
مفتاح الشريك في ترويسة Authorization
الصلاحيات المطلوبة
orders:readorders:status
curl -sS -X POST "$LP_BASE_URL/partner/v1/sandbox/orders" \
  -H "Authorization: Bearer $LP_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "branchId": "28",
  "fulfilment": "pickup",
  "paymentMethod": "pay_at_branch"
}'

جسم الطلب PartnerSandboxOrderRequest

  • branchIdstringمطلوب

    الطول: 1 – 64

  • fulfilmentstringمطلوب

    القيم: "pickup""delivery"

  • linesCartLine[]اختياري

    العناصر: 1 – 20

    الحقول الداخلية (5)
    • productIdstringمطلوب

      الطول: 1 – 64

    • qtyintegerمطلوب

      القيمة: ≥ 1

    • selectionsCartSelection[]مطلوب
      الحقول الداخلية (5)
      • groupIdstringمطلوب

        الطول: 1 – 64

      • optionIdstringمطلوب

        الطول: 1 – 64

      • qtyintegerمطلوب

        القيمة: ≥ 1

      • placementstringاختياري

        القيم: "whole""left""right"

      • amountstringاختياري

        القيم: "light""regular""extra"

    • notestringاختياري

      الطول: ≤ 200

    • sourceobjectاختياري
      الحقول الداخلية (2)
      • experiencestringمطلوب

        القيم: "classic""graphical"

      • modestringاختياري

        الطول: ≤ 32

  • paymentMethodstringاختياري

    القيم: "pay_at_branch""cash_on_delivery"

  • deliveryobjectاختياري
    الحقول الداخلية (5)
    • addressstringمطلوب

      الطول: 3 – 300

    • detailsstringاختياري

      الطول: ≤ 300

    • locationobjectاختياري
      الحقول الداخلية (2)
      • latnumberمطلوب

        القيمة: -90 – 90

      • lngnumberمطلوب

        القيمة: -180 – 180

    • contactNamestringمطلوب

      الطول: 1 – 80

    • contactPhonestringمطلوب

      الطول: 9 – 20

الردود

201CreatedOrder

الترويسات

الاسمالنوعالوصف
X-Request-IdstringThe id of this request: quote it to support. Send your own (8–64 of A-Z a-z 0-9 . _ -) to trace a call end to end.
RateLimit-LimitintegerThe key's requests per minute.
RateLimit-RemainingintegerRequests left in the current minute.
RateLimit-ResetintegerSeconds until the minute window resets.

البنية

  • idstringمطلوب

    الطول: 1 – 64

  • numberstringمطلوب
  • statusstringمطلوب

    القيم: "pending_payment""payment_failed""placed""accepted""preparing""ready""out_for_delivery""delivered""picked_up""cancelled""rejected""delivery_failed""not_collected"

  • channelstringمطلوب

    القيم: "app""web""console""pos""dine_in"

  • branchIdstringمطلوب

    الطول: 1 – 64

  • fulfilmentstringمطلوب

    القيم: "delivery""pickup"

  • paymentMethodstringمطلوب

    القيم: "pay_at_branch""cash_on_delivery""online"

  • catalogVersionstringمطلوب
  • linesOrderLine[]مطلوب
    الحقول الداخلية (5)
    • lineIndexintegerمطلوب

      القيمة: ≥ 0

    • lineCartLineمطلوب
      الحقول الداخلية (5)
      • productIdstringمطلوب

        الطول: 1 – 64

      • qtyintegerمطلوب

        القيمة: ≥ 1

      • selectionsCartSelection[]مطلوب
        الحقول الداخلية (5)
        • groupIdstringمطلوب

          الطول: 1 – 64

        • optionIdstringمطلوب

          الطول: 1 – 64

        • qtyintegerمطلوب

          القيمة: ≥ 1

        • placementstringاختياري

          القيم: "whole""left""right"

        • amountstringاختياري

          القيم: "light""regular""extra"

      • notestringاختياري

        الطول: ≤ 200

      • sourceobjectاختياري
        الحقول الداخلية (2)
        • experiencestringمطلوب

          القيم: "classic""graphical"

        • modestringاختياري

          الطول: ≤ 32

    • unitPriceintegerمطلوب

      Amount in halalas (1 riyal = 100), VAT-inclusive

      القيمة: ≥ 0

    • lineTotalintegerمطلوب

      Amount in halalas (1 riyal = 100), VAT-inclusive

      القيمة: ≥ 0

    • snapshotLineSnapshotمطلوب
      الحقول الداخلية (2)
      • namesLocalizedمطلوب
        الحقول الداخلية (2)
        • arstringمطلوب
        • enstringمطلوب
      • optionsSnapshotOption[]مطلوب
        الحقول الداخلية (7)
        • groupIdstringمطلوب

          الطول: 1 – 64

        • optionIdstringمطلوب

          الطول: 1 – 64

        • namesLocalizedمطلوب
          الحقول الداخلية (2)
          • arstringمطلوب
          • enstringمطلوب
        • qtyintegerمطلوب

          القيمة: ≥ 1

        • priceintegerمطلوب

          Amount in halalas (1 riyal = 100), VAT-inclusive

          القيمة: ≥ 0

        • placementstringاختياري

          القيم: "whole""left""right"

        • amountstringاختياري

          القيم: "light""regular""extra"

  • subtotalintegerمطلوب

    Amount in halalas (1 riyal = 100), VAT-inclusive

    القيمة: ≥ 0

  • discountsDiscount[]مطلوب
    الحقول الداخلية (4)
    • kindstringمطلوب

      القيم: "coupon""offer"

    • codestringاختياري
    • namesLocalizedمطلوب
      الحقول الداخلية (2)
      • arstringمطلوب
      • enstringمطلوب
    • amountintegerمطلوب

      Amount in halalas (1 riyal = 100), VAT-inclusive

      القيمة: ≥ 0

  • discountTotalintegerمطلوب

    Amount in halalas (1 riyal = 100), VAT-inclusive

    القيمة: ≥ 0

  • deliveryFeeintegerمطلوب

    Amount in halalas (1 riyal = 100), VAT-inclusive

    القيمة: ≥ 0

  • totalintegerمطلوب

    Amount in halalas (1 riyal = 100), VAT-inclusive

    القيمة: ≥ 0

  • vatobjectمطلوب
    الحقول الداخلية (3)
    • rateBpsintegerمطلوب
    • amountintegerمطلوب

      Amount in halalas (1 riyal = 100), VAT-inclusive

      القيمة: ≥ 0

    • includesDeliveryFeebooleanمطلوب
  • scheduledForstring<date-time>اختياري
  • notestringاختياري
  • cutlerybooleanاختياري
  • ifUnavailablestringاختياري
  • deliveryobjectاختياري
    الحقول الداخلية (5)
    • addressstringمطلوب

      الطول: 3 – 300

    • detailsstringاختياري

      الطول: ≤ 300

    • locationobjectاختياري
      الحقول الداخلية (2)
      • latnumberمطلوب

        القيمة: -90 – 90

      • lngnumberمطلوب

        القيمة: -180 – 180

    • contactNamestringمطلوب

      الطول: 1 – 80

    • contactPhonestringمطلوب

      الطول: 9 – 20

  • courierobjectاختياري
    الحقول الداخلية (2)
    • namestringمطلوب
    • phonestringاختياري
  • tenderstringاختياري
  • paidAtstring<date-time>اختياري
  • createdAtstring<date-time>مطلوب
  • historyStatusChange[]مطلوب
    الحقول الداخلية (7)
    • fromstringمطلوبيقبل null

      القيم: "pending_payment""payment_failed""placed""accepted""preparing""ready""out_for_delivery""delivered""picked_up""cancelled""rejected""delivery_failed""not_collected"

    • tostringمطلوب

      القيم: "pending_payment""payment_failed""placed""accepted""preparing""ready""out_for_delivery""delivered""picked_up""cancelled""rejected""delivery_failed""not_collected"

    • atstring<date-time>مطلوب
    • actorStatusChangeActorمطلوب

      القيم: "customer""staff""system""payment""partner"

    • reasonstringاختياري
    • reasonCodestringاختياري
    • returnedToBranchbooleanاختياري
401UNAUTHENTICATED (no key, a wrong or revoked one), KEY_EXPIRED, KEY_ENVIRONMENT_MISMATCH (a test key on production or the other way round)PartnerError

الترويسات

الاسمالنوعالوصف
X-Request-IdstringThe id of this request: quote it to support. Send your own (8–64 of A-Z a-z 0-9 . _ -) to trace a call end to end.
403SANDBOX_ONLY, BRANCH_NOT_ALLOWED, SCOPE_REQUIREDPartnerError

الترويسات

الاسمالنوعالوصف
X-Request-IdstringThe id of this request: quote it to support. Send your own (8–64 of A-Z a-z 0-9 . _ -) to trace a call end to end.
422SANDBOX_QUOTE_INVALID (detail.errors: the quote’s codes, e.g. BRANCH_CLOSED)PartnerError

الترويسات

الاسمالنوعالوصف
X-Request-IdstringThe id of this request: quote it to support. Send your own (8–64 of A-Z a-z 0-9 . _ -) to trace a call end to end.
429RATE_LIMITED: wait Retry-After seconds (also in detail.retryAfterSeconds)PartnerError

الترويسات

الاسمالنوعالوصف
X-Request-IdstringThe id of this request: quote it to support. Send your own (8–64 of A-Z a-z 0-9 . _ -) to trace a call end to end.
500INTERNAL_ERROR: retryable; quote the X-Request-Id if it persistsPartnerError

الترويسات

الاسمالنوعالوصف
X-Request-IdstringThe id of this request: quote it to support. Send your own (8–64 of A-Z a-z 0-9 . _ -) to trace a call end to end.

مثال الرد

201 · Order
{
  "id": "7f3a2c10-5b8e-4d21-9c47-1a2b3c4d5e01",
  "number": "261119-0041",
  "status": "placed",
  "channel": "app",
  "branchId": "28",
  "fulfilment": "delivery",
  "paymentMethod": "cash_on_delivery",
  "catalogVersion": "taker-2026-10-06.5d01b76bc1",
  "lines": [
    {
      "lineIndex": 0,
      "line": {
        "productId": "649",
        "qty": 2,
        "selections": [
          {
            "groupId": "1362",
            "optionId": "11836",
            "qty": 1
          }
        ],
        "source": {
          "experience": "classic"
        }
      },
      "unitPrice": 4200,
      "lineTotal": 8400,
      "snapshot": {
        "names": {
          "ar": "مارقريتا",
          "en": "Margherita Pizza"
        },
        "options": [
          {
            "groupId": "1362",
            "optionId": "11836",
            "names": {
              "ar": "صلصة طماطم",
              "en": "Tomato Sauce"
            },
            "qty": 1,
            "price": 0
          }
        ]
      }
    },
    {
      "lineIndex": 1,
      "line": {
        "productId": "740",
        "qty": 2,
        "selections": [],
        "source": {
          "experience": "classic"
        }
      },
      "unitPrice": 600,
      "lineTotal": 1200,
      "snapshot": {
        "names": {
          "ar": "كولا",
          "en": "Coca Cola Can"
        },
        "options": []
      }
    }
  ],
  "subtotal": 9600,
  "discounts": [],
  "discountTotal": 0,
  "deliveryFee": 1800,
  "total": 11400,
  "vat": {
    "rateBps": 1500,
    "amount": 1487,
    "includesDeliveryFee": true
  },
  "cutlery": false,
  "ifUnavailable": "call",
  "delivery": {
    "address": "حي المعذر الشمالي، شارع الأمير سلطان، عمارة 14",
    "details": "الدور الثاني، شقة 5، بجوار الصيدلية",
    "location": {
      "lat": 24.6921,
      "lng": 46.6853
    },
    "contactName": "عبدالله",
    "contactPhone": "+966500000000"
  },
  "createdAt": "2026-11-19T19:30:12+03:00",
  "history": [
    {
      "from": null,
      "to": "placed",
      "at": "2026-11-19T19:30:12+03:00",
      "actor": "customer"
    }
  ]
}