Airline Credits
Airline credits represent credit issued by an airline for a canceled or disrupted flight. These credits can be used as payment for future bookings.
Schema
The currency of the amount, as an ISO 4217 currency code.
"GBP"The ISO 8601 datetime at which the airline credit was created.
"2020-04-11T15:48:11.642Z"The currency in which this airline credit is issued, as an ISO 4217 currency code
"GBP"The ISO 8601 datetime at which the airline credit expires and will no longer be eligible for payment.
"2020-04-11T15:48:11.642Z"The ISO 8601 datetime at which the airline credit was invalidated. Invalidated credits are not eligible for payment.
"2020-04-11T15:48:11.642Z"The ISO 8601 datetime at which the airline credit was issued by the airline.
"2020-04-11"The currency of the penalty amount, as an ISO 4217 currency code.
"GBP"The ISO 8601 datetime at which the airline credit was spent. Spent credits are not eligible for payment.
"2020-04-11T15:48:11.642Z"Get a single airline credit
Retrieves an airline credit by its ID.
This endpoint returns detailed information about a specific airline credit, including its amount, currency, expiration date, and association with a customer user or order.
Endpoint
GET https://api.duffel.com/air/airline_credits/{id}
Request
curl -X GET --compressed "https://api.duffel.com/air/airline_credits/{id}" \-H "Accept-Encoding: gzip" \-H "Accept: application/json" \-H "Duffel-Version: v2" \-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"
Response
{"data": {"user_id": "icu_00009hj8USM7Ncg31cBCLL","type": "eticket","spent_at": "2020-04-11T15:48:11.642Z","penalty_currency": "GBP","penalty_amount": "10.20","passenger_id": "pas_00009hj8USM7Ncg31cBCLL","order_id": "ord_00009hj8USM7Ncg31cBCLL","live_mode": false,"issued_on": "2020-04-11","invalidated_at": "2020-04-11T15:48:11.642Z","id": "acd_00009UhD4ongolulWd91Ky","given_name": "John","family_name": "Doe","expires_at": "2020-04-11T15:48:11.642Z","credit_name": "Future Flight Credit","credit_currency": "GBP","credit_code": "1234567890123","credit_amount": "90.80","created_at": "2020-04-11T15:48:11.642Z","code": "12345678","amount_currency": "GBP","amount": "30.20","airline_iata_code": "AA"}}
List airline credits
Retrieves a paginated list of airline credits. You can filter the results by customer user ID to see credits for a specific user.
Airline credits represent credit issued by an airline for a canceled or changed flight. These credits can be used as payment for future bookings.
Query parameters
A cursor pointing to the previous page of records. For more information on how to paginate through records, see the Pagination section.
"g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="A cursor pointing to the next page of records. For more information on how to paginate through records, see the Pagination section.
"g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="The maximum number of records to return per page. Defaults to 50.
May be set to any integer between 1 and 200. For more information on how to paginate through records, see the Pagination section.
150Endpoint
GET https://api.duffel.com/air/airline_credits
Request
curl -X GET --compressed "https://api.duffel.com/air/airline_credits?after=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&before=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&limit=1&user_id=icu_00009hj8USM7Ncg31cBCLL" \-H "Accept-Encoding: gzip" \-H "Accept: application/json" \-H "Duffel-Version: v2" \-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"
Response
{"meta": {"limit": 50,"after": "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="},"data": [{"user_id": "icu_00009hj8USM7Ncg31cBCLL","type": "eticket","spent_at": "2020-04-11T15:48:11.642Z","penalty_currency": "GBP","penalty_amount": "10.20","passenger_id": "pas_00009hj8USM7Ncg31cBCLL","order_id": "ord_00009hj8USM7Ncg31cBCLL","live_mode": false,"issued_on": "2020-04-11","invalidated_at": "2020-04-11T15:48:11.642Z","id": "acd_00009UhD4ongolulWd91Ky","given_name": "John","family_name": "Doe","expires_at": "2020-04-11T15:48:11.642Z","credit_name": "Future Flight Credit","credit_currency": "GBP","credit_code": "1234567890123","credit_amount": "90.80","created_at": "2020-04-11T15:48:11.642Z","code": "12345678","amount_currency": "GBP","amount": "30.20","airline_iata_code": "AA"}]}
Create an airline credit
Creates a new airline credit that can be used as payment for future bookings.
You can create an airline credit either for an existing customer user by providing their user_id, or for a new customer by providing their given_name and family_name.
The airline credit will be associated with a carrier via airline_iata_code.
Body parameters
Endpoint
POST https://api.duffel.com/air/airline_credits
Request
curl -X POST --compressed "https://api.duffel.com/air/airline_credits" \-H "Accept-Encoding: gzip" \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Duffel-Version: v2" \-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \-d '{"data": {"user_id": "icu_00009hj8USM7Ncg31cBCLL","type": "eticket","issued_on": "2020-04-11","given_name": "John","family_name": "Smith","expires_at": "2024-04-11T15:48:11.642Z","code": "1234567890123","amount_currency": "GBP","amount": "90.80","airline_iata_code": "AA"}}'
Response
{"data": {"user_id": "icu_00009hj8USM7Ncg31cBCLL","type": "eticket","spent_at": "2020-04-11T15:48:11.642Z","penalty_currency": "GBP","penalty_amount": "10.20","passenger_id": "pas_00009hj8USM7Ncg31cBCLL","order_id": "ord_00009hj8USM7Ncg31cBCLL","live_mode": false,"issued_on": "2020-04-11","invalidated_at": "2020-04-11T15:48:11.642Z","id": "acd_00009UhD4ongolulWd91Ky","given_name": "John","family_name": "Doe","expires_at": "2020-04-11T15:48:11.642Z","credit_name": "Future Flight Credit","credit_currency": "GBP","credit_code": "1234567890123","credit_amount": "90.80","created_at": "2020-04-11T15:48:11.642Z","code": "12345678","amount_currency": "GBP","amount": "30.20","airline_iata_code": "AA"}}