Update or reschedule a reservation
POST /reservations/edit/
What It Does
Update reservation fields or reschedule a reservation through the public API.
Authentication
Requires an API token with the write scope. Send it as a bearer token or with the configured API key header.
Parameters
This endpoint does not define query or path parameters.
Request Body
Content type: application/json
Required: Yes
Schema: ReservationEdit
| Field | Required | Type | Description |
|---|---|---|---|
id | Yes | string | Resource identifier used by TheBooking. |
serviceId | No | string | TheBooking service identifier. |
customerId | No | string | TheBooking customer identifier. |
providerId | No | integer or string | TheBooking provider identifier. |
start | No | integer (int64) | Unix timestamp for the slot start. |
end | No | integer (int64) | Unix timestamp for the slot end. |
status | No | enum(pending, confirmed, cancelled) | Current reservation status. |
data | No | object | Additional structured data accepted by the route. |
Responses
| Status | Meaning | Description | Body |
|---|---|---|---|
200 | Success | Operation completed | OkEnvelope |
400 | Invalid request | Invalid request or application rule failure | ErrorEnvelope |
401 | Authentication required | Missing or invalid API token | WpRestError |
403 | Forbidden | Token lacks write scope or the operation is forbidden | WpRestError or ErrorEnvelope |
404 | Not found | Resource not found | ErrorEnvelope |
Booking Rules
- When rescheduling, send the new canonical slot fields together with the reservation
id. - The same availability validation used for new reservations is applied during rescheduling.
Request Example
curl -X POST "https://example.com/wp-json/thebooking/v1/API/reservations/edit/" \
-H "Authorization: Bearer $TBK_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "resource_123",
"serviceId": "service_123",
"customerId": "customer_123",
"providerId": 123,
"start": 1779148800,
"end": 1779152400,
"status": "pending",
"data": {}
}'
JSON Body
{
"id": "resource_123",
"serviceId": "service_123",
"customerId": "customer_123",
"providerId": 123,
"start": 1779148800,
"end": 1779152400,
"status": "pending",
"data": {}
}
Success Response Example
{
"status": "OK"
}