Conventions & errors
Conventions
Base URL.
REST https://your-site.example/api/index.php/v1/nextrestaurant
Query-string https://your-site.example/index.php?option=com_nextrestaurant&format=json&task=publicApi.<endpoint>
Response envelope. The two lanes wrap their payloads differently.
// REST — one record
{ "data": { } }
// REST — a list, with paging
{ "data": [ ], "meta": { "limit": 25, "next_cursor": "WyIyMDI2LTEx..." } }
// Query-string — Joomla's envelope, with `success` repeated inside
{ "success": true, "message": null, "messages": null, "data": { } }
Either way the payload you want is in data. Read data, not the outer object.
Times are Y-m-d H:i:s in UTC with no zone suffix, for example 2026-12-24 18:30:00.
Convert them with the location's timezone for display. The exceptions say so in their name:
reserved_at_local on a reservation is the venue's wall clock, and the reservation endpoints take
the venue's local time as input, because that is what a guest is told. Report and timesheet ranges
are venue calendar days (Y-m-d). See Timezones & venue time.
Money and numbers. On REST everything numeric is a JSON number, in the location's currency.
On the query-string lane some fields inside data.order are strings with two decimals ("31.50")
— parse defensively there.
Ignore fields you do not recognise. New fields are added over time; a consumer that rejects unknown keys will break on an upgrade it did not need to care about.
Lists and syncing
Every list endpoint (/orders, /reservations, /customers, /payments, /refunds) returns
records oldest change first, a page at a time:
| Parameter | Meaning |
|---|---|
limit |
Page size, 1–100, default 25. A larger value is clamped to 100; meta.limit tells you what was used |
cursor |
meta.next_cursor from the previous page. Opaque: pass it back exactly, never build one |
updated_since |
Only records changed at or after this UTC date-time (ISO 8601 or Y-m-d H:i:s) |
meta.next_cursor is null on the last page. A cursor marks a position, not a page number, so
records changing while you page do not make you skip or repeat any. A malformed cursor is
400 INVALID_CURSOR.
To keep another system in sync:
- The first time, fetch everything: follow
next_cursoruntil it isnull. - Remember the largest
updated_atyou received. - Next time, pass that value as
updated_sinceand follow the cursor again.
You will see the last record of the previous run again (the filter is "at or after"); dedupe on
id. Use webhooks to learn that something changed, and the list to catch
up after downtime.
Stock levels page by stock item instead (/locations/{id}/stock-levels has no updated_since).
Errors
Errors carry a real HTTP status on both lanes. Do not parse the message to detect failure:
check the status, then read the code.
On REST, every failure has the same shape:
{
"errors": [
{
"title": "This API key does not have the permission this request needs.",
"code": "INSUFFICIENT_SCOPE",
"meta": { "required_scopes": ["orders:read"] }
}
],
"meta": { "request_id": "req_3f9c2a71b0d84e6f5a1c2b3d" }
}
titleis for people. Do not match on it; it can change.codeis stable. Match on it.metaon an error adds detail where there is some (which scope, which app, which verbs).source.pointeron a validation error names the field, as a JSON Pointer into your body.meta.request_ididentifies the request. Every response, success or not, also carries it as anX-Request-Idheader. Send your ownX-Request-Idand it is echoed back. Quote it when you ask for support.
A validation failure lists every bad field at once:
{
"errors": [
{ "title": "Required.", "code": "VALIDATION_FAILED", "source": { "pointer": "/guest_name" } },
{ "title": "A whole number from 1 to 100.", "code": "VALIDATION_FAILED", "source": { "pointer": "/party_size" } }
],
"meta": { "request_id": "req_bcae61c3ca148421d5a11559" }
}
Error codes
| Status | code |
When |
|---|---|---|
400 |
INVALID_ORDER |
POST /orders: missing input, or an item is unpublished, 86'd or unavailable there |
400 |
INVALID_JSON |
The body is not a JSON object |
400 |
INVALID_CURSOR |
A cursor that is not a next_cursor you were given |
400 |
INVALID_IDEMPOTENCY_KEY |
An Idempotency-Key longer than 255 characters |
401 |
INVALID_TOKEN |
Key missing, wrong or revoked |
403 |
INSUFFICIENT_SCOPE |
The key lacks a permission; meta.required_scopes lists it |
403 |
INSUFFICIENT_PERMISSION |
The key holds the permission but its owner's role no longer does; meta.scopes lists it |
403 |
ACCOUNT_UNUSABLE |
The account the key belongs to is blocked, not activated, must reset its password, or was deleted |
403 |
MODULE_DISABLED |
The API app, or the app the endpoint belongs to, is off under Apps; meta.module names it |
403 |
API_DISABLED |
Enable public API is off under Configuration → REST API |
403 |
DEMO_READONLY |
The site is a read-only demo; see Troubleshooting |
404 |
NOT_FOUND |
No record with that id |
404 |
UNKNOWN_LOCATION |
The location does not exist or is not published |
404 |
404 |
No such path — this one comes from Joomla's router, so code is a number |
405 |
METHOD_NOT_ALLOWED |
The path exists but not with that verb; the Allow header lists the ones it takes |
409 |
SLOT_UNAVAILABLE |
The booking time is closed, fully booked or too soon; the title says which |
409 |
TABLE_CONFLICT |
Moving a booking would double-book one of its tables |
409 |
ILLEGAL_TRANSITION |
That status change is not allowed; meta.allowed lists the ones that are |
409 |
IDEMPOTENCY_IN_PROGRESS |
A request with the same Idempotency-Key is still running |
412 |
PRECONDITION_FAILED |
The record changed since the ETag you sent in If-Match |
413 |
PAYLOAD_TOO_LARGE |
The body is larger than 64 KB |
415 |
UNSUPPORTED_MEDIA_TYPE |
A write without Content-Type: application/json |
422 |
VALIDATION_FAILED |
One error per invalid field, with source.pointer |
422 |
IDEMPOTENCY_MISMATCH |
The Idempotency-Key was already used for a different request |
429 |
RATE_LIMITED |
Too many requests; wait for Retry-After seconds. Nothing ran |
500 |
ORDER_FAILED / RESERVATION_FAILED |
Something failed server-side |
A 500 is deliberately vague to the caller; the detail is written to the Joomla log
(administrator/logs/).
POST /orders keeps the codes it has had since 6.0 (400 INVALID_ORDER rather than 415 or
422), so integrations built on it are not affected.
On the query-string lane
The same conditions produce Joomla's envelope instead:
| Status | Body |
|---|---|
400 |
{"success": false, "message": "location_id is required"} |
401 |
{"success": false, "message": "Invalid API token"} |
403 |
{"success": false, "message": "API is disabled"} |
403 |
{"success": false, "message": "This module is disabled.", "data": {"code": "MODULE_DISABLED"}} |
403 |
{"success": false, "message": "This API key does not have the permission…", "data": {"code": "INSUFFICIENT_SCOPE"}} |
404 |
{"success": false, "message": "Unknown location"} |
404 |
{"success": false, "message": "Unknown task.", "data": {"code": "UNKNOWN_TASK"}} |
429 |
{"success": false, "message": "Too many …", "data": {"code": "RATE_LIMITED"}} |
500 |
{"success": false, "message": "The order could not be created."} |
CORS
Both lanes emit CORS headers so a browser-based front end on another origin can call them, and
both answer a preflight OPTIONS with 204:
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Authorization, X-Api-Token, Content-Type, X-CSRF-Token, Idempotency-Key, If-Match, X-Request-Id
Access-Control-Allow-Methods: GET, POST, PATCH, OPTIONS
Access-Control-Expose-Headers: RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, Retry-After, ETag, X-Request-Id, Idempotent-Replayed, Allow
The allowed origin defaults to *. Set CORS origins on the REST API screen to a
comma-separated list to narrow it. The same setting governs both lanes.
Error responses carry the headers too. Without that, a browser hands your JavaScript an opaque network failure with no status to read, and a wrong key looks exactly like the server being down.
Calling the API from browser JavaScript puts your key in the page, where any visitor can read it and use it. Restricting the origin does not prevent that — CORS is enforced by browsers, not by your server, and a key lifted from a page can be replayed with
curl. Call the API from your own backend and let your front end talk to that.
OpenAPI
The REST lane ships a machine-readable description in OpenAPI 3.1, and your own site serves it:
https://your-site.example/media/com_nextrestaurant/openapi.yaml
That is the copy installed with your version of the extension, so it describes the API that site
actually exposes. It covers every endpoint, every error response and, in its webhooks section,
every event Next Restaurant sends. Load it into Swagger UI, Redoc, Postman or Insomnia, or generate
a typed client:
# Interactive docs, no install
npx @redocly/cli preview-docs https://your-site.example/media/com_nextrestaurant/openapi.yaml
# A TypeScript client
npx openapi-typescript https://your-site.example/media/com_nextrestaurant/openapi.yaml -o api.d.ts
Point the host server variable at your site. Both authentication schemes are declared, so a
Swagger UI "Authorize" box accepts your key and the built-in Try it calls work against a live
site.
The document is verified against a running site on every test run — each documented response is validated against its schema — so it describes what the API returns rather than what it was intended to return.