GET
/
wp-json
/
latepoint-api
/
v1
/
bookings
{
  "status": "error",
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API Key"
  }
}

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

X-API-Key
string
required
Your LatePoint API key. You can get it from the admin panel.

Query Parameters

Pagination

page
integer
default:"1"
Page number for pagination
per_page
integer
default:"20"
Number of bookings per page (max 100)

Basic Filters

status
string
Filter by booking status (pending, confirmed, cancelled, completed)
customer_id
integer
Filter by customer ID
agent_id
integer
Filter by agent ID
service_id
integer
Filter by service ID
location_id
integer
Filter by location ID

Date Filters

date_from
string
Filter bookings from this date (YYYY-MM-DD format)
date_to
string
Filter bookings until this date (YYYY-MM-DD format)
created_date_from
string
Filter by creation date from (YYYY-MM-DD format)
created_date_to
string
Filter by creation date until (YYYY-MM-DD format)

Dynamic Filters

booking_code
string
Filter by booking code (partial match supported)
payment_status
string
Filter by payment status
duration_min
integer
Filter bookings with minimum duration (in minutes)
duration_max
integer
Filter bookings with maximum duration (in minutes)
price_min
number
Filter bookings with minimum price
price_max
number
Filter bookings with maximum price
customer_email
string
Filter by customer email (partial match supported)
customer_phone
string
Filter by customer phone (partial match supported)

Metadata Filters

include_meta
boolean
default:"false"
Include booking metadata in response
meta_key
string
Filter by specific metadata key (requires meta_value)
meta_value
string
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)
order
string
default:"desc"
Sort order (asc, desc)

Response

status
string
Response status (“success”)
data
array
Array of booking objects
meta
object
Pagination information

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"
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

{
  "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`);