V2 Cancel
Bookings created through V2 Book are cancelled using the booking id from the book response. Always call precancel first to confirm the exact penalty before committing to the cancellation.
Cancellation endpoints are shared between V1 and V2 — they operate on the
booking id, not on a rate key or session. If you lost the booking id
(for example after a dropped book request), recover it with
GET /v1/book?client_reference=YOUR_REF.
The cancellation model
CancelDetails object
- Name
price_cancellation_penalty- Type
- number
- Description
The penalty charged for cancelling the booking.
0.00when the booking is still within its free cancellation window.
- Name
price_currency- Type
- string
- Description
Penalty currency code.
How penalties are calculated
The penalty is determined by the booking's cancellation policy:
- NonRefundable bookings — the penalty is always the full
price_chargeableamount. - Refundable bookings, before the deadline — cancelling on or before
cancellation_policy_dateincurs no penalty. - Refundable bookings, after the deadline — cancelling after
cancellation_policy_dateincurs the fullprice_chargeableamount. - Sandbox bookings — cancellation is always free.
V2 bookings are always paid via account balance, so the difference between price_chargeable and the cancellation penalty is automatically credited back to your account balance when the booking is cancelled.
Cancelling an already-cancelled booking does not return an error. The response contains the penalty that applied at the time of the original cancellation, and no vendor call is made.
Precancel
Returns the penalty that would be charged if the booking were cancelled right now. This is a read-only quote — it does not modify the booking or contact the vendor.
Path parameters
- Name
booking_id- Type
- integer
- Description
The booking
idfrom the V2 Book response.
Error responses
500 Internal Server Error— Booking not found or error retrieving cancellation details
Request
curl https://api.tripedge.com/v1/book/precancel/12345 \
-H "Authorization: Bearer {token}"
Response (within free cancellation window)
{
"success": true,
"data": {
"price_cancellation_penalty": 0.00,
"price_currency": "USD"
},
"message": null
}
Response (past deadline or non-refundable)
{
"success": true,
"data": {
"price_cancellation_penalty": 750.00,
"price_currency": "USD"
},
"message": null
}
Cancel booking
Cancels the booking with the hotel vendor. On success, the booking status changes to cancelled and any refundable amount is credited back to your account balance.
The request has no body — the penalty is determined by the booking's cancellation policy at the time of the call.
Path parameters
- Name
booking_id- Type
- integer
- Description
The booking
idfrom the V2 Book response.
Error responses
500 Internal Server Error— Booking not found, vendor cancellation failed, or cancellation not supported for this vendor
A cancellation is only final when the response returns success: true.
If the request fails or times out, verify the booking status via
GET /v1/book?id=12345 (or GET /v1/book?client_reference=YOUR_REF)
before retrying.
Request
curl -X POST https://api.tripedge.com/v1/book/cancel/12345 \
-H "Authorization: Bearer {token}"
Response
{
"success": true,
"data": {
"price_cancellation_penalty": 0.00,
"price_currency": "USD"
},
"message": null
}
Error response
{
"success": false,
"message": "Error cancelling booking"
}