Cancel a booking#
/v1/bookings/{bookingId}/cancelCancels the booking through the same durable machinery every other cancellation path in this system uses — the booking's status is flipped and its channel inventory released. This call never posts a ledger credit itself. The credit for the non-retained portion is posted asynchronously, once, when the resulting booking.cancelled lifecycle event is processed — polling GET .../cancellation-quote before and after cancelling will not show it land instantly. Cancelling an already-cancelled booking is a quiet no-op (alreadyCancelled: true on the response) — never a second cancellation, never a second credit. A booking belonging to another agent group is 404, identically to one that doesn't exist.
Request
curl -X POST 'https://partner-api.elivaas.com/v1/bookings/{bookingId}/cancel' \
-u "$ELIVAAS_API_KEY:" \
-H 'Content-Type: application/json'const res = await fetch('https://partner-api.elivaas.com/v1/bookings/{bookingId}/cancel', {
method: 'POST',
headers: {
Authorization: 'Basic ' + Buffer.from(process.env.ELIVAAS_API_KEY + ':').toString('base64'),
'Content-Type': 'application/json',
},
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();import os, requests
res = requests.post(
"https://partner-api.elivaas.com/v1/bookings/{bookingId}/cancel",
auth=(os.environ["ELIVAAS_API_KEY"], ""),
timeout=30,
)
res.raise_for_status()
data = res.json(){
"bookingId": "string",
"bookingStatus": "string",
"refundPercentage": 0,
"refundedAmount": 0,
"currency": "INR",
"refundIds": [
"string"
],
"alreadyCancelled": true
}Path parameters#
bookingIdstringrequiredNo description in the spec.
Query parameters#
reasonstringOptional free-text reason, kept for the audit log.
Responses#
| Status | Meaning |
|---|---|
200 | The cancellation outcome. |
400 | Validation failure. The message names the offending parameter. Limits are rejected, never silently clamped: an over-length id list, a page size above 100 or a date window longer than 365 days all land here rather than coming back quietly truncated. |
401 | Missing, malformed, revoked or unknown API key, or an agent group whose distribution access is disabled. Pass the key as the HTTP Basic username with an empty password. |
429 | Rate limit exhausted for this credential. Wait Retry-After seconds before retrying; the budget is per credential, not per IP. |
See Errors for the error body shape and which statuses are worth retrying.