Patrons
Query and filter patrons
Filter patrons by search text, tags, behaviours, booking date range, origin, and channel. Returns paginated results.
Defaults & ordering
- All filters are optional — an empty request body (or no
filters) returns all patrons for the restaurant. - Walkins are excluded from results.
- Results are ordered by patron
name. - Default
per_pageis50; maximum is200.
Pagination
Page-based, offset-style — NOT cursor-based. Use page (1-based) and
per_page. The response meta contains current_page, per_page,
total, and last_page.
Filter composition
- Top-level filters are AND-combined.
qsearches name OR email (LIKE match on either field).channelis OR within the list — a patron matches if any of their bookings used one of the listed channel IDs.- Multiple
tagsare AND-combined — all listed tag booleans must be true. - Multiple
behaviourvalues are AND-combined. booking_date_from/booking_date_toform an AND-bounded range on booking dates.
Authorization
bearerAuth AuthorizationBearer <token>
Supports two token types:
- Restaurant tokens — API tokens with
restaurant-apiability, issued per restaurant. - User tokens — Personal access tokens with
mobile-accessability (e.g. for the mobile app). When managing multiple restaurants, includeX-Restaurant-Id: <id>header.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://devrms.tabdevx.com/api/restaurant/patrons/query" \ -H "Content-Type: application/json" \ -d '{ "filters": { "q": "gmail", "tags": [ "vip" ], "behaviour": [ "visited_5_plus" ], "booking_date_from": "2025-01-01", "booking_date_to": "2025-12-31" }, "page": 1, "per_page": 50 }'{
"data": [
{
"id": 123,
"name": "John Smith",
"email": "john@example.com",
"mobile_number": "+34600000000",
"mobile_prefix": "+34",
"is_vip": true,
"is_vegan": false,
"is_vegetarian": false,
"is_wine_lover": true,
"is_always_late": false,
"is_low_spender": false,
"is_high_spender": true,
"is_with_pet": false,
"is_gluten_intolerant": false,
"is_lactose_intolerant": false,
"is_allergic_to_nuts": false,
"is_allergic_to_shellfish": false,
"is_local": true,
"channel_id": 1,
"created_at": "2025-01-15T10:00:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 50,
"total": 234,
"last_page": 5
}
}{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"timestamp": "2019-08-24T14:15:22Z"
}
}{
"message": "The given data was invalid.",
"errors": {
"date": [
"The date field is required."
],
"adults": [
"The adults must be at least 1."
]
}
}