Booking Status Webhook
TravClan calls your webhook when the status of a Trusted Getaways booking changes. The main event is FINAL_BOOKING_CODE_ASSIGNED: after the Book API returns a provisional booking and TravClan receives the traveller's documents, TravClan confirms the booking and sends you the final booking code.
Match each call to your booking with buyer_booking_reference, the reference you sent in the Book API.
Events
| type | When TravClan sends it |
|---|---|
| FINAL_BOOKING_CODE_ASSIGNED | TravClan has confirmed the booking and assigned the final booking code. |
Request
| Item | Value |
|---|---|
| Method | POST |
| URL | Your webhook URL (HTTPS) |
| Header | Content-Type: application/json |
| Header | x-api-key: <YOUR_API_KEY> |
Request Body Parameters
| Parameter | Type | Description |
|---|---|---|
type | String | Event name, e.g. FINAL_BOOKING_CODE_ASSIGNED. |
buyer_booking_reference | String | Your reference, as sent in the Book API. Use it to find your booking. |
booking_code | String | The final booking code. Different from the provisional booking_code returned by the Book API. |
quote_code | String | TravClan's quote code for the booking. |
requirement_code | String | TravClan's requirement code for the booking. |
Sample Request
curl --request POST 'https://your-domain.com/webhooks/travclan' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <YOUR_API_KEY>' \
--data '{
"type": "FINAL_BOOKING_CODE_ASSIGNED",
"quote_code": "qf9v8",
"requirement_code": "lkw76",
"booking_code": "tr6gh",
"buyer_booking_reference": "BUY-12345"
}'Handling the Webhook
| Case | What to do |
|---|---|
| Normal case |
|
| Same event received again | Treat it as a repeat; change nothing and answer 200. |
| Unknown buyer_booking_reference | Log it and answer 200. |
| Booking already cancelled or refunded on your side | Do not change it; log the event for your team. |
Updated 4 days ago
Did this page help you?
