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

typeWhen TravClan sends it
FINAL_BOOKING_CODE_ASSIGNEDTravClan has confirmed the booking and assigned the final booking code.

Request

ItemValue
MethodPOST
URLYour webhook URL (HTTPS)
HeaderContent-Type: application/json
Headerx-api-key: <YOUR_API_KEY>

Request Body Parameters

ParameterTypeDescription
typeStringEvent name, e.g. FINAL_BOOKING_CODE_ASSIGNED.
buyer_booking_referenceStringYour reference, as sent in the Book API. Use it to find your booking.
booking_codeStringThe final booking code. Different from the provisional booking_code returned by the Book API.
quote_codeStringTravClan's quote code for the booking.
requirement_codeStringTravClan'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

CaseWhat to do
Normal case
  1. Verify the call comes from TravClan before changing anything.
    2. Find your booking by buyer_booking_reference
    3. Save the final code from booking_code and mark the booking confirmed. Keep the provisional code from the Book API as well.
    4. Show it to the traveller: replace "Booking received" with "Booking confirmed" and the final booking code.
Same event received againTreat it as a repeat; change nothing and answer 200.
Unknown buyer_booking_referenceLog it and answer 200.
Booking already cancelled or refunded on your sideDo not change it; log the event for your team.



Did this page help you?