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

مرجع الواجهة

التوفّر

What is out at a branch now, from your POS or ERP.

PUTYour unavailable items at a branch (whole list)#

PUT/partner/v1/branches/{id}/availability

Scope availability:write. Everything your system says is out at this branch now, by our id or your code: your earlier flags not listed are cleared. A flag branch staff set is never cleared by you (keptStaff). Changes reach the website and the app at once.

المصادقة
مفتاح الشريك في ترويسة Authorization
الصلاحيات المطلوبة
availability:write
curl -sS -X PUT "$LP_BASE_URL/partner/v1/branches/28/availability" \
  -H "Authorization: Bearer $LP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  --data '{
  "items": [
    {
      "kind": "product",
      "id": "649",
      "available": false
    }
  ]
}'

المعاملات

الاسمالموضعالنوعالوصف
id *pathstringThe Let's Pizza branch id.
Idempotency-Key *headerstringYour unique id of this request (≤ 128 characters). A repeat with the same key and body returns the first answer; the same key with another body is 422 IDEMPOTENCY_KEY_REUSED.

جسم الطلب PartnerAvailabilityRequest

  • itemsPartnerAvailabilityItem[]مطلوب

    العناصر: ≤ 2000

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

      القيم: "product""option"

    • idstringاختياري

      الطول: 1 – 64

    • codestringاختياري

      الطول: 1 – 50

    • variantstringاختياري

      الطول: 1 – 50

    • availablebooleanمطلوب

الردود

200OKPartnerAvailabilityResult

الترويسات

الاسمالنوعالوصف
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.

البنية

  • branchIdstringمطلوب

    الطول: 1 – 64

  • offintegerمطلوب

    القيمة: ≥ 0

  • onintegerمطلوب

    القيمة: ≥ 0

  • keptStaffintegerمطلوب

    القيمة: ≥ 0

  • unknownstring[]مطلوب
  • unavailableobject[]مطلوب
    الحقول الداخلية (2)
    • kindstringمطلوب

      القيم: "product""option"

    • idstringمطلوب

      الطول: 1 – 64

400INVALID_REQUEST (field, detail.issues), IDEMPOTENCY_KEY_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.
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.
403AVAILABILITY_NOT_ENABLED, BRANCH_NOT_ALLOWED, SCOPE_REQUIRED, PARTNER_SUSPENDED, IP_NOT_ALLOWEDPartnerError

الترويسات

الاسمالنوعالوصف
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.
409BRANCH_NOT_LIVE: your integration is not switched on at this branch yetPartnerError

الترويسات

الاسمالنوعالوصف
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.

مثال الرد

200 · PartnerAvailabilityResult
{
  "branchId": "28",
  "off": 1,
  "on": 0,
  "keptStaff": 0,
  "unknown": [],
  "unavailable": [
    {
      "kind": "product",
      "id": "649"
    }
  ]
}

PATCHChange availability at a branch#

PATCH/partner/v1/branches/{id}/availability

Scope availability:write. Only the items listed: available: false takes one off, true puts back one you took off.

المصادقة
مفتاح الشريك في ترويسة Authorization
الصلاحيات المطلوبة
availability:write
curl -sS -X PATCH "$LP_BASE_URL/partner/v1/branches/28/availability" \
  -H "Authorization: Bearer $LP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  --data '{
  "items": [
    {
      "kind": "product",
      "id": "649",
      "available": false
    }
  ]
}'

المعاملات

الاسمالموضعالنوعالوصف
id *pathstringThe Let's Pizza branch id.
Idempotency-Key *headerstringYour unique id of this request (≤ 128 characters). A repeat with the same key and body returns the first answer; the same key with another body is 422 IDEMPOTENCY_KEY_REUSED.

جسم الطلب PartnerAvailabilityRequest

  • itemsPartnerAvailabilityItem[]مطلوب

    العناصر: ≤ 2000

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

      القيم: "product""option"

    • idstringاختياري

      الطول: 1 – 64

    • codestringاختياري

      الطول: 1 – 50

    • variantstringاختياري

      الطول: 1 – 50

    • availablebooleanمطلوب

الردود

200OKPartnerAvailabilityResult

الترويسات

الاسمالنوعالوصف
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.

البنية

  • branchIdstringمطلوب

    الطول: 1 – 64

  • offintegerمطلوب

    القيمة: ≥ 0

  • onintegerمطلوب

    القيمة: ≥ 0

  • keptStaffintegerمطلوب

    القيمة: ≥ 0

  • unknownstring[]مطلوب
  • unavailableobject[]مطلوب
    الحقول الداخلية (2)
    • kindstringمطلوب

      القيم: "product""option"

    • idstringمطلوب

      الطول: 1 – 64

400INVALID_REQUEST (field, detail.issues), IDEMPOTENCY_KEY_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.
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.
403AVAILABILITY_NOT_ENABLED, BRANCH_NOT_ALLOWED, SCOPE_REQUIRED, PARTNER_SUSPENDED, IP_NOT_ALLOWEDPartnerError

الترويسات

الاسمالنوعالوصف
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.
409BRANCH_NOT_LIVE: your integration is not switched on at this branch yetPartnerError

الترويسات

الاسمالنوعالوصف
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.

مثال الرد

200 · PartnerAvailabilityResult
{
  "branchId": "28",
  "off": 1,
  "on": 0,
  "keptStaff": 0,
  "unknown": [],
  "unavailable": [
    {
      "kind": "product",
      "id": "649"
    }
  ]
}