Table of Contents

Flight Booking Cancellation API Documentation

Overview

This API cancels an existing flight booking. Requires valid booking reference and provider authentication. Returns success status upon cancellation.


API Endpoint

  • URL: https://api-stag.tripdata.vn/hub/flight/booking/{bookingId}/cancel
  • Method: POST
  • Content-Type: application/json

Headers

Key Value Description
Authorization Bearer {token} JWT access token (Required)
Content-Type application/json Request format

Path Parameters

Field Type Description Example
bookingId String Unique booking UUID a75d87f6-fc2f-4118-b9be-657018be62e8

Request Body

Field Type Required Example Description
Provider String ✅ Yes "provider1" Booking provider identifier
ProviderReferenceId String ✅ Yes "917424627208020801" Provider-specific booking ID

Sample Request

curl --location 'https://api-stag.tripdata.vn/hub/flight/booking/a75d87f6-fc2f-4118-b9be-657018be62e8/cancel' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6...' \
--header 'Content-Type: application/json' \
--data '{
    "Provider": "provider1",
    "ProviderReferenceId": "917424627208020801"
}'

Sample Response

Status: 200 OK

true

Response Description

  • true: Cancellation request accepted successfully
  • false: Cancellation failed (check error logs)

Notes

  1. Booking ID in URL must match provider reference ID in body
  2. Cancellation fees may apply based on airline policy
  3. Success response only confirms request acceptance - actual cancellation may take time
  4. Idempotent - repeating same cancellation request has no side effects
  5. Final cancellation status should be verified via booking status API