Create an order
Try itOpens an order with its first lines, and sends them to the kitchen when asked.
https:/ / tablebuddy.radioworkflow.com/ api/ v1/ ordersOpens an order with its first round, as the POS does, and sends the round to the kitchen when send is true. The order is recorded as made through the API, and reads channel: table_buddy.
A dine-in order takes a free table (table_id), and needs one where the restaurant orders by table. A delivery needs delivery_address. Each line names a menu item on sale, a quantity from 1 to 999, the add-ons chosen from its groups, and a note for the kitchen. Prices, tax and the service charge come from the menu and the restaurant's settings, never from the request.
Sending a round makes a kitchen ticket and takes prepared food and recipe stock, as the POS does. See Idempotency before retrying.
Authentication
Authorization: Bearer <key>, or the same key in x-api-key. A key acts as the person who made it, cut down to this endpoint’s scope, and never as an owner. How keys workpos.use)Request headers
AuthorizationrequiredBearer <key>. x-api-key: <key> works too; Authorization wins when both are sent.Idempotency-KeyrequiredContent-Typerequiredapplication/json: the body is JSON.Request body
typeenumrequiredDINE_INTAKEAWAYCOUNTERDELIVERYtable_idstringidoptionalnullablecustomer_namestring≤ 100 charsoptionalnullableNo NUL character or unpaired surrogate.
customer_phonestring≤ 40 charsoptionalnullableNo NUL character or unpaired surrogate.
delivery_addressstring≤ 500 charsoptionalnullableNo NUL character or unpaired surrogate.
guestsinteger1–999optionalnotestring≤ 500 charsoptionalnullableNo NUL character or unpaired surrogate.
linesarray of object1–200 itemsrequiredlines[].menu_item_idstringidrequiredlines[].quantityinteger1–999requiredlines[].addon_idsarray of stringid≤ 40 itemsoptionalDefault [].
lines[].notestring≤ 200 charsoptionalnullableNo NUL character or unpaired surrogate.
sendbooleanoptionalDefault false.
A field the endpoint does not take is answered 422 invalid_request naming it, before anything is looked up or the Idempotency-Key is used.
Response
kot_number is null unless send was true. Read the order back with get-order.
currencystringISO 4217minor_digitsinteger0–3order_idstringidnumberintegerkot_numberintegernullableAn answer may gain fields within v1: ignore the ones you do not know. Versioning
Response headers
request-idalwaysCache-Controlalwaysno-store: an answer is never cached.RateLimit-Limit, RateLimit-Remaining, RateLimit-Resetonce the key is knownx-error-codeon an errorerror.code in the body.Idempotent-Replayed, Original-Request-Idon a replayed writetrue, and the request-id of the request that ran: this is the kept answer to an earlier request with the same Idempotency-Key.Retry-Afteron a 429, and a 409 idempotency_key_in_useWWW-Authenticateon a 401, and a 403 insufficient_scopeErrors
invalid_idempotency_keyA–Z a–z 0–9 - _ . : ~ + / =.Fix: Send a UUID.
idempotency_key_requiredFix: Generate one per operation; reuse it only to retry that operation.
insufficient_scopeFix: Scopes are fixed when a key is made: make a new key with the scope.
issuer_access_endedFix: Make a new key from an active account.
issuer_permission_changedFix: Ask an owner to restore the permission, or make a new key from an account that holds it.
permission_requiredFix: Use a key with the named scope, from a creator who holds the named permission.
refusedFix: Read the sentence: it says what to change. The endpoint page lists the common ones.
idempotency_key_in_useFix: Wait Retry-After seconds and send the same request again.
payload_too_largeFix: Send less; split a batch.
json_requiredContent-Type: application/json.Fix: Send JSON with that header.
invalid_requestFix: Fix the named fields. Nothing was done, and an Idempotency-Key is not used up.
idempotency_key_reusedFix: Use a new key for a new request.
Refused by the restaurant’s rules
Answered 409 refused with the engine’s own sentence, the one the console shows. The common ones:
Pick a table for a dine-in order.
A dine-in order with no table, where the restaurant orders by table.
Fix: Send table_id, a table from list-tables.
Table {table} already has order #{number} open. Add to that order instead.
The table already has an open order.
Fix: Add a round to that order with add-order-items.
Table {table} is switched off.
The table is switched off on the floor plan.
Fix: Pick another table from list-tables.
Add the delivery address before sending a delivery order.
A delivery with no address.
Fix: Send delivery_address.
One of those items is no longer on the menu.
An item that is off the menu, or not this restaurant's.
Fix: Pick items from list-menu-items with active=true.
{item} is marked unavailable.
An item that is sold out (86ed).
Fix: Pick another item, or put it back on sale with set-menu-item-availability.
{item} is sold out.
A prepared item with no portions left.
Fix: Pick another item, or log more portions made in Table Buddy.
{item} is in a category hidden from the POS.
An item in a category hidden from the POS.
Fix: Pick another item, or show its category on the POS.
That add-on is not available for {item}.
An add-on the item does not offer.
Fix: Pick add-ons from the item's addon_groups (get-menu-item).
{item}: choose {count} {group}.
Fewer add-ons than a group requires.
Fix: Choose at least the group's min_select add-ons from it.
{item}: choose at most {count} for {group}.
More add-ons than a group allows.
Fix: Choose at most the group's max_select add-ons from it.
missing_api_keyNo Authorization: Bearer header and no x-api-key header.invalid_api_keyThe key is unknown, revoked or expired (answered alike).rate_limitedOver the key's 60 units a minute, or over 30 unknown keys a minute from one network (an address; an IPv6 caller's /64).internal_errorSomething failed on our side. Nothing kept the Idempotency-Key.curl -X POST "$TABLEBUDDY_URL/api/v1/orders" \
-H "Authorization: Bearer $TABLEBUDDY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{"type":"COUNTER","lines":[{"menu_item_id":"MENU_ITEM_ID","quantity":1,"addon_ids":[]}],"send":true}'{
"currency": "USD",
"minor_digits": 2,
"order_id": "cmg5x0q2k0001tb2j8v4h6y3n",
"number": 142,
"kot_number": 318
}