Complete a booking
POST /api/v1/bookings/{bookingId}/complete
Marks a confirmed booking as completed. Manual and nothing else: no schedule marks a booking
completed on its own, and a past booking left CONFIRMED is not flagged.
Touches neither the price, nor the payments, nor the financial status.
Authorization
| Role in the organization | This endpoint |
|---|---|
owner | Allowed |
admin | Allowed |
member | Allowed |
Example
bash
curl -X POST -H "x-api-key: $VILLASLOT_API_KEY" \
"https://villaslot.app/api/v1/bookings/5b2c…/complete"Response
200 OK— the booking,status: "COMPLETED".
What it refuses
409 Conflict— the status changed under you.422 Unprocessable Entity— the booking was notCONFIRMED: a hold, a cancelled or an expired booking cannot be completed.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.