Description
This endpoint allows you to retrieve a list of all bookings in your LatePoint system. It includes advanced filtering, search, and pagination options to efficiently handle large volumes of data.
Authentication
Your LatePoint API key. You can get it from the admin panel.
Query Parameters
Page number for pagination
Number of bookings per page (max 100)
Basic Filters
Filter by booking status (pending, confirmed, cancelled, completed)
Date Filters
Filter bookings from this date (YYYY-MM-DD format)
Filter bookings until this date (YYYY-MM-DD format)
Filter by creation date from (YYYY-MM-DD format)
Filter by creation date until (YYYY-MM-DD format)
Dynamic Filters
Filter by booking code (partial match supported)
Filter bookings with minimum duration (in minutes)
Filter bookings with maximum duration (in minutes)
Filter bookings with minimum price
Filter bookings with maximum price
Filter by customer email (partial match supported)
Filter by customer phone (partial match supported)
Include booking metadata in response
Filter by specific metadata key (requires meta_value)
Filter by metadata value (requires meta_key, partial match supported)
Search and Sorting
Search in customer name, email, or booking code
sort
string
default: "start_date"
Sort field (start_date, created_at, customer_name, status, id)
Response
Response status (“success”)
Array of booking objects Creation date and time (ISO 8601)
Last update date and time (ISO 8601)
Pagination information Whether previous page exists
Examples
Basic Request
curl -X GET "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings" \
-H "X-API-Key: lp_n1k6BVf3h7JRyjXkWMSoXi0BBZYRaOLL4QohDPQJ" \
-H "Content-Type: application/json"
Filter by Status and Date
curl -X GET "https://your-site.com/wp-json/latepoint-api/v1/bookings?status=approved&date_from=2024-01-01&date_to=2024-01-31" \
-H "X-API-Key: lp_live_1234567890abcdef" \
-H "Content-Type: application/json"
Customer Search
curl -X GET "https://your-site.com/wp-json/latepoint-api/v1/bookings?search=john+doe&sort=start_date&order=asc" \
-H "X-API-Key: lp_live_1234567890abcdef" \
-H "Content-Type: application/json"
Example Response
{
"status" : "success" ,
"data" : [
{
"id" : "16" ,
"booking_code" : "LP-16" ,
"status" : "approved" ,
"start_date" : "2025-08-31" ,
"start_time" : "10:00" ,
"end_time" : "11:00" ,
"duration" : 60 ,
"price" : "100.00" ,
"customer" : {
"id" : "2" ,
"first_name" : "John" ,
"last_name" : "Doe" ,
"email" : "john@example.com" ,
"phone" : "+1234567890"
},
"agent" : {
"id" : "1" ,
"display_name" : "Dr. Smith" ,
"email" : "dr.smith@clinic.com"
},
"service" : {
"id" : "2" ,
"name" : "Consultation" ,
"duration" : 60 ,
"price" : "100.00"
},
"location" : {
"id" : "1" ,
"name" : "Main Location" ,
"address" : "123 Main St"
},
"notes" : null ,
"created_at" : "2025-08-21 10:45:23" ,
"updated_at" : "2025-08-21 10:45:23"
}
],
"meta" : {
"total" : 24 ,
"page" : 1 ,
"per_page" : 5 ,
"total_pages" : 5 ,
"has_next_page" : true ,
"has_prev_page" : false
}
}
Error Codes
Error 401 - Invalid API Key
Error 403 - Insufficient Permissions
Error 400 - Invalid Parameters
{
"status" : "error" ,
"error" : {
"code" : "unauthorized" ,
"message" : "Invalid or missing API Key"
}
}
Important Notes
Performance : For better performance, use specific filters instead of fetching all bookings and filtering on the client side.
Rate Limiting : This endpoint is subject to rate limiting. Check response headers to monitor your usage.
Pagination : To get all bookings, use the has_next_page
field in the response to determine if more pages are available.
Common Use Cases
1. Today’s Bookings Dashboard
// Get today's bookings
const today = new Date (). toISOString (). split ( 'T' )[ 0 ];
const response = await fetch ( `/wp-json/latepoint-api/v1/bookings?date_from= ${ today } &date_to= ${ today } &sort=start_time&order=asc` );
2. Customer History
// Get all bookings for a specific customer
const response = await fetch ( `/wp-json/latepoint-api/v1/bookings?customer_id=45&sort=start_date&order=desc` );
3. Monthly Report
// Get current month's bookings
const firstDay = new Date ( new Date (). getFullYear (), new Date (). getMonth (), 1 ). toISOString (). split ( 'T' )[ 0 ];
const lastDay = new Date ( new Date (). getFullYear (), new Date (). getMonth () + 1 , 0 ). toISOString (). split ( 'T' )[ 0 ];
const response = await fetch ( `/wp-json/latepoint-api/v1/bookings?date_from= ${ firstDay } &date_to= ${ lastDay } &status=completed` );