Send a table order

Send the seated diner's order to the restaurant's team, with sizes, choices and notes, when orders go to Tamr.

POST/api/v1/table/ordersClient API

The diner's order goes to the team, checked as the QR menu checks it: every line on sale, sizes and required choices given. A refusal names each problem line. Your app then hears order.placed, and your backend gets the order.placed webhook.

Authentication

Client API. Send your publishable key in x-tamr-key and the diner's session in x-tamr-session, from Start a session. For a guest's session, also send its device id in x-tamr-device. A browser may call it only from an origin listed on the key.

Headers

NameTypeRequiredDescription
x-tamr-devicestringNoGuest sessions only: the device id the session was exchanged with. Matches ^[A-Za-z0-9_-]{8,128}$.
x-tamr-appstringNoNative apps only: the app's iOS bundle id or Android package name. A key used from an app it doesn't list is logged, never refused. Matches ^[A-Za-z][A-Za-z0-9_-]*(\.[A-Za-z0-9_-]+)+$.

Request body

FieldTypeRequiredDescription
branchstringNoAn address: lower-case letters, digits and dashes.
linesarray of objectYes1 to 60 items.
lines[].dishIdstringYes1 to 200 characters.
lines[].variantLabelstring or nullYes1 to 80 characters.
lines[].quantityintegerYes1 to 99.
lines[].notestring or nullNoAt most 140 characters.
lines[].choicesarray of objectNoAt most 6 items.
lines[].choices[].groupstringYes1 to 80 characters.
lines[].choices[].optionsarray of stringYesAt most 24 items. 1 to 80 characters.
lines[].fromWaiterbooleanNo
notestringNoAt most 280 characters.
allergyNotestringNoAt most 200 characters.
idempotencyKeystringYes8 to 64 characters.

Response

FieldTypeDescription
orderobject
order.orderIdstring1 to 200 characters.
order.numberintegerThe short number staff call out, per branch and service day. -9,007,199,254,740,991 to 9,007,199,254,740,991.
order.statusstringOne of awaiting_payment, sent, accepted, served, declined, cancelled, expired, unknown. An open list: read a value you don't know as unknown.
order.branchstringAn address: lower-case letters, digits and dashes.
order.tablestring or null1 to 40 characters.
order.currencystringA three-letter currency code (ISO 4217).
order.subtotalstringAn amount in minor units, as a string.
order.linesarray of object1 to 100 items.
order.lines[].dishIdstring or null1 to 200 characters.
order.lines[].externalIdstring or null1 to 200 characters.
order.lines[].titlestring1 to 200 characters.
order.lines[].variantLabelstring or null1 to 80 characters.
order.lines[].quantityinteger-9,007,199,254,740,991 to 9,007,199,254,740,991.
order.lines[].unitPricestringAn amount in minor units, as a string.
order.fulfilmentstringMay be absent. One of dine_in, pickup, unknown. An open list: read a value you don't know as unknown.
order.pickupAtstring (date-time) or nullMay be absent.
order.pickupCodestring or nullMay be absent. 1 to 12 characters.
order.testbooleanMay be absent.

Example

curl https://tamr.link/api/v1/table/orders \
  -H "x-tamr-key: $TAMR_APP_KEY" \
  -H "x-tamr-session: $TAMR_SESSION" \
  -H "content-type: application/json" \
  -d '{
  "branch": "achrafieh",
  "lines": [
    {
      "dishId": "dish_kafta",
      "variantLabel": "Large",
      "quantity": 2,
      "note": "No onions",
      "fromWaiter": true
    },
    {
      "dishId": "dish_fattoush",
      "variantLabel": null,
      "quantity": 1,
      "choices": [
        {
          "group": "Dressing",
          "options": [
            "Pomegranate"
          ]
        }
      ]
    }
  ],
  "note": "We share the mains",
  "idempotencyKey": "abababababababab"
}'

Example response

{
  "order": {
    "orderId": "ord_01",
    "number": 17,
    "status": "sent",
    "branch": "achrafieh",
    "table": "12",
    "currency": "USD",
    "subtotal": "2450",
    "lines": [
      {
        "dishId": "dish_kafta",
        "externalId": "SKU-KAFTA",
        "title": "Kafta skewers",
        "variantLabel": "Large",
        "quantity": 2,
        "unitPrice": "900"
      },
      {
        "dishId": "dish_fattoush",
        "externalId": null,
        "title": "Fattoush",
        "variantLabel": null,
        "quantity": 1,
        "unitPrice": "650"
      }
    ]
  }
}

Errors

Every error has the same body; switch on data.code. See Errors and rate limits.

data.codeStatusWhat to do
app_key_invalid401The key is wrong, revoked or of another kind. Check it in the dashboard.
sdk_disabled403The SDK isn't switched on for this restaurant. Ask Tamr.
origin_not_allowed403A browser called from an origin the key doesn't list. Add the origin to the key.
session_expired401Start a new session with a fresh token or code, then send the call again once.
invalid_request400A field doesn't match the spec. The message says which.
rate_limited429Wait retryAfter seconds (also in the Retry-After header), then try again.
table_refused409A seat or a table order was refused. refusal says why.
unavailable503Tamr can't serve this now. Try again later.