---
title: "Creating a Payment with Airline Data"
source_url: https://docs.rapyd.net/en/creating-a-payment-with-airline-data.html
lang: en
---

# Creating a Payment with Airline Data

You can send additional information on a payment that is related to an airline ticket purchase.

Relevant where the payment method category is **card**.

### How

Add the `enhanced_data` object to the payload with the following parameters:

- `data_type` - Enter the value **airline**. String.
- `details` - An object that includes the following fields:

  | Field | Description |
  | --- | --- |
  | `ticket_number` | The airline ticket number. String of 13 characters or less. |
  | `departure_date` | The departure date in the **YYYY-MM-DD** format. String. |
  | `travel_agency_code` | The code of the travel agency that purchased the airline ticket. String of 8 characters or less. |
  | `travel_agency_name` | The name of the travel agency that purchased the airline ticket. String of 25 characters or less. |
  | `crs_code` | The Computerized Reservation System (CRS) code. String of 4 characters. |
  | `origin_airport_code` | Unique 3-letter identifier (IATA code) assigned to the airport where the flight begins. String. |
  | `destination_airport_code` | Unique 3-letter identifier (IATA code) assigned to the airport where the flight ends. String. |
  | `passengers` | An array of objects with the details of the passengers. Each object includes the following fields for a specific passenger:  - `name` - The name of the passenger. String of 40 characters or less. - `type` - Passenger Type Code. Valid values are **ADT** (adult), **CHD** (child), or **INF** (infant). |
  | `refund_policy` | The refund policy for the tickets. Valid values are **NON_REFUNDABLE** and **REFUNDABLE**. |
  | `flight_legs` | An array of objects with the details of the flight legs. Each object includes the following fields for a flight leg:  - `carrier_code` - The unique identifier for the airline. A two letter string. - `flight_number` - The unique identifier for the flight number. Usually consists of a two-character airline code (IATA) followed by 1–4 digits. String. - `trip_leg_departure_date` - scheduled date on which the segment (leg) of the flight is set to depart. **YYYY-MM-DD** format. String. - `departure_airport_code` - Unique 3-letter identifier (IATA code) assigned to the airport where the flight leg begins. String. - `arrival_airport_code` - Unique 3-letter identifier (IATA code) assigned to the airport where the flight leg ends. String. - `service_class` - The single-letter code used in the travel industry to define the cabin, fare flexibility, and price of ticket for flight leg. String. - `fare_basis_code` - The 1-8 character alphanumeric code used to define the specific flight leg ticket rules, including price, cabin class, refundability, and restrictions. String. - `is_stopover_allowed` - Indicates if a stopover is allowed on the flight leg. Boolean. |

### Example

- Payment with Additional Airline Data:

  - - Request

      - ```json
        curl -X post 'https://sandboxapi.rapyd.net/v1/payments/' \
        -H 'access_key: your-access-key-here' \
        -H 'Content-Type: application/json' \
        -H 'idempotency: your-idempotency-parameter-here' \
        -H 'salt: your-random-string-here' \
        -H 'signature: your-calculated-signature-here' \
        -H 'timestamp: your-unix-timestamp-here' \
        --data-raw '{
            "amount": 100,
            "currency": "GBP",
            "description": "demo of airline ticket purchase",
            "enhanced_data": {
                "data_type": "AIRLINE",
                "details": {
                    "ticket_number": "1234567890123",
                    "departure_date": "2026-02-05",
                    "travel_agency_code": "ABCD1234",
                    "travel_agency_name": "GLOBAL TRAVEL INC",
                    "crs_code": "ABCD",
                    "origin_airport_code": "ABC",   
                    "destination_airport_code": "DEF",
                    "passengers": [
                        {   
                            "name": "JOHN/DOEMR",                    
                            "type": "ADT"
                        }
                    ],
                    "refund_policy": "NON_REFUNDABLE",
                    "flight_legs": [
                        {
                            "carrier_code": "AB",
                            "flight_number": "AB123",
                            "trip_leg_departure_date": "2026-02-05",
                            "departure_airport_code": "ABC",
                            "arrival_airport_code": "DEF",
                            "service_class": "Y",
                            "fare_basis_code": "YCLASS",
                            "is_stopover_allowed": true
                        }
                    ]
                }
            },
            "payment_method": {
                "type": "gb_visa_card",
                "fields": {
                    "name": "John Doe",
                    "number": "4111111111111111",
                    "expiration_month": "01",
                    "expiration_year": "29",
                    "cvv": "123"
                }
            },
            "capture": false,
            "save_payment_method": true,
            "complete_payment_url": "https://www.sample123456.com/complete",
            "error_payment_url": "https://www.sample123456.com/error"
        }
        '
        ```

  The platform returns the following response:

  - - Response

      - ```json
        {
            "status": {
                "error_code": "",
                "status": "SUCCESS",
                "message": "",
                "response_code": "",
                "operation_id": "86866ff5-ba80-4ecf-b384-c819671ff1e7"
            },
            "data": {
                "id": "payment_e1af9a771fcde0fae6cadbdcff81fe75",
                "amount": 0,
                "original_amount": 100,
                "is_partial": false,
                "currency_code": "GBP",
                "country_code": "GB",
                "status": "ACT",
                "description": "demo of airline ticket purchase",
                "merchant_reference_id": "",
                "customer_token": "cus_7fc4b412d226ec855c4f2cb816fc482d",
                "payment_method": "card_1babccbcb4273fc8b65e43331242b2c7",
                "payment_method_data": {
                    "id": "card_1babccbcb4273fc8b65e43331242b2c7",
                    "type": "gb_visa_card",
                    "category": "card",
                    "metadata": null,
                    "image": "",
                    "webhook_url": "",
                    "supporting_documentation": "",
                    "next_action": "not_applicable",
                    "name": "John Doe",
                    "last4": "1111",
                    "acs_check": "unchecked",
                    "cvv_check": "pass",
                    "bin_details": {
                        "type": "DEBIT",
                        "brand": "VISA",
                        "level": "GOLD",
                        "issuer": "INTL ISSUER DEMO",
                        "country": "SG",
                        "bin_number": "111111"
                    },
                    "expiration_year": "29",
                    "expiration_month": "01",
                    "fingerprint_token": "ocfp_95e2482605667945da4b2374b4f51bd3",
                    "network_reference_id": "000000486159747",
                    "payment_account_reference": "V0010013427467657257857418047"
                },
                "auth_code": "971101",
                "expiration": 1772755200,
                "captured": false,
                "refunded": false,
                "refunded_amount": 0,
                "receipt_email": "",
                "redirect_url": "",
                "complete_payment_url": "https://www.sample123456.com/complete",
        	"error_payment_url": "https://www.sample123456.com/error",
                "receipt_number": "",
                "flow_type": "",
                "address": null,
                "statement_descriptor": "",
                "transaction_id": "",
                "created_at": 1770197118,
                "metadata": {},
                "failure_code": "",
                "failure_message": "",
                "paid": false,
                "paid_at": 0,
                "dispute": null,
                "refunds": null,
                "order": null,
                "outcome": null,
                "visual_codes": {},
                "textual_codes": {},
                "instructions": [],
                "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                "ewallets": [
                    {
                        "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                        "amount": 100,
                        "percent": 100,
                        "refunded_amount": 0
                    }
                ],
                "payment_method_options": {},
                "payment_method_type": "gb_visa_card",
                "payment_method_type_category": "card",
                "fx_rate": 1,
                "merchant_requested_currency": null,
                "merchant_requested_amount": null,
                "fixed_side": "",
                "payment_fees": null,
                "invoice": "",
                "escrow": null,
                "group_payment": "",
                "cancel_reason": null,
                "initiation_type": "customer_present",
                "mid": "mid_26302_00000001_valitor",
                "next_action": "pending_capture",
                "error_code": "",
                "remitter_information": {},
                "save_payment_method": true,
                "merchant_advice_code": null,
                "merchant_advice_message": null,
                "enhanced_data": {
                    "data_type": "AIRLINE",
                    "details": {
                        "crs_code": "ABCD",
                        "passengers": [
                            {
                                "name": "JOHN/DOEMR"",
                                "type": "ADT"                      
                            }
                        ],
                        "flight_legs": [
                            {
                                "carrier_code": "AB",
                                "flight_number": "AB123",
                                "service_class": "Y",
                                "fare_basis_code": "YCLASS",
                                "is_stopover_allowed": true,
                                "arrival_airport_code": "ABC",
                                "departure_airport_code": "DEF",
                                "trip_leg_departure_date": "2026-02-05"
                            }
                        ],
                        "refund_policy": "NON_REFUNDABLE",
                        "ticket_number": "1234567890123",
                        "departure_date": "2026-02-26",
                        "travel_agency_code": "ABCD1234",
                        "travel_agency_name": "GLOBAL TRAVEL INC",
                        "origin_airport_code": "ABC",
                        "destination_airport_code": "DEF"
                    }
                },
                "transaction_link_id": null
            }
        }
        ```
