API reference
Availability
What is out at a branch now, from your POS or ERP.
PUTYour unavailable items at a branch (whole list)#
/partner/v1/branches/{id}/availabilityScope 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.
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
}
]
}'Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | The Let's Pizza branch id. |
Idempotency-Key * | header | string | Your 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. |
Request body PartnerAvailabilityRequest
itemsPartnerAvailabilityItem[]requireditems ≤ 2000
Child attributes (5)
kindstringrequiredValues:
"product""option"idstringoptionallength 1 – 64
codestringoptionallength 1 – 50
variantstringoptionallength 1 – 50
availablebooleanrequired
Responses
200OKPartnerAvailabilityResult
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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-Limit | integer | The key's requests per minute. |
RateLimit-Remaining | integer | Requests left in the current minute. |
RateLimit-Reset | integer | Seconds until the minute window resets. |
Schema
branchIdstringrequiredlength 1 – 64
offintegerrequiredvalue ≥ 0
onintegerrequiredvalue ≥ 0
keptStaffintegerrequiredvalue ≥ 0
unknownstring[]requiredunavailableobject[]requiredChild attributes (2)
kindstringrequiredValues:
"product""option"idstringrequiredlength 1 – 64
400INVALID_REQUEST (field, detail.issues), IDEMPOTENCY_KEY_REQUIREDPartnerError
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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. |
Example response
{
"branchId": "28",
"off": 1,
"on": 0,
"keptStaff": 0,
"unknown": [],
"unavailable": [
{
"kind": "product",
"id": "649"
}
]
}PATCHChange availability at a branch#
/partner/v1/branches/{id}/availabilityScope availability:write. Only the items listed: available: false takes one off, true puts back one you took off.
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
}
]
}'Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | The Let's Pizza branch id. |
Idempotency-Key * | header | string | Your 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. |
Request body PartnerAvailabilityRequest
itemsPartnerAvailabilityItem[]requireditems ≤ 2000
Child attributes (5)
kindstringrequiredValues:
"product""option"idstringoptionallength 1 – 64
codestringoptionallength 1 – 50
variantstringoptionallength 1 – 50
availablebooleanrequired
Responses
200OKPartnerAvailabilityResult
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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-Limit | integer | The key's requests per minute. |
RateLimit-Remaining | integer | Requests left in the current minute. |
RateLimit-Reset | integer | Seconds until the minute window resets. |
Schema
branchIdstringrequiredlength 1 – 64
offintegerrequiredvalue ≥ 0
onintegerrequiredvalue ≥ 0
keptStaffintegerrequiredvalue ≥ 0
unknownstring[]requiredunavailableobject[]requiredChild attributes (2)
kindstringrequiredValues:
"product""option"idstringrequiredlength 1 – 64
400INVALID_REQUEST (field, detail.issues), IDEMPOTENCY_KEY_REQUIREDPartnerError
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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
Headers
| Name | Type | Description |
|---|---|---|
X-Request-Id | string | The 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. |
Example response
{
"branchId": "28",
"off": 1,
"on": 0,
"keptStaff": 0,
"unknown": [],
"unavailable": [
{
"kind": "product",
"id": "649"
}
]
}