{"openapi":"3.1.0","info":{"title":"Penta Order API","version":"1.0.0","summary":"Orders, menu, customers and locations for restaurants on Penta Order.","description":"Read and update a restaurant's orders, menu and store status, and receive signed webhooks. Authenticate with an API key from Settings > Developers: `Authorization: Bearer po_live_…`. Money is always integer minor units (pence) with a currency. Errors look like `{ \"error\": { \"code\": \"…\", \"message\": \"…\" } }`.","contact":{"name":"Penta Order","url":"https://pentaorder.com/developers"}},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","servers":[{"url":"https://api.pentaorder.com"}],"security":[{"apiKey":[]}],"tags":[{"name":"Account","description":"Who the key belongs to."},{"name":"Orders","description":"Orders and their state."},{"name":"Menu","description":"Dishes, prices, allergens and sold out."},{"name":"Customers","description":"Customers, respecting their contact preferences."},{"name":"Locations","description":"Locations, pause and busy."},{"name":"Webhooks","description":"Subscribe to events (REST hooks, used by Zapier)."}],"paths":{"/v1/api/me":{"get":{"operationId":"getVApiMe","summary":"Check a key","description":"The restaurant and permissions of the key you sent. Zapier uses this to test a connection.","tags":["Account"],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooMany"}}}},"/v1/api/locations":{"get":{"operationId":"getVApiLocations","summary":"List locations","description":"Every location of the restaurant.\n\nNeeds the `locations:read` permission.","tags":["Locations"],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Location"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"locations:read"}},"/v1/api/locations/{locationId}/status":{"get":{"operationId":"getVApiLocationsLocationIdStatus","summary":"Get store status","description":"Which services are paused and how many busy minutes are added to every quote.\n\nNeeds the `locations:read` permission.","tags":["Locations"],"parameters":[{"name":"locationId","in":"path","required":true,"description":"The location's id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"locations:read"},"patch":{"operationId":"patchVApiLocationsLocationIdStatus","summary":"Pause or set busy","description":"Pause delivery, collection or dine-in for a number of minutes (null resumes now), or set busy minutes.\n\nNeeds the `locations:write` permission.","tags":["Locations"],"parameters":[{"name":"locationId","in":"path","required":true,"description":"The location's id","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationStatusChange"}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationStatus"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"locations:write"}},"/v1/api/orders":{"get":{"operationId":"getVApiOrders","summary":"List orders","description":"Orders newest first. Card orders appear once paid. Filter by location, state or time.\n\nNeeds the `orders:read` permission.","tags":["Orders"],"parameters":[{"name":"locationId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["placed","accepted","preparing","ready","out_for_delivery","completed","rejected","cancelled"]}},{"name":"since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"orders:read"}},"/v1/api/orders/{orderId}":{"get":{"operationId":"getVApiOrdersOrderId","summary":"Get an order","description":"One order with its lines, allergens and totals.\n\nNeeds the `orders:read` permission.","tags":["Orders"],"parameters":[{"name":"orderId","in":"path","required":true,"description":"The order's id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"orders:read"}},"/v1/api/orders/{orderId}/state":{"patch":{"operationId":"patchVApiOrdersOrderIdState","summary":"Change an order's state","description":"Send an event: accept (with prepMinutes), reject (with reason), start_preparing, mark_ready, dispatch, complete, cancel or recall. Changes follow the same rules as the order tablet; an impossible change answers 409.\n\nNeeds the `orders:write` permission.","tags":["Orders"],"parameters":[{"name":"orderId","in":"path","required":true,"description":"The order's id","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStateChange"}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"orders:write"}},"/v1/api/menu":{"get":{"operationId":"getVApiMenu","summary":"Get the menu","description":"Categories and dishes with prices (minor units), the 14 UK allergens and sold-out status.\n\nNeeds the `menu:read` permission.","tags":["Menu"],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Menu"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"menu:read"}},"/v1/api/menu/items/{itemId}/availability":{"patch":{"operationId":"patchVApiMenuItemsItemIdAvailability","summary":"Mark a dish sold out or back on","description":"Sold out \"today\" comes back at 05:00 tomorrow; \"indefinitely\" stays off until turned back on.\n\nNeeds the `menu:write` permission.","tags":["Menu"],"parameters":[{"name":"itemId","in":"path","required":true,"description":"The dish's id","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemAvailabilityChange"}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemAvailability"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"menu:write"}},"/v1/api/customers":{"get":{"operationId":"getVApiCustomers","summary":"List customers","description":"Customers newest first. Email is included only if the customer agreed to email, and phone only if they agreed to texts or WhatsApp.\n\nNeeds the `customers:read` permission.","tags":["Customers"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":200}},{"name":"since","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}],"responses":{"200":{"description":"Newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"customers:read"}},"/v1/api/webhooks":{"get":{"operationId":"getVApiWebhooks","summary":"List webhook endpoints","description":"Every webhook endpoint of the restaurant.\n\nNeeds the `webhooks:manage` permission.","tags":["Webhooks"],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"webhooks:manage"},"post":{"operationId":"postVApiWebhooks","summary":"Subscribe to events","description":"Add an https endpoint for one or more events. The response holds the signing secret, shown only once.\n\nNeeds the `webhooks:manage` permission.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscribe"}}}},"responses":{"201":{"description":"Subscribed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscription"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"webhooks:manage"}},"/v1/api/webhooks/{webhookId}":{"delete":{"operationId":"deleteVApiWebhooksWebhookId","summary":"Unsubscribe","description":"Remove a webhook endpoint. Deliveries still queued for it are dropped.\n\nNeeds the `webhooks:manage` permission.","tags":["Webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook endpoint's id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanUpgrade"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooMany"}},"x-penta-scope":"webhooks:manage"}}},"webhooks":{"order.created":{"post":{"summary":"New order","description":"An order was placed and paid (or pay later). Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"order.accepted":{"post":{"summary":"Order accepted","description":"The restaurant accepted the order. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"order.preparing":{"post":{"summary":"Order preparing","description":"The kitchen started the order. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"order.ready":{"post":{"summary":"Order ready","description":"Ready for collection or the driver. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"order.out_for_delivery":{"post":{"summary":"Out for delivery","description":"A driver has the order. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"order.completed":{"post":{"summary":"Order completed","description":"Collected, delivered or served. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"order.cancelled":{"post":{"summary":"Order cancelled","description":"Cancelled after it was accepted. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"order.rejected":{"post":{"summary":"Order rejected","description":"The restaurant turned the order down. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"menu.item.updated":{"post":{"summary":"Dish sold out or back on","description":"A dish's availability changed. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"customer.created":{"post":{"summary":"New customer","description":"A customer placed their first order with you. Signed with the Penta-Signature header.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"po_live_…","description":"API key from Settings > Developers. Permissions: orders:read, orders:write, menu:read, menu:write, customers:read, locations:read, locations:write, webhooks:manage."}},"schemas":{"Order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"integer"},"locationId":{"type":"string","format":"uuid"},"state":{"type":"string","enum":["placed","accepted","preparing","ready","out_for_delivery","completed","rejected","cancelled"]},"fulfilment":{"type":"string","enum":["delivery","collection","dine_in"]},"channel":{"type":"string","enum":["website","app","widget","qr_table","phone","kiosk","marketplace"]},"placedAt":{"type":"string","description":"ISO 8601 date and time"},"acceptedAt":{"anyOf":[{"type":"string","description":"ISO 8601 date and time"},{"type":"null"}]},"readyAt":{"anyOf":[{"type":"string","description":"ISO 8601 date and time"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","description":"ISO 8601 date and time"},{"type":"null"}]},"scheduledFor":{"anyOf":[{"type":"string","description":"ISO 8601 date and time"},{"type":"null"}]},"prepMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}]},"paymentMethod":{"type":"string","enum":["card","cash","pay_at_counter"]},"paymentStatus":{"type":"string"},"subtotal":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false},"discount":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false},"fees":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false},"tip":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false},"customer":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"name":{"type":"string"},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","phone","email"],"additionalProperties":false},"deliveryAddress":{"anyOf":[{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"postcode":{"type":"string"}},"required":["line1","city","postcode"],"additionalProperties":false},{"type":"null"}]},"tableLabel":{"type":["string","null"]},"note":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"itemId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"name":{"type":"string"},"variantName":{"type":"string"},"quantity":{"type":"integer"},"unitPrice":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false},"lineTotal":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false},"modifiers":{"type":"array","items":{"type":"string"}},"allergens":{"type":"array","items":{"type":"string"}},"note":{"type":["string","null"]}},"required":["itemId","name","variantName","quantity","unitPrice","lineTotal","modifiers","allergens","note"],"additionalProperties":false}}},"required":["id","number","locationId","state","fulfilment","channel","placedAt","acceptedAt","readyAt","completedAt","scheduledFor","prepMinutes","paymentMethod","paymentStatus","subtotal","discount","fees","tax","tip","total","customer","deliveryAddress","tableLabel","note","lines"],"additionalProperties":false},"Menu":{"type":"object","properties":{"currency":{"type":"string"},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"itemIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["id","name","itemIds"],"additionalProperties":false}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"allergens":{"type":"array","items":{"type":"string","enum":["celery","gluten","crustaceans","eggs","fish","lupin","milk","molluscs","mustard","tree_nuts","peanuts","sesame","soya","sulphites"]}},"dietary":{"type":"array","items":{"type":"string"}},"soldOut":{"type":"boolean"},"soldOutUntil":{"anyOf":[{"type":"string","description":"ISO 8601 date and time"},{"type":"null"}]},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"price":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"],"additionalProperties":false}},"required":["id","name","price"],"additionalProperties":false}}},"required":["id","name","description","imageUrl","allergens","dietary","soldOut","soldOutUntil","variants"],"additionalProperties":false}}},"required":["currency","categories","items"],"additionalProperties":false},"Location":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"timezone":{"type":"string"},"currency":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"postcode":{"type":"string"}},"required":["line1","city","postcode"],"additionalProperties":false},"phone":{"type":["string","null"]}},"required":["id","name","slug","status","timezone","currency","address","phone"],"additionalProperties":false},"LocationStatus":{"type":"object","properties":{"locationId":{"type":"string","format":"uuid"},"pausedUntil":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"busyExtraMinutes":{"type":"integer"}},"required":["locationId","pausedUntil","busyExtraMinutes"],"additionalProperties":false},"Customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"consent":{"type":"object","properties":{"email":{"type":"boolean"},"sms":{"type":"boolean"},"whatsapp":{"type":"boolean"}},"required":["email","sms","whatsapp"],"additionalProperties":false},"createdAt":{"type":"string","description":"ISO 8601 date and time"}},"required":["id","name","email","phone","consent","createdAt"],"additionalProperties":false},"Me":{"type":"object","properties":{"restaurant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"],"additionalProperties":false},"key":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["orders:read","orders:write","menu:read","menu:write","customers:read","locations:read","locations:write","webhooks:manage"]}}},"required":["id","name","prefix","scopes"],"additionalProperties":false}},"required":["restaurant","key"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["order.created","order.accepted","order.preparing","order.ready","order.out_for_delivery","order.completed","order.cancelled","order.rejected","menu.item.updated","customer.created"]}},"active":{"type":"boolean"},"description":{"type":"string"},"createdAt":{"type":"string","description":"ISO 8601 date and time"}},"required":["id","url","events","active","description","createdAt"],"additionalProperties":false},"WebhookSubscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["order.created","order.accepted","order.preparing","order.ready","order.out_for_delivery","order.completed","order.cancelled","order.rejected","menu.item.updated","customer.created"]}},"active":{"type":"boolean"},"description":{"type":"string"},"createdAt":{"type":"string","description":"ISO 8601 date and time"},"secret":{"type":"string"}},"required":["id","url","events","active","description","createdAt","secret"],"additionalProperties":false},"ItemAvailability":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"soldOut":{"type":"boolean"},"soldOutUntil":{"anyOf":[{"type":"string","description":"ISO 8601 date and time"},{"type":"null"}]}},"required":["id","soldOut","soldOutUntil"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","description":"Event id, the same on every retry: use it to ignore repeats"},"type":{"type":"string"},"createdAt":{"type":"string","description":"ISO 8601 date and time"},"restaurantId":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","createdAt","restaurantId","data"],"additionalProperties":false},"OrderStateChange":{"type":"object","properties":{"event":{"type":"string","enum":["accept","reject","start_preparing","mark_ready","dispatch","return_to_kitchen","complete","cancel","recall"]},"prepMinutes":{"type":"integer","minimum":1,"maximum":240},"reason":{"type":"string","maxLength":300}},"required":["event"]},"ItemAvailabilityChange":{"type":"object","properties":{"isAvailable":{"type":"boolean"},"until":{"default":"indefinitely","type":"string","enum":["today","indefinitely"]}},"required":["isAvailable"]},"LocationStatusChange":{"type":"object","properties":{"pause":{"type":"object","properties":{"service":{"type":"string","enum":["delivery","collection","dine_in"]},"minutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":1440},{"type":"null"}]}},"required":["service","minutes"]},"busyExtraMinutes":{"type":"integer","minimum":0,"maximum":120}}},"WebhookSubscribe":{"type":"object","properties":{"url":{"type":"string","maxLength":500,"format":"uri"},"events":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["order.created","order.accepted","order.preparing","order.ready","order.out_for_delivery","order.completed","order.cancelled","order.rejected","menu.item.updated","customer.created"]}},"description":{"default":"Added through the API","type":"string","maxLength":120}},"required":["url","events"]}},"responses":{"BadRequest":{"description":"Some details are missing or wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"The API key is missing, wrong or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"PlanUpgrade":{"description":"The restaurant's plan doesn't include the API (Business plan)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The key doesn't have the permission this needs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such record in this restaurant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"The order can't make that change from its current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooMany":{"description":"Too many requests for this key. Wait for the retry-after seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error":{"description":"Something went wrong","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}