Saltar para o conteúdo
tablezio

Reservations

Reservations

Book tables, manage the lifecycle (pending → confirmed → arrived → seated → completed), and let Tablezio score no-show risk for every booking.

Check availability

GET /v1/reservations/availability Escopo: reservations:read

Returns the bookable time slots for a date, computed from the restaurant’s configured opening hours and real table capacity (existing reservations and a buffer between sittings are taken into account). Use it to power a booking widget: ask for a date, show the guest only the slots where a table for their party is free, then POST to create the reservation. A day the restaurant is closed returns closed:true with an empty slots array.

Parâmetros de consulta

datestring (YYYY-MM-DD)Opcional

Required. The day to check.

party_sizeintegerOpcional

Guests to seat. Filters slots to tables that fit. Default 2.

fromstring (HH:MM)Opcional

Override the window start (else opening hours).

tostring (HH:MM)Opcional

Override the window end (else closing time).

slot_intervalintegerOpcional

Minutes between slots (else the restaurant’s slot duration, default 30).

Requisição

curl 'https://api.tablezio.com/v1/reservations/availability?date=2026-06-12&party_size=4' \
  -H 'X-API-Key: tbz_…'

Resposta

application/json
{
  "object": "reservation_availability",
  "date": "2026-06-12",
  "party_size": 4,
  "slot_interval_minutes": 30,
  "open": true,
  "closed": false,
  "slots": [
    { "time": "13:00", "available": true,  "remaining_capacity": 6, "total_reservations": 1 },
    { "time": "13:30", "available": true,  "remaining_capacity": 4, "total_reservations": 2 },
    { "time": "14:00", "available": false, "remaining_capacity": 0, "total_reservations": 5 }
  ]
}

List reservations

GET /v1/reservations Escopo: reservations:read

Returns reservations for the restaurant. Filter by status, exact date (YYYY-MM-DD) or a date range with date.gte / date.lte.

Parâmetros de consulta

limitintegerOpcional

Page size, default 10, max 100.

starting_afterstringOpcional

Cursor.

ending_beforestringOpcional

Cursor (backwards).

statusstringOpcional

Filter by status.

pendingconfirmedarrivedseatedcompletedcancelledno_show
datestring (YYYY-MM-DD)Opcional

Restrict to a single day.

date.gteinteger (unix)Opcional

Lower bound of reservation date.

date.lteinteger (unix)Opcional

Upper bound of reservation date.

expandstring[]Opcional

table.

Requisição

curl 'https://api.tablezio.com/v1/reservations?date=2026-06-12' -H 'X-API-Key: tbz_…'

Resposta

application/json
{ "object": "list", "data": [ /* reservation */ ], "has_more": false, "next_cursor": null, "previous_cursor": null, "url": "/v1/reservations" }

Retrieve a reservation

GET /v1/reservations/{id} Escopo: reservations:read

Fetch a single reservation.

Parâmetros de caminho

idstringObrigatório

Reservation ID (rsv_…).

Parâmetros de consulta

expandstring[]Opcional

table.

Requisição

curl https://api.tablezio.com/v1/reservations/rsv_… -H 'X-API-Key: tbz_…'

Resposta

application/json
{
  "id": "rsv_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "reservation",
  "created": 1716730000,
  "updated": 1716730000,
  "guest": { "name": "Lucia", "email": "[email protected]", "phone": null },
  "customer": null,
  "party_size": 4,
  "date": "2026-06-12",
  "time": "20:30",
  "duration_minutes": 90,
  "table": null,
  "status": "confirmed",
  "arrived_at": null,
  "seated_at": null,
  "completed_at": null,
  "source": "api",
  "notes": null,
  "special_requests": "Anniversary dinner",
  "tags": [],
  "no_show_risk": 5
}

Create a reservation

POST /v1/reservations Escopo: reservations:write

Books a table. We compute a no-show risk score based on the guest history and reservation properties.

Parâmetros do corpo

guest_namestringObrigatório

Display name shown on the floor plan.

party_sizeintegerObrigatório

Number of guests, >= 1.

datestring (YYYY-MM-DD)Obrigatório

Reservation date.

timestring (HH:MM)Obrigatório

Reservation time, 24-hour clock.

guest_emailstringOpcional

Guest contact email, stored on the reservation.

guest_phonestringOpcional

Guest contact phone, stored on the reservation.

duration_minutesintegerOpcional

Expected dinner length. Defaults to 90.

tablestringOpcional

Specific table id; omit to let auto-assign pick.

notesstringOpcional

Internal staff notes.

special_requestsstringOpcional

Guest-visible requests (allergies, occasion).

tagsstring[]Opcional

Free-form tags for filtering.

sourcestringOpcional

Where the booking came from (api, widget, walk-in…).

Requisição

curl -X POST https://api.tablezio.com/v1/reservations \
  -H 'X-API-Key: tbz_…' \
  -H 'Idempotency-Key: rsv_lucia_2026-06-12_20:30' \
  -H 'Content-Type: application/json' \
  -d '{
    "guest_name": "Lucia",
    "guest_email": "[email protected]",
    "party_size": 4,
    "date": "2026-06-12",
    "time": "20:30",
    "special_requests": "Anniversary dinner"
  }'

Resposta

application/json
{
  "id": "rsv_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "reservation",
  "created": 1716730000,
  "updated": 1716730000,
  "guest": { "name": "Lucia", "email": "[email protected]", "phone": null },
  "customer": null,
  "party_size": 4,
  "date": "2026-06-12",
  "time": "20:30",
  "duration_minutes": 90,
  "table": null,
  "status": "confirmed",
  "arrived_at": null,
  "seated_at": null,
  "completed_at": null,
  "source": "api",
  "notes": null,
  "special_requests": "Anniversary dinner",
  "tags": [],
  "no_show_risk": 5
}

Update a reservation

PATCH /v1/reservations/{id} Escopo: reservations:write

Edit guest details, party size, time slot, or table. Status transitions live on the /status route below.

Parâmetros de caminho

idstringObrigatório

Reservation ID.

Parâmetros do corpo

*anyOpcional

Any field accepted on create.

Requisição

curl -X PATCH https://api.tablezio.com/v1/reservations/rsv_… \
  -H 'X-API-Key: tbz_…' -H 'Content-Type: application/json' \
  -d '{ "party_size": 5 }'

Resposta

application/json
{
  "id": "rsv_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "reservation",
  "created": 1716730000,
  "updated": 1716730000,
  "guest": { "name": "Lucia", "email": "[email protected]", "phone": null },
  "customer": null,
  "party_size": 4,
  "date": "2026-06-12",
  "time": "20:30",
  "duration_minutes": 90,
  "table": null,
  "status": "confirmed",
  "arrived_at": null,
  "seated_at": null,
  "completed_at": null,
  "source": "api",
  "notes": null,
  "special_requests": "Anniversary dinner",
  "tags": [],
  "no_show_risk": 5
}

Update reservation status

PATCH /v1/reservations/{id}/status Escopo: reservations:write

Move the reservation through its lifecycle. Emits reservation.updated, reservation.cancelled, or reservation.no_show.

Parâmetros de caminho

idstringObrigatório

Reservation ID.

Parâmetros do corpo

statusstringObrigatório

Target status.

pendingconfirmedarrivedseatedcompletedcancelledno_show

Requisição

curl -X PATCH https://api.tablezio.com/v1/reservations/rsv_…/status \
  -H 'X-API-Key: tbz_…' -H 'Content-Type: application/json' \
  -d '{ "status": "seated" }'

Resposta

application/json
{
  "id": "rsv_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "reservation",
  "created": 1716730000,
  "updated": 1716730000,
  "guest": { "name": "Lucia", "email": "[email protected]", "phone": null },
  "customer": null,
  "party_size": 4,
  "date": "2026-06-12",
  "time": "20:30",
  "duration_minutes": 90,
  "table": null,
  "status": "confirmed",
  "arrived_at": null,
  "seated_at": null,
  "completed_at": null,
  "source": "api",
  "notes": null,
  "special_requests": "Anniversary dinner",
  "tags": [],
  "no_show_risk": 5
}

Cancel a reservation

POST /v1/reservations/{id}/cancel Escopo: reservations:write

Shortcut for setting status to cancelled. Emits reservation.cancelled.

Parâmetros de caminho

idstringObrigatório

Reservation ID.

Requisição

curl -X POST https://api.tablezio.com/v1/reservations/rsv_…/cancel -H 'X-API-Key: tbz_…'

Resposta

application/json
{
  "id": "rsv_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "reservation",
  "created": 1716730000,
  "updated": 1716730000,
  "guest": { "name": "Lucia", "email": "[email protected]", "phone": null },
  "customer": null,
  "party_size": 4,
  "date": "2026-06-12",
  "time": "20:30",
  "duration_minutes": 90,
  "table": null,
  "status": "confirmed",
  "arrived_at": null,
  "seated_at": null,
  "completed_at": null,
  "source": "api",
  "notes": null,
  "special_requests": "Anniversary dinner",
  "tags": [],
  "no_show_risk": 5
}