Next Restaurant 6.1.0: move your data in, run payroll, and connect other systems Next Inventory 6.2.0: a REST API and webhooks for your other systems Next DB 6.1: Auto-Updating Tables, Printing, Phone Layout and SEO Next Task 6.0.0: a task manager for Joomla Next Inventory 6.1.1: smoother Check Out, no more list limits, and much faster PHP2Shell: Is Your Joomla Site Safe? What to Do Today Introducing Next Boards: Kanban project and task boards for Joomla Building the Future of Joomla Extensions
NextSoftware

Update Reservation

PATCH /v1/nextrestaurant/reservations/{reservationId}

Change a reservation

Needs reservations:write. Send only what changes. Moving the time or growing the party re-checks the slot (this booking is not counted against itself) and the assigned tables. status follows the same lifecycle as the host stand: pending → confirmed / waitlist / cancelled / no_show, confirmed → seated / cancelled / no_show, seated → completed / cancelled. Refused in demo mode.

Request

PATCH https://your-site.example/api/index.php/v1/nextrestaurant/reservations/{reservationId}

Parameters

Name Type In Required Description
reservationId integer path Yes (min 1)
If-Match string header No The ETag from your last read. When the record has changed since, the change is refused with 412 PRECONDITION_FAILED instead of overwriting someone else's edit. Without it, the last write wins.
Idempotency-Key string header No Any unique string up to 255 characters, e.g. a UUID. Send the same key when retrying after a timeout: the first response is replayed (with Idempotent-Replayed: true) and nothing happens twice. Reusing a key for a different request is 422 IDEMPOTENCY_MISMATCH; while the first request is still running it is 409 IDEMPOTENCY_IN_PROGRESS. Keys are kept 24 hours, per API key. (max length 255)

Request body

Content type: application/json

Field Type Required Description
guest_name string No (min length 1)
guest_phone string|null No
guest_email string|null No (email)
party_size integer No (min 1, max 100)
reserved_at string No The venue's local time, Y-m-d H:i.
duration_minutes integer No (min 15, max 720)
special_requests string|null No
status string No One of pending, confirmed, seated, completed, no_show, cancelled, waitlist.
{
    "party_size": 6,
    "status": "confirmed"
}

Responses

200 — The changed reservation.

{
    "data": {
        "id": 1,
        "reservation_number": "RES-000109",
        "location_id": 1,
        "customer_id": 1,
        "area_id": 1,
        "table_ids": [
            1
        ],
        "guest_name": "string",
        "guest_phone": "string",
        "guest_email": "string",
        "party_size": 1,
        "reserved_at": "string",
        "reserved_at_local": "string",
        "duration_minutes": 1,
        "status": "pending",
        "deposit_amount": 1.5,
        "special_requests": "string",
        "source": "web",
        "created_at": "string",
        "updated_at": "string"
    }
}
Field Type Meaning
data.id integer (int64)
data.reservation_number string|null
data.location_id integer
data.customer_id integer|null
data.area_id integer|null
data.table_ids[] integer[]
data.guest_name string
data.guest_phone string|null
data.guest_email string|null
data.party_size integer
data.reserved_at string UTC.
data.reserved_at_local string|null The venue's wall clock — what the guest was told.
data.duration_minutes integer
data.status string One of pending, confirmed, seated, completed, no_show, cancelled, waitlist.
data.deposit_amount number
data.special_requests string|null
data.source string|null
data.created_at string|null
data.updated_at string|null

Errors

Status Code When
400 INVALID_JSON INVALID_JSON (the body is not a JSON object) or INVALID_IDEMPOTENCY_KEY.
401 INVALID_TOKEN The token is missing, wrong, or none has been generated.
403 INSUFFICIENT_SCOPE This API key does not have the permission this request needs.
403 MODULE_DISABLED This module is disabled.
403 API_DISABLED API is disabled
404 NOT_FOUND No such record.
409 SLOT_UNAVAILABLE SLOT_UNAVAILABLE (closed, fully booked, too soon — the title says which), TABLE_CONFLICT, ILLEGAL_TRANSITION (meta.allowed lists the statuses reachable from meta.from), or IDEMPOTENCY_IN_PROGRESS.
412 PRECONDITION_FAILED: the record changed since your If-Match. Read it again.
415 UNSUPPORTED_MEDIA_TYPE: send Content-Type: application/json.
422 VALIDATION_FAILED One error per invalid field, each with source.pointer.
429 RATE_LIMITED Too many requests. RATE_LIMITED with a Retry-After header: this key used its budget for the minute, or this address sent 20 bad tokens in 5 minutes. Nothing ran, so the request is safe to retry after the wait.

Examples

curl

curl -s -X PATCH "https://your-site.example/api/index.php/v1/nextrestaurant/reservations/1" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"party_size":6,"status":"confirmed"}'

PHP

<?php
$ch = curl_init('https://your-site.example/api/index.php/v1/nextrestaurant/reservations/1');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('API_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => '{"party_size":6,"status":"confirmed"}',
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

JavaScript

const API_TOKEN = process.env.API_TOKEN;

const response = await fetch("https://your-site.example/api/index.php/v1/nextrestaurant/reservations/1", {
  method: 'PATCH',
  headers: {
    "Authorization": `Bearer ${API_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "party_size": 6,
    "status": "confirmed"
  }),
});
const data = await response.json();

All Extensions