Seat the diner at a table

Seat the diner at the table whose QR code they scanned, checked against the restaurant's floor plan, before they order.

POST/api/v1/tableClient API

When orders go to Tamr, a dine-in order needs a table: send what the diner scanned (the printed code's full tamr.link address, or the table's code with the branch). Tamr checks it against the restaurant's floor plan; a code from another restaurant reads as an unknown table.

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
scanstringYes1 to 500 characters.
branchstringNoAn address: lower-case letters, digits and dashes.

Response

FieldTypeDescription
tableobject or null
table.codestring1 to 40 characters.
table.zonestring or nullAt most 80 characters.
branchstring or nullAn address: lower-case letters, digits and dashes.
canSendboolean
blockedBystring or nullOne of unknown_table, table_off_plan, no_table, table_cleared, stale, ordering_off, paused, closed, unavailable, test_key, other. An open list: read a value you don't know as other.
pausedUntilstring (date-time) or null
allergenDisclaimerstring or nullAt most 2,000 characters.
roundsarray of objectAt most 50 items.
rounds[].orderIdstring1 to 200 characters.
rounds[].numberintegerThe short number staff call out, per branch and service day. -9,007,199,254,740,991 to 9,007,199,254,740,991.
rounds[].statusstringOne of awaiting_payment, sent, accepted, served, declined, cancelled, expired, unknown. An open list: read a value you don't know as unknown.
rounds[].branchstringAn address: lower-case letters, digits and dashes.
rounds[].tablestring or null1 to 40 characters.
rounds[].currencystringA three-letter currency code (ISO 4217).
rounds[].subtotalstringAn amount in minor units, as a string.
rounds[].linesarray of object1 to 100 items.
rounds[].lines[].dishIdstring or null1 to 200 characters.
rounds[].lines[].externalIdstring or null1 to 200 characters.
rounds[].lines[].titlestring1 to 200 characters.
rounds[].lines[].variantLabelstring or null1 to 80 characters.
rounds[].lines[].quantityinteger-9,007,199,254,740,991 to 9,007,199,254,740,991.
rounds[].lines[].unitPricestringAn amount in minor units, as a string.
rounds[].fulfilmentstringMay be absent. One of dine_in, pickup, unknown. An open list: read a value you don't know as unknown.
rounds[].pickupAtstring (date-time) or nullMay be absent.
rounds[].pickupCodestring or nullMay be absent. 1 to 12 characters.
rounds[].testbooleanMay be absent.

Example

curl https://tamr.link/api/v1/table \
  -H "x-tamr-key: $TAMR_APP_KEY" \
  -H "x-tamr-session: $TAMR_SESSION" \
  -H "content-type: application/json" \
  -d '{
  "scan": "https://tamr.link/m/cedar-house/dinner?b=achrafieh&t=12&s=qr"
}'

Example response

{
  "table": {
    "code": "12",
    "zone": "Terrace"
  },
  "branch": "achrafieh",
  "canSend": true,
  "blockedBy": null,
  "pausedUntil": null,
  "rounds": [
    {
      "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"
        }
      ]
    }
  ],
  "allergenDisclaimer": "Tell your server about any allergy before you order."
}

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.
not_found404Not this diner's, or doesn't exist. The two read the same on purpose.