Developer docs

Let guests order from the table

Print a QR code per table, let guests scan it to order onto a tab, and settle the tab at the bar or by card — with a gift voucher, without an API key.

A QR code on a table turns a guest's phone into the order pad: scan, pick from the menu, order, watch the tab grow, pay when done. This tutorial sets it up and walks the guest's side through the API, which needs no key — the token in the QR code is the credential.

QR ordering needs the Pro plan or higher. Paying the tab by card needs Premium, online payments switched on and a connected Stripe payout account; a guest can always pay at the bar instead.

1. Prepare menus and resources

A guest orders from the menus of the resource they scanned. A menu is Food or Drinks, built from groups and items with prices; item names must be unique within a menu, because an order names its items. Which menus a table offers depends on the resource: a restaurant table may order from both, a billiard table only from the drinks menu. Check each resource's ordering setting in the console before you print codes, and see Menus and Resources.

2. Generate the codes

In the console's QR codes area choose Generate QR codes (qr_codes_generate over MCP): every resource of the venue gets an active code, and running it again only fills in resources that have none. Print them from there. A code points to a page on app.bookdineplay.com with the token in the address.

Treat a printed code like a key to that one table:

  • Regenerate when a code has leaked or a sticker was copied; the old token stops working at once, for ever, and the new one has to be printed. Regenerating asks for confirmation first over MCP.
  • Never put a token into analytics, logs or a page other guests can see.

3. What a guest sees

The sequence behind the page, which you can reproduce on your own page — none of these routes take a key:

Step Call Notes
Scan GET /api/qr/{token} Venue, table name and type, enough for "Table 4 at The Neon Tap". 404 for an unknown or revoked token, or a venue no longer entitled
Open the menu GET /api/qr/{token}/session The menus for this table and the running tab. isOpen is false until the first order
Order POST /api/qr/{token}/orders One or more lines. The first order opens the tab; each line's price is fixed at that moment
Pay POST /api/qr/{token}/payment Card payment of the whole tab on Stripe
Close POST /api/qr/{token}/close The invoice: lines, subtotal, tax included, total

An order names a menu by id and an item by name, as they appear in the session:

curl

curl -X POST "https://api.bookdineplay.com/api/qr/<token>/orders" \
  -H "Content-Type: application/json" \
  -d '{ "lines": [ { "menuId": "kitchen", "itemName": "Smash burger", "quantity": 2 }, { "menuId": "bar", "itemName": "House lager", "quantity": 1 } ] }'

JavaScript

const updated = await (await fetch(`https://api.bookdineplay.com/api/qr/${encodeURIComponent(token)}/orders`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ lines: [{ menuId: 'kitchen', itemName: 'Smash burger', quantity: 2 }] })
})).json();
console.log(updated.runningTotal, updated.currency);

C#

var updated = await client.PlaceOrderAsync(token, new PlaceOrderRequest([
    new OrderLineRequest("kitchen", "Smash burger", 2),
    new OrderLineRequest("bar", "House lager", 1)
]), cancellationToken);

PHP

<?php
$response = wp_remote_post( 'https://api.bookdineplay.com/api/qr/' . rawurlencode( $token ) . '/orders', [
    'headers' => [ 'Content-Type' => 'application/json' ],
    'body'    => wp_json_encode( [ 'lines' => [ [ 'menuId' => 'kitchen', 'itemName' => 'Smash burger', 'quantity' => 2 ] ] ] ),
] ); // sends no key
$updated = json_decode( wp_remote_retrieve_body( $response ), true );

The whole order is refused with 400 when any line names a menu or item that is not orderable at this table: nothing is placed. A tab closed between the guest's last read and the order answers 409; re-read the session and the next order opens a fresh tab.

4. What staff see

Orders arrive in the console's orders view per table (orders_list), with the lines, quantities and the running total.

5. Paying the tab

At the bar. Staff close the tab in the console, or the guest closes it with POST …/close and receives the invoice. Closing is never blocked by a card payment that is still open, because a guest can always put cash down.

By card. POST /api/qr/{token}/payment freezes the tab at its current total for 31 minutes, opens a Stripe Checkout session on the venue's own account and returns the checkoutUrl to send the guest to:

curl

curl -X POST "https://api.bookdineplay.com/api/qr/<token>/payment"

JavaScript

const payment = await (await fetch(`https://api.bookdineplay.com/api/qr/${encodeURIComponent(token)}/payment`, { method: 'POST' })).json();
location.href = payment.checkoutUrl;

C#

var payment = await client.StartTabPaymentAsync(token, null, cancellationToken);

PHP

<?php
$response = wp_remote_post( 'https://api.bookdineplay.com/api/qr/' . rawurlencode( $token ) . '/payment' ); // sends no key
$payment = json_decode( wp_remote_retrieve_body( $response ), true );

Three behaviours are deliberate:

  • The tab is frozen while a payment is live. The amount Stripe collects is fixed when Checkout opens, so an order added afterwards would go unpaid; POST …/orders answers 409 and the session reports paymentPending with the same paymentUrl, so a second phone at the table sees the payment in progress. If the guest abandons Checkout, the freeze lapses on its own and the tab takes orders again.
  • Two taps give one payment. Calling the route again while a payment is live returns the same checkout. The tab itself is the claim, so the guest's phone needs no idempotency header.
  • A completed payment closes the tab. You do not call …/close as well. If a guest also paid at the bar, the card payment is still recorded because it is real and refundable; the venue may then have been paid twice and decides which to give back.

With a gift voucher. Add voucherCode to the body and an amount or percentage voucher pays what it can; the card pays the rest, never below Stripe's minimum. A voucher that covers the whole tab opens no Stripe session: the tab is settled and closed at once and paidInFull is true (Vouchers). Staff can also apply a voucher at the table; the session then shows the credit and the amountDue.

6. Limits and failure modes

  • No venue entitlement, locked venue, revoked code: the token answers 404 everywhere. The guest sees "this table is not available".
  • Card payment not possible right now — payments off, plan, or payout account not finished: the payment route answers 409. Offer paying at the bar.
  • A tab of €0.50 or less that a voucher does not cover cannot be paid by card: 409 with reason below-card-minimum.

Next steps