Skip to main content

API Keys and Public API

Overview​

SpectaQR provides a versioned read API for order data.

Current live endpoints:

  • GET /api/v1/locations/{locationSlug}/orders
  • GET /api/v1/locations/{locationSlug}/orders/{orderSlug}

This API is organization-scoped and key-authenticated.

The number of active API keys depends on your plan; see plan limits. Creating a key past the limit is refused, and to downgrade to a plan with fewer keys you must revoke the extras first.

Authentication​

Send your API key in either header:

  • x-api-key: <your secret>
  • Authorization: Bearer <your secret>

Only the venue owner can create/revoke keys from the staff settings dialog. Secrets are shown once at creation and then masked.

Base URL and Versioning​

  • Base URL: https://<your-web-app-domain>
  • Versioned path prefix: /api/v1
  • Response version header: X-API-Version: v1

Error Format​

All errors use a canonical envelope:

{
"error": {
"code": "unauthorized",
"message": "Unauthorized",
"requestId": "9b3d9ef5-89be-47a9-a5d0-9417f7f6c630",
"details": {
"hint": "optional"
}
}
}

Common status codes:

  • 400 invalid request
  • 401 unauthorized or missing API key
  • 404 location/order not found
  • 500 internal server error

Endpoints​

GET /api/v1/locations/{locationSlug}/orders​

List orders for one location.

Path params:

  • locationSlug (string)

Query params:

  • updatedAfter (optional, Unix milliseconds): only orders whose updatedAt is later.
  • limit (optional): orders per page, from 1 to 200. The default is 50.
  • cursor (optional): the nextCursor of the previous page. Send it with the same updatedAfter.

Orders come one page at a time, oldest updatedAt first. To sync, follow nextCursor until it is null, then poll with updatedAfter set to the highest updatedAt you received. An order that changes while you page through comes back on a later page with its new updatedAt, so store orders by slug and keep the latest copy. A cursor from another list, or with another updatedAfter, returns 400 with the code invalid_cursor.

Success response:

{
"version": "v1",
"locationSlug": "downtown",
"orders": [
{
"slug": "K7M2Q9XA",
"orderNumber": 42,
"locationSlug": "downtown",
"locationTimezone": "America/New_York",
"currencyId": "USD",
"table": {
"alias": 12,
"slug": "table-12",
"name": "Patio 1"
},
"isOpen": true,
"items": [
{
"menuItemId": "j57j4...",
"name": "Burger",
"orderItem": {
"_id": "h72da...",
"updatedAt": 1735689600000,
"deliveryStatus": "pending",
"deliveryFlow": "instant"
},
"prepStation": {
"id": "k17b2...",
"kind": "kitchen",
"name": "Kitchen"
},
"pricing": {
"listedPriceMinor": 1495,
"discountMinor": 0,
"netMinor": 1495,
"taxMinor": 133,
"grossMinor": 1628,
"taxRateMilliPercent": 8875,
"taxIncluded": false
},
"paymentId": null
},
{
"menuItemId": "j58k1...",
"name": "Packaged Snack",
"orderItem": {
"_id": "h72db...",
"updatedAt": 1735689600000,
"deliveryStatus": "pending",
"deliveryFlow": "instant"
},
"prepStation": {
"id": "k17b2...",
"kind": "kitchen",
"name": "Kitchen"
},
"pricing": {
"listedPriceMinor": 300,
"discountMinor": 0,
"netMinor": 300,
"taxMinor": 0,
"grossMinor": 300,
"taxRateMilliPercent": 0,
"taxIncluded": false
},
"paymentId": null
}
],
"payments": [],
"totals": {
"discountMinor": 0,
"subtotalMinor": 1795,
"taxMinor": 133,
"totalMinor": 1928,
"tipMinor": 0,
"totalWithTipMinor": 1928,
"taxBreakdown": [
{ "taxRateMilliPercent": 8875, "taxIncluded": false, "netMinor": 1495, "taxMinor": 133, "grossMinor": 1628, "lineCount": 1 },
{ "taxRateMilliPercent": 0, "taxIncluded": false, "netMinor": 300, "taxMinor": 0, "grossMinor": 300, "lineCount": 1 }
]
},
"orderedAt": 1735689600000,
"updatedAt": 1735689601000
}
],
"nextCursor": null
}

Order fields:

  • locationTimezone — the location's IANA timezone (e.g. Europe/Berlin). All timestamps are UTC Unix milliseconds; use it to show local times, as staff screens do.
  • orderedAt — when the order was placed. updatedAt changes whenever the order or one of its items changes, including a status change, so updatedAfter polling catches every change.
  • orderNumber — what staff and guests call the order (42 is shown as #42). Per location, it restarts at 1 each local day, so it is not unique: use slug as the id.
  • isOpen — false once every item is delivered or canceled.
  • closedAt — set when staff closed the order with items still pending (Close order): those items were marked delivered or canceled. Absent when the order completed item by item.
  • currencyId — uppercase ISO 4217 code. Every amount (…Minor) is an integer in that currency's ISO 4217 minor units: cents for every currency SpectaQR accepts (1928 = $19.28).
  • totals — over billable lines (canceled ones excluded), after any discount. Tax is computed once per order and rate, rounded half-up, and taxBreakdown has one row per rate and inclusion. totalMinor is the goods total and excludes any tip. Use taxBreakdown for tax reporting.
  • totals.discount — the discount staff set on the order, if any: { "kind": "percent", "milliPercent": 10000 } (10% off, in thousandths of a percent, like tax rates) or { "kind": "amount", "amountMinor": 500 }. Staff's reason for it is never included.
  • totals.discountMinor — what the discount took off the listed prices, before tax: the sum of the lines' pricing.discountMinor. 0 without a discount.
  • totals.tip — the optional staff or guest tip. It is a percentage (milliPercent) or a fixed amount (amountMinor), with setBy. A percentage uses the order total in most countries and the pre-tax subtotal in the US and Canada.
  • totals.tipMinor — the computed tip outside the tax base. 0 without a tip. totals.totalWithTipMinor is the goods total plus this amount. A POS books it apart from the sales, as bacșiș in Romania and TrinkgeldAN in Germany.
  • payments — rounds the guest paid online before they were sent to staff. Empty until online payments are available, and for orders paid at the venue. Each payment has id, provider (venue_stripe: the venue's own Stripe account), status (succeeded, partially_refunded or refunded), amountMinor, refundedAmountMinor, disputed, currency, paidAt and stripePaymentIntentId. A payment is not a fiscal record: the venue still records the order on its till.

Item fields:

  • orderItem.deliveryStatus — pending, ready, delivered or canceled. ready only occurs on lines whose deliveryFlow is prepared: the station has finished the item and it waits to be carried over. A ready line still counts as open and is billed. A canceled line stays in items but not in totals.
  • orderItem.deliveryFlow — instant (pending, delivered or canceled) or prepared (pending, ready, delivered or canceled), as the menu item was set when the line was ordered.
  • orderItem.estimatedMinutes — the minutes the item takes to prepare, when its menu item has an estimate. Only on prepared lines.
  • name — the item's name as ordered, frozen at order time.
  • pricing — the line's price. Each line is one unit. listedPriceMinor is what the menu showed, before any discount: gross when taxIncluded (VAT markets), net when tax is added on top (US/CA). discountMinor is the line's share of the order discount, taken off the listed price before tax (0 on canceled lines). netMinor + taxMinor = grossMinor, after the discount. For billable lines, taxMinor is the line's share of its rate's tax, so the lines add up exactly to totals; a share can move by one minor unit when another line joins or leaves the order. taxRateMilliPercent is in thousandths of a percent: 19000 = 19%, 8875 = 8.875%.
  • prepStation — the prep station the line was routed to when it was ordered: id, kind (kitchen, grill, bar, dessert or expo) and name. It never changes after the order is placed, even if the station is later renamed or removed.
  • paymentId — the payments[].id the guest paid this line with online, or null for a line paid at the venue. Always null until online payments are available.

GET /api/v1/locations/{locationSlug}/orders/{orderSlug}​

Get one order by slug.

Path params:

  • locationSlug (string)
  • orderSlug (string)

Success response:

{
"version": "v1",
"locationSlug": "downtown",
"order": {
"slug": "K7M2Q9XA",
"orderNumber": 42,
"locationSlug": "downtown",
"locationTimezone": "America/New_York",
"currencyId": "USD",
"table": {
"alias": 12,
"slug": "table-12",
"name": "Patio 1"
},
"isOpen": true,
"items": [
{
"menuItemId": "j57j4...",
"name": "Burger",
"orderItem": {
"_id": "h72da...",
"updatedAt": 1735689600000,
"deliveryStatus": "pending",
"deliveryFlow": "instant"
},
"prepStation": {
"id": "k17b2...",
"kind": "kitchen",
"name": "Kitchen"
},
"pricing": {
"listedPriceMinor": 1495,
"discountMinor": 0,
"netMinor": 1495,
"taxMinor": 133,
"grossMinor": 1628,
"taxRateMilliPercent": 8875,
"taxIncluded": false
},
"paymentId": null
},
{
"menuItemId": "j58k1...",
"name": "Packaged Snack",
"orderItem": {
"_id": "h72db...",
"updatedAt": 1735689600000,
"deliveryStatus": "pending",
"deliveryFlow": "instant"
},
"prepStation": {
"id": "k17b2...",
"kind": "kitchen",
"name": "Kitchen"
},
"pricing": {
"listedPriceMinor": 300,
"discountMinor": 0,
"netMinor": 300,
"taxMinor": 0,
"grossMinor": 300,
"taxRateMilliPercent": 0,
"taxIncluded": false
},
"paymentId": null
}
],
"payments": [],
"totals": {
"discountMinor": 0,
"subtotalMinor": 1795,
"taxMinor": 133,
"totalMinor": 1928,
"tipMinor": 0,
"totalWithTipMinor": 1928,
"taxBreakdown": [
{ "taxRateMilliPercent": 8875, "taxIncluded": false, "netMinor": 1495, "taxMinor": 133, "grossMinor": 1628, "lineCount": 1 },
{ "taxRateMilliPercent": 0, "taxIncluded": false, "netMinor": 300, "taxMinor": 0, "grossMinor": 300, "lineCount": 1 }
]
},
"orderedAt": 1735689600000,
"updatedAt": 1735689601000
}
}

Changelog​

  • v1 initial public orders read API
  • v1 orders include locationTimezone and orderedAt (additive)
  • v1 (before public launch) items carry name and pricing; orders carry isOpen and completedAt; totals became subtotalMinor, taxMinor, totalMinor and taxBreakdown (the …AtOrder, discount and rounding fields are gone)
  • v1 (before public launch) orders carry orderNumber and closedAt; totals carry discount and discountMinor, and line pricing carries discountMinor. Net, tax and gross amounts are after the discount
  • v1 (before public launch) orders carry payments and items carry paymentId (both empty until online payments are available)
  • v1 (before public launch) the order list is paged with limit, cursor and nextCursor, oldest updatedAt first