API Specification

Flight Cancel API

v1.2.0 Active API Key Required

Cancel a flight booking and initiate refund

Endpoint

POST /api/b2b/flights/cancel.php

This API allows you to cancel a confirmed flight booking. It initiates the cancellation process and returns cancellation status along with refund details.

API Key Authentication

Authenticate requests via HTTP Header or Request Parameter
Required for all endpoints

Enjoy Holiday Hub APIs authenticate requests using your unique secret API Key. You can provide your key in either of the following standard formats:

Method 1: Header (Recommended)

Send key in standard HTTP header:

X-API-Key: demo_123456789
Method 2: Body / Query

Send key in JSON payload or query param:

"api_key": "demo_123456789"
Demo Sandbox Key: demo_123456789
Get your production key in Agent Portal

Request Parameters

FieldTypeRequiredDescription
BookingIdintegerRequiredUnique booking ID
PNRstringOptionalAirline PNR (optional)
RemarksstringOptionalReason for cancellation

Request Example

JSON Response
{
    "api_key": "YOUR_API_KEY",
    "BookingId": 56789,
    "Remarks": "Customer requested cancellation"
}

cURL Example

curl -X POST "https://enjoyholidayhub.com/api/b2b/flights/cancel.php" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-API-Key: demo_123456789" \
  -d '{
    "BookingId": 56789,
    "Remarks": "Customer requested cancellation",
    "api_key": "demo_123456789"
}'

Response Example

JSON Response
{
    "status": true,
    "data": {
        "cancel_id": 987,
        "booking_id": 56789,
        "status": "cancelled",
        "refund_amount": 4200,
        "refund_status": "processing"
    }
}

Response (Error)

ERROR / NOTICE Cancellation failed or booking not eligible
JSON Response
{
    "status": false,
    "message": "Cancellation failed or booking not eligible"
}

Important Notes

  • ⚠️ Cancellation depends on airline policy
  • 💰 Refund amount varies based on timing and fare rules
  • ⏳ Refund processing time depends on payment method
  • 🔁 Partial cancellation may be allowed for multi-passenger bookings
  • ✈️ Always check fare rules before cancellation