Get payment options

Read whether the diner can pay with Tamr Pay here, the providers, limits and tip presets.

GET/api/v1/pay/optionsClient API

Whether the diner can pay with Tamr Pay at this branch and table, which providers, their limits and the tip presets. With orderId, the options for paying that pickup ahead.

With orderId, the options for paying that pickup ahead, at its own location and menu.

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.

Query parameters

NameTypeRequiredDescription
branchstringNoAn address: lower-case letters, digits and dashes.
orderIdstringNo1 to 200 characters.

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_-]+)+$.

Response

FieldTypeDescription
availableboolean
reasonstring or nullOne of not_enabled, paused, no_provider, provider_not_available, test_key, orders_to_app, invalid_amount, below_minimum, above_maximum, tip_too_large, tips_off, daily_cap, wallet_full, monthly_cap, payment_in_progress, already_paid, provider_unavailable, provider_error, table_already_paid, tab_not_found, typed_amount_off, tab_nothing_owed, tab_amount_over, tab_changed, other. An open list: read a value you don't know as other.
currencystring or nullA three-letter currency code (ISO 4217).
exponentinteger or null0 to 4.
providersarray of objectAt most 8 items.
providers[].idstring1 to 40 characters.
providers[].namestring1 to 80 characters.
providers[].merchantNamestring1 to 200 characters.
providers[].minstringAn amount in minor units, as a string.
providers[].maxstringAn amount in minor units, as a string.
tipPresetsarray of integer or nullAt most 6 items. 0 to 10,000.
typedAmountstring or nullOne of allowed, off, against_tab, unknown. An open list: read a value you don't know as unknown.
tabobject or null
tab.tablestring1 to 40 characters.
tab.amountstringAn amount in minor units, as a string.
openPaymentobject or null
openPayment.paymentIdstring1 to 200 characters.
openPayment.referencestring1 to 40 characters.
openPayment.statusstringOne of open, paid, failed, expired, refunded, unknown. An open list: read a value you don't know as unknown.
openPayment.amountstringAn amount in minor units, as a string.
openPayment.tipstringAn amount in minor units, as a string.
openPayment.totalstringAn amount in minor units, as a string.
openPayment.currencystringA three-letter currency code (ISO 4217).
openPayment.expiresAtstring (date-time) or null
openPayment.providerstringMay be absent. 1 to 40 characters.
openPayment.paystringMay be absent. One of tab, amount, order, unknown. An open list: read a value you don't know as unknown.

Example

curl "https://tamr.link/api/v1/pay/options?branch=achrafieh" \
  -H "x-tamr-key: $TAMR_APP_KEY" \
  -H "x-tamr-session: $TAMR_SESSION"

Example response

{
  "available": true,
  "reason": null,
  "currency": "USD",
  "exponent": 2,
  "providers": [
    {
      "id": "whish",
      "name": "Whish",
      "merchantName": "Abiroot S.A.R.L. (Tamr)",
      "min": "100",
      "max": "50000"
    }
  ],
  "tipPresets": [
    1000,
    1500,
    2000
  ],
  "typedAmount": "allowed",
  "tab": {
    "table": "12",
    "amount": "2400"
  },
  "openPayment": null
}

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.