Skip to main content
DELETE
/
wp-json
/
latepoint-api
/
v1
/
bookings
/
{id}
Delete Booking
curl --request DELETE \
  --url https://your-site.com/wp-json/latepoint-api/v1/bookings/{id} \
  --header 'X-API-Key: <x-api-key>'
{
  "status": "error",
  "error": {
    "code": "booking_not_found",
    "message": "Booking with ID 123 was not found"
  }
}

Description

This endpoint allows you to permanently delete a booking from the system. This action is irreversible and should be used with caution.
Irreversible Action: Once deleted, the booking cannot be recovered. Consider using the cancelled status instead if you need to maintain a historical record.

Authentication

X-API-Key
string
required
Your LatePoint API Key with deletion permissions

Path Parameters

id
integer
required
Unique ID of the booking to delete

Query Parameters

force
boolean
default:"false"
Force deletion even if the booking is approved or completed

Response

Successful Response (200 OK)

status
string
Response status (“success”)
message
string
Deletion confirmation message
data
object
Basic confirmation of the deletion operation

Examples

Simple Deletion

curl -X DELETE "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/22" \
  -H "X-API-Key: lp_n1k6BVf3h7JRyjXkWMSoXi0BBZYRaOLL4QohDPQJ"

Forced Deletion

curl -X DELETE "http://latepoint-dev.local/wp-json/latepoint-api/v1/bookings/22?force=true" \
  -H "X-API-Key: lp_n1k6BVf3h7JRyjXkWMSoXi0BBZYRaOLL4QohDPQJ"

Example Response

Successful Deletion

{
  "success": true,
  "message": "Booking deleted successfully"
}

Error Codes

{
  "status": "error",
  "error": {
    "code": "booking_not_found",
    "message": "Booking with ID 123 was not found"
  }
}

Deletion Rules

States that Allow Direct Deletion

  • pending - Pending
  • cancelled - Cancelled

States that Require force=true

  • approved - Approved
  • completed - Completed
The current implementation checks for approved and completed statuses to require force deletion.

Important Notes

Deletion vs Cancellation: In most cases, it’s better to cancel a booking (change status to cancelled) than to delete it permanently.
Irrecoverable Data: Once deleted, all booking information is permanently lost. Make sure you have backups if necessary.
Simple Implementation: This endpoint provides basic deletion functionality. Advanced features like customer notifications and audit logging are not currently implemented.
I