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

مرجع الواجهة

الهوية

Who the key is and what it may do.

GETThe key, its partner and settings#

GET/partner/v1/me

Any valid key may call it: the first call to make with a new key. environment is the host’s (always the key’s own, or the key would be refused). settings say how orders, statuses, the menu and invoices flow for your system.

المصادقة
مفتاح الشريك في ترويسة Authorization
الصلاحيات المطلوبة
أي مفتاح صالح
curl -sS "$LP_BASE_URL/partner/v1/me" \
  -H "Authorization: Bearer $LP_API_KEY"

الردود

200OKPartnerMe

الترويسات

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

البنية

  • partnerobjectمطلوب

    الشريك الذي يملك المفتاح.

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

      معرّف الشريك لدى ليتس بيتزا.

      الطول: 1 – 64

    • namestringمطلوب

      اسم الشريك كما يظهر في لوحة التحكم.

    • kindPartnerKindمطلوب

      نوع النظام، ويحدد الإعدادات والصلاحيات الافتراضية.

      القيم: "erp""pos""kds""delivery""marketplace""accounting""analytics""other"

  • keyobjectمطلوب

    المفتاح الذي أُرسل في هذا الطلب.

    الحقول الداخلية (8)
    • idstringمطلوب

      الطول: 1 – 64

    • envIntegrationModeمطلوب

      بيئة المفتاح: الاختبار أو الإنتاج.

      القيم: "sandbox""live"

    • labelstringمطلوب

      اسم المفتاح الذي اختاره فريق ليتس بيتزا.

    • prefixstringمطلوب

      أول أحرف المفتاح للتمييز بين المفاتيح، وليس المفتاح نفسه.

    • scopesPartnerScope[]مطلوب

      الصلاحيات التي يحملها المفتاح.

      القيم: "branches:read""catalog:read""catalog:write""availability:write""orders:read""orders:ack""orders:status""orders:cancel""orders:events""payments:read""reports:read""webhooks:manage""mappings:write"

    • branchesstring[]مطلوبيقبل null

      الفروع التي يعمل عليها المفتاح، و null تعني كل الفروع.

    • ratePerMinuteintegerمطلوب

      عدد الطلبات المسموح بها في الدقيقة لهذا المفتاح.

    • expiresAtstring<date-time>مطلوبيقبل null

      تاريخ انتهاء المفتاح، و null تعني بلا تاريخ انتهاء.

  • environmentIntegrationModeمطلوب

    بيئة الخادم الذي أجاب، وتطابق بيئة المفتاح دائماً.

    القيم: "sandbox""live"

  • settingsPartnerSettingsمطلوب

    كيف تسير الطلبات والحالات والمنيو والفواتير مع نظامك.

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

        كيف تصلك الطلبات: none بلا طلبات، pull بالسحب، webhooks بالإشعارات، connector نتصل نحن بنظامك.

        القيم: "none""pull""webhooks""connector"

      • acceptanceOrderAcceptanceمطلوب

        من يقبل الطلب الجديد: lp لوحة الفرع لدينا، أو partner نظامك.

        القيم: "lp""partner"

      • ackMinutesintegerمطلوب

        الدقائق التي ينتظرها الطلب تأكيد استلامك قبل تنبيه الفرع (0 بلا تنبيه).

        القيمة: 0 – 120

      • statusesPartnerStatusTarget[]مطلوب

        الحالات التي يحق لنظامك إبلاغها.

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

        العناصر: ≤ 9

      • connectorstringمطلوبيقبل null

        الموصّل المستخدم عندما تكون طريقة الاستلام connector.

        الطول: ≤ 40

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

        true: نظامك مصدر المنيو (شريك واحد فقط يكون كذلك).

      • fieldsCatalogField[]مطلوب

        حقول المنيو التي يملكها نظامك، ويبقى الباقي (الصور والترتيب) في لوحة التحكم.

        القيم: "names""descriptions""prices""sizes""groups""options""categories""availability"

        العناصر: ≤ 8

      • publishCatalogPublishPolicyمطلوب

        ما يحدث للمنيو المرسل: manual مراجعة يدوية، auto_prices نشر تلقائي لتغيّر الأسعار فقط، auto نشر تلقائي بعد الفحوص.

        القيم: "manual""auto_prices""auto"

      • maxPriceChangePctintegerمطلوب

        أقصى نسبة تغيّر في السعر تُنشر تلقائياً.

        القيمة: 0 – 100

      • maxRemovalsintegerمطلوب

        أقصى عدد أصناف يجوز أن يختفي في نشر تلقائي.

        القيمة: 0 – 1000

    • availabilitybooleanمطلوب

      true: يُطبَّق توفّر الأصناف الذي يرسله نظامك (يوقف الأصناف فقط، ولا يلغي إيقاف الموظفين).

    • invoicesobjectمطلوب
      الحقول الداخلية (1)
      • issuerInvoiceIssuerمطلوب

        من يُصدر الفاتورة الضريبية للعميل: lp منصتنا، أو partner نظامك.

        القيم: "lp""partner"

    • customerDatastringمطلوب

      القيم: "full""masked"

    • liveBranchesstring[]مطلوب

      الفروع المفعّلة لنظامك، وتبقى فارغة حتى نفعّلها معك.

      العناصر: ≤ 200

  • apiVersionstringمطلوب

    إصدار الواجهة.

    القيم: "v1"

  • serverTimestring<date-time>مطلوب

    ساعة الخادم: قارنها بساعتك قبل التحقق من التواقيع.

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.
403PARTNER_SUSPENDED, IP_NOT_ALLOWED, SCOPE_REQUIRED (detail.required lists the scopes), BRANCH_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.
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 · PartnerMe
{
  "partner": {
    "id": "ptn_01JD5ZB2",
    "name": "Business Central (EDM)",
    "kind": "erp"
  },
  "key": {
    "id": "key_01JD5ZC9",
    "env": "sandbox",
    "label": "EDM sandbox",
    "prefix": "lpk_test_Ab3d",
    "scopes": [
      "branches:read",
      "catalog:read",
      "catalog:write",
      "availability:write",
      "orders:read",
      "orders:ack",
      "orders:status",
      "orders:cancel",
      "orders:events",
      "payments:read",
      "reports:read",
      "webhooks:manage",
      "mappings:write"
    ],
    "branches": null,
    "ratePerMinute": 600,
    "expiresAt": null
  },
  "environment": "sandbox",
  "settings": {
    "orders": {
      "delivery": "pull",
      "acceptance": "partner",
      "ackMinutes": 3,
      "statuses": [
        "accepted",
        "rejected",
        "preparing",
        "ready",
        "picked_up",
        "cancelled"
      ],
      "connector": null
    },
    "catalog": {
      "source": false,
      "fields": [
        "names",
        "prices",
        "sizes",
        "groups",
        "options",
        "categories",
        "availability"
      ],
      "publish": "manual",
      "maxPriceChangePct": 20,
      "maxRemovals": 5
    },
    "availability": true,
    "invoices": {
      "issuer": "lp"
    },
    "customerData": "full",
    "liveBranches": [
      "28"
    ]
  },
  "apiVersion": "v1",
  "serverTime": "2026-11-19T19:30:12.000+03:00"
}

POSTOAuth 2.0 access token (client credentials)#

POST/partner/v1/oauth/token

For systems that prefer OAuth to a fixed key. grant_type=client_credentials, client_id = your key’s id (the key.id of GET /me), client_secret = the key; in a JSON or form body, or in HTTP Basic. The answer is a bearer token lpt_… valid for one hour (never past the key’s own end) with the key’s scopes: send it as Authorization: Bearer exactly like the key. A revoked key stops its tokens at once. Refusals carry detail.error (invalid_client, unsupported_grant_type, invalid_request).

المصادقة
بلا مصادقة
curl -sS -X POST "$LP_BASE_URL/partner/v1/oauth/token" \
  -H "Content-Type: application/json" \
  --data '{
  "grant_type": "client_credentials",
  "client_id": "key_01JD5ZC9",
  "client_secret": "lpk_test_…"
}'

جسم الطلب PartnerTokenRequest

  • grant_typestringمطلوب

    الطول: ≤ 40

  • client_idstringمطلوب

    الطول: 1 – 64

  • client_secretstringمطلوب

    الطول: 10 – 200

  • scopestringاختياري

    الطول: ≤ 500

الردود

200OKPartnerTokenResponse

الترويسات

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

البنية

  • access_tokenstringمطلوب
  • token_typestringمطلوب

    القيم: "Bearer"

  • expires_inintegerمطلوب

    القيمة: ≥ 1

  • scopestringمطلوب
400INVALID_REQUEST (detail.error: invalid_request, unsupported_grant_type)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.
401UNAUTHENTICATED (detail.error: invalid_client), KEY_ENVIRONMENT_MISMATCHPartnerError

الترويسات

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

الترويسات

الاسمالنوعالوصف
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 · PartnerTokenResponse
{
  "access_token": "lpt_…",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "branches:read catalog:read catalog:write availability:write orders:read orders:ack orders:status orders:cancel orders:events payments:read reports:read webhooks:manage mappings:write"
}

GETYour request log#

GET/partner/v1/logs

Every request of your keys in this environment (refusals included), newest first, kept 30 days; never a body. nextBefore pages back. Quote a requestId to support.

المصادقة
مفتاح الشريك في ترويسة Authorization
الصلاحيات المطلوبة
أي مفتاح صالح
curl -sS "$LP_BASE_URL/partner/v1/logs" \
  -H "Authorization: Bearer $LP_API_KEY"

المعاملات

الاسمالموضعالنوعالوصف
beforequeryinteger
limitqueryinteger

الردود

200OKPartnerRequestLogPage

الترويسات

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

البنية

  • itemsPartnerRequestLogRow[]مطلوب
    الحقول الداخلية (12)
    • idintegerمطلوب

      القيمة: ≥ 1

    • requestIdstringمطلوب
    • keyIdstringمطلوبيقبل null

      الطول: 1 – 64

    • keyPrefixstringمطلوبيقبل null
    • envIntegrationModeمطلوب

      القيم: "sandbox""live"

    • methodstringمطلوب
    • pathstringمطلوب
    • statusintegerمطلوب
    • errorCodestringمطلوبيقبل null
    • durationMsintegerمطلوب

      القيمة: ≥ 0

    • ipstringمطلوبيقبل null
    • atstring<date-time>مطلوب
  • nextBeforeintegerمطلوبيقبل null
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.
403PARTNER_SUSPENDED, IP_NOT_ALLOWED, SCOPE_REQUIRED (detail.required lists the scopes), BRANCH_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.
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 · PartnerRequestLogPage
{
  "items": [
    {
      "id": "7f3a2c10-5b8e-4d21-9c47-1a2b3c4d5e01",
      "requestId": "req_01JD7Q8W3K2M",
      "keyId": "string",
      "keyPrefix": "string",
      "env": "sandbox",
      "method": "string",
      "path": "string",
      "status": 0,
      "errorCode": "string",
      "durationMs": 0,
      "ip": "string",
      "at": "2026-11-19T19:30:12+03:00"
    }
  ],
  "nextBefore": 0
}