Tables API

Manage restaurant tables, their layout positions, computed occupancy statuses, and self-ordering QR tokens.

Table Object

NameTypeRequiredDescription
iduuidRequiredUnique table identifier
restaurant_iduuidRequiredOwning restaurant
numberintegerRequiredTable number (unique per restaurant)
namestringOptionalOptional display name
capacityintegerOptionalSeating capacity (default 4)
areastringOptionalArea or zone (e.g. "Terrace", "Main Hall")
position_xnumberOptionalX position on the floor-plan canvas
position_ynumberOptionalY position on the floor-plan canvas
is_activebooleanRequiredWhether the table is active (soft-delete flag)
sort_orderintegerOptionalCustom sort position
statusstringRequiredComputed status: "free", "occupied", or "reserved"
active_orderobject | nullOptionalCurrently active order on this table, or null

List Tables

GET/api/tablesProtected

Retrieve all tables for the current restaurant. Each table includes a computed status and the active order if one exists.

json
// Response 200
{
  __PH1__: [
    {
      __PH2__: "a1b2c3d4-...",
      __PH4__: 1,
      __PH5__: "Window Seat",
      __PH7__: 4,
      __PH8__: "Main Hall",
      __PH10__: "occupied",
      __PH12__: {
        __PH13__: "order-uuid",
        __PH15__: 2450,
        __PH16__: 3
      }
    }
  ]
}

Create Table

POST/api/tablesProtected

Create a new table. The table number must be unique within the restaurant.

Request Body

NameTypeRequiredDescription
numberintegerRequiredTable number (must be unique per restaurant)
namestringOptionalOptional display name
capacityintegerOptionalSeating capacity (defaults to 4)
areastringOptionalArea or zone name
json
// Request
{
  __PH2__: 12,
  __PH3__: "Corner Booth",
  __PH5__: 6,
  __PH6__: "Terrace"
}

// Response 201
{
  __PH8__: "a1b2c3d4-...",
  __PH10__: 12,
  __PH11__: "Corner Booth",
  __PH13__: 6,
  __PH14__: "Terrace",
  __PH16__: true,
  __PH17__: "free",
  __PH19__: null
}

Update Table

PUT/api/tables/{id}Protected

Update an existing table. All mutable fields can be changed.

json
// Request
{
  __PH1__: "VIP Booth",
  __PH3__: 8,
  __PH4__: "VIP Zone",
  __PH6__: 320,
  __PH7__: 180
}

Delete Table

DELETE/api/tables/{id}Protected

Soft-delete a table by setting is_active to false. The record is retained for GoBD audit compliance.

json
// Response 200
{
  __PH1__: "Table deactivated successfully"
}

QR Tokens

QR tokens enable self-ordering for guests. A unique token is generated per table and encoded into a QR code that guests scan to place orders.

POST/api/tables/{tableId}/qr-tokenAdmin Only

Generate a new QR token for the specified table. Any previously active token for the table is automatically deactivated.

json
// Response 201
{
  __PH2__: "token-uuid",
  __PH4__: "a1b2c3d4-...",
  __PH6__: "pssf_qr_abc123xyz",
  __PH8__: "https:__PH1__
  "created_at": "2026-03-20T10:__PH12__:00Z"
}
GET/api/qr-tokensAdmin Only

List all active QR tokens for the restaurant.

json
// Response 200
{
  __PH1__: [
    {
      __PH2__: "token-uuid",
      __PH4__: "a1b2c3d4-...",
      __PH6__: 12,
      __PH7__: "pssf_qr_abc123xyz",
      __PH9__: true,
      __PH10__: "2026-03-20T10:30:00Z"
    }
  ]
}
DELETE/api/qr-tokens/{id}Admin Only

Deactivate a QR token. The token will no longer allow self-ordering.

json
// Response 200
{
  __PH1__: "QR token deactivated"
}