Confirm a booking
POST /api/v1/bookings/{bookingId}/confirm
Confirms a hold. This is not a label change: between the hold and its confirmation someone may have taken the slot, so availability is checked again. The booking is excluded from its own check.
Creates no payment and does not touch the financial status: a confirmed booking can be UNPAID.
Authorization
| Role in the organization | This endpoint |
|---|---|
owner | Allowed |
admin | Allowed |
member | Allowed |
Request body
None.
Example
bash
curl -X POST -H "x-api-key: $VILLASLOT_API_KEY" \
"https://villaslot.app/api/v1/bookings/5b2c…/confirm"Response
200 OK— the booking,status: "CONFIRMED".
What it refuses
409 Conflict— the slot was taken in the meantime (OVERLAP), the hold expired (HOLD_EXPIRED) or its status changed under you (STATUS_CHANGED).detailsays which, and the three call for different next moves: a taken slot means pick another, an expired hold means the slot is free again.422 Unprocessable Entity— the booking is not a hold.401 Unauthorized— missing or invalid key, or a key whose bearer left the organization.404 Not Found— unknown id, or an id belonging to another organization. The two are deliberately indistinguishable.429 Too Many Requests— over 120 requests in a minute for this key.