Skip to main content

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

FieldRequiredTypeDescription
idYesstringResource identifier used by TheBooking.
serviceIdNostringTheBooking service identifier.
customerIdNostringTheBooking customer identifier.
providerIdNointeger or stringTheBooking provider identifier.
startNointeger (int64)Unix timestamp for the slot start.
endNointeger (int64)Unix timestamp for the slot end.
statusNoenum(pending, confirmed, cancelled)Current reservation status.
dataNoobjectAdditional structured data accepted by the route.

Responses

StatusMeaningDescriptionBody
200SuccessOperation completedOkEnvelope
400Invalid requestInvalid request or application rule failureErrorEnvelope
401Authentication requiredMissing or invalid API tokenWpRestError
403ForbiddenToken lacks write scope or the operation is forbiddenWpRestError or ErrorEnvelope
404Not foundResource not foundErrorEnvelope

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