Get Booking
curl --request GET \
--url http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id} \
--header 'X-API-Key: <x-api-key>'import requests
url = "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"status": "error",
"error": {
"code": "booking_not_found",
"message": "Booking with ID 123 was not found"
}
}
{
"status": "error",
"error": {
"code": "unauthorized",
"message": "Invalid or missing API Key"
}
}
{
"status": "error",
"error": {
"code": "forbidden",
"message": "You don't have permission to access this booking"
}
}
{
"status": "error",
"error": {
"code": "invalid_request",
"message": "Invalid booking ID",
"details": {
"id": "Must be a positive integer"
}
}
}
Bookings
Get Booking
Retrieves detailed information for a specific booking
GET
/
wp-json
/
latepoint-api
/
v1
/
bookings
/
{id}
Get Booking
curl --request GET \
--url http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id} \
--header 'X-API-Key: <x-api-key>'import requests
url = "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"status": "error",
"error": {
"code": "booking_not_found",
"message": "Booking with ID 123 was not found"
}
}
{
"status": "error",
"error": {
"code": "unauthorized",
"message": "Invalid or missing API Key"
}
}
{
"status": "error",
"error": {
"code": "forbidden",
"message": "You don't have permission to access this booking"
}
}
{
"status": "error",
"error": {
"code": "invalid_request",
"message": "Invalid booking ID",
"details": {
"id": "Must be a positive integer"
}
}
}
Description
This endpoint returns all available information for a specific booking, including customer details, agent, service, location, and payment status.Authentication
string
required
Your LatePoint API Key with read permissions
Path Parameters
integer
required
Unique ID of the booking to retrieve
Response
Successful Response (200 OK)
string
Response status (“success”)
object
Complete booking object
Show Complete Booking Structure
Show Complete Booking Structure
integer
Unique booking ID
string
Unique booking code
string
Current booking statusPossible values:
pending- Pendingapproved- Approvedcancelled- Cancelledcompleted- Completedno_show- No show
string
Start date (YYYY-MM-DD)
string
Start time (HH:MM)
string
End time (HH:MM)
integer
Duration in minutes
string
Total booking price
object
object
object
object
string
Additional booking notes
string
Payment statusPossible values:
not_paid- Not paidpartially_paid- Partially paidpaid- Paidrefunded- Refunded
string
Creation date and time (ISO 8601)
string
Last update date and time (ISO 8601)
Examples
Basic Request
curl -X GET "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/16" \
-H "X-API-Key: lp_n1k6BVf3h7JRyjXkWMSoXi0BBZYRaOLL4QohDPQJ" \
-H "Content-Type: application/json"
const bookingId = 123;
```javascript JavaScript
const response = await fetch('http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/16', {
headers: {
'X-API-Key': 'lp_n1k6BVf3h7JRyjXkWMSoXi0BBZYRaOLL4QohDPQJ',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/16',
headers={
'X-API-Key': 'lp_n1k6BVf3h7JRyjXkWMSoXi0BBZYRaOLL4QohDPQJ',
'Content-Type': 'application/json'
}
)
data = response.json()
print(data)
<?php
$booking_id = 123;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/{$booking_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: lp_n1k6BVf3h7JRyjXkWMSoXi0BBZYRaOLL4QohDPQJ',
'Content-Type: application/json'
]
]);
$response = curl_exec($curl);
$data = json_decode($response, true);
curl_close($curl);
print_r($data);
?>
Example Response
{
"success": true,
"data": {
"id": "18",
"booking_code": "EUHJVNH",
"start_datetime": "2025-11-17T16:00:00-03:00",
"end_datetime": "2025-11-17T17:00:00-03:00",
"service_name": "test 1",
"duration": "60",
"customer_comment": null,
"status": "pending",
"start_date": "11/17/2025",
"start_time": "16:00",
"timezone": "America/Montevideo",
"agent": {
"id": "1",
"full_name": "Pao Campo",
"email": "pao@pao.com",
"phone": ""
},
"created_datetime": "2025-08-21T07:41:32+00:00",
"manage_booking_for_agent": "http://latepoint-dev.local/wp-admin/admin-post.php?action=latepoint_route_call&route_name=manage_booking_by_key__show&key=3d09aa7219f4c883f6a3f78e7662c977a5dd",
"manage_booking_for_customer": "http://latepoint-dev.local/wp-admin/admin-post.php?action=latepoint_route_call&route_name=manage_booking_by_key__show&key=2009d8e53283cca27ccf1345b53ffa38d881",
"customer": {
"id": "7",
"first_name": "Ana",
"last_name": "Lopez",
"full_name": "Ana Lopez",
"email": "ana.lopez@email.com",
"phone": "+525559876543"
},
"transactions": [],
"order": {
"id": "34",
"confirmation_code": "SCLRA23J",
"customer_comment": null,
"status": "open",
"fulfillment_status": "not_fulfilled",
"payment_status": "not_paid",
"source_id": null,
"source_url": "",
"total": "$0",
"subtotal": "$0",
"created_datetime": "2025-08-21T07:41:32+00:00"
},
"location": {
"id": "1",
"name": "Main Location",
"full_address": "",
"category": []
},
"service_extras": []
}
}
Error Codes
{
"status": "error",
"error": {
"code": "booking_not_found",
"message": "Booking with ID 123 was not found"
}
}
{
"status": "error",
"error": {
"code": "unauthorized",
"message": "Invalid or missing API Key"
}
}
{
"status": "error",
"error": {
"code": "forbidden",
"message": "You don't have permission to access this booking"
}
}
{
"status": "error",
"error": {
"code": "invalid_request",
"message": "Invalid booking ID",
"details": {
"id": "Must be a positive integer"
}
}
}
Common Use Cases
1. Display Booking Details
// To display complete details on a booking page
async function showBookingDetails(bookingId) {
try {
const response = await fetch(`/wp-json/latepoint-api/v1/bookings/${bookingId}`, {
headers: {
'X-API-Key': 'your_api_key',
'Content-Type': 'application/json'
}
});
if (response.ok) {
const result = await response.json();
const booking = result.data;
// Display information in the UI
document.getElementById('booking-code').textContent = booking.booking_code;
document.getElementById('customer-name').textContent = booking.customer.full_name;
document.getElementById('service-name').textContent = booking.service.name;
document.getElementById('appointment-date').textContent =
`${booking.start_date} ${booking.start_time}`;
}
} catch (error) {
console.error('Error fetching booking:', error);
}
}
2. Check Booking Status
// To verify the current status of a booking
async function checkBookingStatus(bookingId) {
const response = await fetch(`/wp-json/latepoint-api/v1/bookings/${bookingId}`);
const result = await response.json();
if (result.status === 'success') {
const status = result.data.status;
const paymentStatus = result.data.payment_status;
return {
booking_status: status,
payment_status: paymentStatus,
is_approved: status === 'approved',
is_paid: paymentStatus === 'paid'
};
}
return null;
}
3. Get Information for Confirmation Email
// To generate personalized confirmation emails
async function getBookingForEmail(bookingId) {
const response = await fetch(`/wp-json/latepoint-api/v1/bookings/${bookingId}`);
const result = await response.json();
if (result.status === 'success') {
const booking = result.data;
return {
customer_name: booking.customer.full_name,
customer_email: booking.customer.email,
service_name: booking.service.name,
agent_name: booking.agent.display_name,
appointment_datetime: `${booking.start_date} ${booking.start_time}`,
location_name: booking.location.name,
location_address: booking.location.full_address,
booking_code: booking.booking_code
};
}
return null;
}```
## Important Notes
<Note>
**Complete Information**: This endpoint returns all available booking information, including related customer, agent, service, and location data.
</Note>
<Warning>
**Permissions**: Make sure your API Key has permissions to access bookings. Some configurations may restrict access to specific bookings.
</Warning>
<Tip>
**Caching**: Consider implementing client-side caching for bookings that don't change frequently, especially for displaying details in user interfaces.
</Tip>
## Additional Information
The booking response includes all essential information needed for managing appointments, including customer details, agent information, service details, and location data.
## Integration with Other Endpoints
This endpoint complements perfectly with other API endpoints:
- **Update booking**: Use `PUT /bookings/{id}` after getting current data
- **Check availability**: Use `GET /availability` for schedule changes
- **Get customer**: Use `GET /customers/{id}` for additional customer information
- **List bookings**: Use `GET /bookings` for context of other customer bookings
⌘I
