Booking Flow
Cancel
Preview what cancelling would cost, then cancel for real — two uses of the same endpoint, told apart by one required flag.
/api/v1/bookings/{bookingId}/cancel x-api-keyRequest Body
simulationboolean requiredtruepreviews the fee and changes nothing.falsecancels at the supplier.reasonstring (≤500) optional- Why the booking is being cancelled. Recorded against the booking.
Simulating First
A simulation returns the booking's current status, unchanged, with simulation: true and the fee and refund that cancelling at this moment would mean. Nothing
is cancelled and, for most distributors, nothing is even sent to the supplier.
Where the figure comes from depends on whether the booking's source can price a cancellation without carrying it out:
- It can: the source is asked, and the figure is its own quote.
- It cannot — some sources have no preview at all, because asking what a
cancellation would cost is the same as doing it, and some record their policy as free text
rather than a quotable figure. Nothing is sent to them. The fee is computed here from the
cancellation ladder stored with the booking, and a
noteon the response says so.
In the second case the rung in force is the last deadline already passed; nothing passed, or nothing recorded, reads as free.
Cancelling for Real
With simulation: false the cancel is carried out: the rooms are released, or the cancellation
is passed to the hotel's own reservation system, whichever the booking needs.
Reading the Answer
Only a definite cancellation moves a booking to CANCELLED. The API never claims an
outcome the supplier did not give, which means a 200 is not on its own proof that
anything was cancelled — read the status.
200 · status CANCELLED
Cancelled. cancellationFee is what the supplier charges, refundAmount is the supplier’s gross minus that fee.
Booking is now: CANCELLED
200 · status unchanged
The supplier answered, but the reservation is still live — the cancel did not take. Nothing changed.
Booking is now: as it was
502 · cancel_outcome_unknown
No definite outcome. The response says no more than that — quote its requestId. Confirm with Gateway Stream rather than resending.
Booking is now: CANCEL_REQUESTED
502 · supplier_error
The supplier rejected the call outright — already cancelled on their side, unknown reference, and so on.
Booking is now: put back to what it was
Status Codes
- 200
- The request was processed. Read
statusandsimulationto know what actually happened. - 400
validation_error simulationmissing, or an id in the path that is not a valid uuid.- 401
unauthorized - Missing or invalid
x-api-key. - 404
not_found - No such booking for this key.
- 409
conflict - The booking is already cancelled. A second real cancel is a conflict, not a no-op.
- 502
cancel_outcome_unknown - The supplier gave no definite answer. The booking is left in
CANCEL_REQUESTED. - 502
supplier_error - The supplier rejected the cancel. The booking is put back to what it was.
A Switched-Off Distributor Can Still Cancel
Gateway Stream can stop a distributor from taking new sales without stopping it from servicing what it already sold. So a source being unavailable for search or booking is never a reason a cancellation fails — if a cancel fails, something else is wrong.
Fees Are the Supplier's Figures
cancellationFee and refundAmount describe the supplier side of the booking,
not your sell price. If you added markup on top, work out what to refund the guest from your own records
— the API does not know what you charged them.