Cancellation
Two steps: simulate to learn the exact fees, then cancel. Fees come from the cancellation policy of the booked rate.
POST/v1/{code}/bookings/{ref}/cancel
Request
URL parameters
- Name
ref- Type
- string
- Description
Gateway reference of the booking (e.g.
BPG-2026-000123).
Query parameters
- Name
simulate- Type
- boolean
- Description
true= simulation: returns the fees without cancelling. Absent orfalse= real cancellation.
Behaviour
- Cancellation is idempotent: replaying the call returns the current state.
- An already cancelled booking returns
409 invalid_stateon real cancellation, and the fees on simulation.
POST
/v1/1000/bookings/BPG-2026-000123/cancelcurl -s -X POST "https://partners.bravebooking.net/v1/1000/bookings/BPG-2026-000123/cancel?simulate=true" \
-H "X-Api-Key: $API_KEY" \
-H "X-Timestamp: $TIMESTAMP" \
-H "X-Signature: $SIGNATURE" \
-H "Accept: application/json"
Response
{
"reference": "BPG-2026-000123",
"status": "confirmed",
"simulated": true,
"cancellationFees": { "amount": 0.0, "currency": "TND" },
"refundableAmount": { "amount": 2500.0, "currency": "TND" },
"applicablePolicy": {
"from": "2026-12-15",
"to": "2027-01-14",
"type": "PERCENT",
"value": 0
}
}
Errors
| Code | Meaning |
|---|---|
404 not_found | Unknown reference |
409 invalid_state | Booking already cancelled, or cancellation in progress |
422 too_late | Cancellation period elapsed per the rate policy |