API and AuthenticationClient API
List Bookings
Retrieve the authenticated customer's booking history
List Bookings
Returns a paginated list of bookings for the authenticated customer.
Endpoint
GET /bookingsAuthentication
Requires a valid JWT access token.
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 50 | Number of bookings to return (1 to 100) |
cursor | string | - | Booking ID to paginate from |
status | string | - | Filter by booking status |
upcoming | boolean | false | When true, only returns future bookings |
Status Values
| Status | Description |
|---|---|
pending | Booking has been submitted but not yet confirmed |
confirmed | Booking is confirmed |
cancelled | Booking was cancelled |
completed | Booking took place as scheduled |
no_show | Customer did not show up |
Example Request
curl -X GET "https://edge.tiquo.app/api/client/v1/bookings?upcoming=true&limit=10" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..."Response
{
"success": true,
"data": {
"bookings": [
{
"id": "booking_123",
"bookingNumber": "BK-001234",
"confirmationCode": "ABC123",
"status": "confirmed",
"date": 1706662800000,
"startTime": "14:30",
"endTime": "15:30",
"duration": 60,
"timezone": "America/New_York",
"attendeeCount": 2,
"serviceName": "Consultation",
"serviceId": "svc_123",
"sublocationId": "loc_456",
"createdAt": 1706576400000
}
],
"hasMore": false
}
}Booking Object
| Field | Type | Description |
|---|---|---|
id | string | Booking document ID |
bookingNumber | string | Human-readable booking number (e.g. BK-001234) |
confirmationCode | string | Confirmation code for the booking |
status | string | Booking status (see values above) |
date | integer | Unix timestamp in milliseconds for the booking date |
startTime | string | Start time in HH:mm format |
endTime | string or null | End time in HH:mm format |
duration | integer or null | Duration in minutes |
timezone | string | Timezone of the booking (e.g. America/New_York) |
attendeeCount | integer | Number of attendees |
serviceName | string or null | Name of the booked service |
serviceId | string or null | ID of the booked service |
sublocationId | string or null | ID of the sublocation |
createdAt | integer | Unix timestamp in milliseconds when the booking was created |
Pagination
When hasMore is true, pass the last booking's id as the cursor parameter to get the next page.
Errors
| Status | Description |
|---|---|
401 | Invalid or expired access token |
500 | Internal server error |
Code Examples
JavaScript
async function getBookings(accessToken, options = {}) {
const params = new URLSearchParams();
if (options.limit) params.set('limit', options.limit);
if (options.cursor) params.set('cursor', options.cursor);
if (options.status) params.set('status', options.status);
if (options.upcoming) params.set('upcoming', 'true');
const response = await fetch(
`https://edge.tiquo.app/api/client/v1/bookings?${params}`,
{
headers: { 'Authorization': `Bearer ${accessToken}` },
}
);
return response.json();
}
// Fetch upcoming bookings
const result = await getBookings(token, { upcoming: true, limit: 10 });
console.log(`You have ${result.data.bookings.length} upcoming bookings`);