PATCH /v1/scheduling/booking/resource-bookings/:id
Change the dates of a customer’s resource booking: new check-in or check-out of a stay, or new date and time of a block.
PATCH
Change the dates of a resource booking
Moves a resource booking of the customer to new dates. Keebai checks the new dates with the same rules as a new booking, without counting the booking itself, and recomputes the price.
Block, or older resource appointment:
A body without any of these fields returns
Other
- Stay: send
check_in,check_outor both, and optionally the times. A newcheck_inalone keeps the number of nights; a newcheck_outalone keeps the check-in. - Block: send
date,start_timeor both. The duration stays the same. - Older resource appointment (
kind: "appointment"): senddateandstart_time. It moves through the appointment flow.
id. Send an Idempotency-Key so a retry does not book twice.
Endpoint
Required scope
scheduling:appointments:update
Path params
id: booking id, or the id of an older resource appointment.
Query params
customer_phone: required. The booking must belong to this phone; if it does not, the answer is404.
Headers
Authorization: Bearer kbai_pk_<token>. Required.Content-Type: application/json. Required.Idempotency-Key: optional, recommended. 1 to 128 letters, digits,-or_.
Body
At least one field. Stay:400. party_size, resource_id and any other field are rejected with 400.
Example request
curl
Response
200 OK
The booking with its new dates and price, shaped like an item of the search:400 Bad Request
The same date codes as creating a booking:STAY_INVALID_RANGE, STAY_MIN_NIGHTS, STAY_MAX_NIGHTS, STAY_CLOSED_DAY, STAY_OUTSIDE_WINDOW, STAY_TOO_SOON, STAY_TOO_FAR, BLOCK_SLOT_INVALID, RESOURCE_BOOKING_UNIT_MISMATCH. Also BAD_REQUEST when the body has no date or time.
404 Not Found
RESOURCE_BOOKING_NOT_FOUND: it does not exist, belongs to another company, or is not the customer’s.
409 Conflict
409 codes:
RESOURCE_BOOKING_LOCKED_BY_PAYMENT means the move would change the price of a booking that is awaiting its payment or already has a sale. A move that keeps the price is always allowed.
On RESOURCE_PROFESSIONAL_BUSY, don’t retry that block: check GET resources/availability again for that day and offer another time or day.
503 Service Unavailable
RESOURCE_LOCK_UNAVAILABLE with retryable: true: Keebai couldn’t lock the resource to write the change. The booking stays as it was. Retry after a short pause.
401 Unauthorized · 403 Forbidden
Same semantics as the rest of the public API.Authorizations
Body
application/json
Response
200
Change the dates of a resource booking