EDistribution API

Cancel a booking#

POST/v1/bookings/{bookingId}/cancel

Cancels 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
curl -X POST 'https://partner-api.elivaas.com/v1/bookings/{bookingId}/cancel' \
  -u "$ELIVAAS_API_KEY:" \
  -H 'Content-Type: application/json'
Response 200
{
  "bookingId": "string",
  "bookingStatus": "string",
  "refundPercentage": 0,
  "refundedAmount": 0,
  "currency": "INR",
  "refundIds": [
    "string"
  ],
  "alreadyCancelled": true
}

Path parameters#

bookingIdstringrequired

No description in the spec.

Query parameters#

reasonstring

Optional free-text reason, kept for the audit log.

Responses#

StatusMeaning
200The cancellation outcome.
400Validation 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.
401Missing, 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.
429Rate 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.