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.

airline_iata_code
string

The two-character IATA code for the airline that issued this credit

Example: "AA"
amount
string

Value of this airline credit

Example: "30.20"
amount_currency
stringnullable

The currency of the amount, as an ISO 4217 currency code.

Example: "GBP"
code
stringnullable

Credit identifier provided by the airline

Example: "12345678"
created_at
datetime

The ISO 8601 datetime at which the airline credit was created.

Example: "2020-04-11T15:48:11.642Z"
credit_amount
string

The monetary value associated with this airline credit

Example: "90.80"
credit_code
stringnullable

The code which identifies the airline credit to the airline and will be used to redeem the airline credit

Example: "1234567890123"
credit_currency
string

The currency in which this airline credit is issued, as an ISO 4217 currency code

Example: "GBP"
credit_name
string

The common name given to this airline credit.

Example: "Future Flight Credit"
expires_at
datetimenullable

The ISO 8601 datetime at which the airline credit expires and will no longer be eligible for payment.

Example: "2020-04-11T15:48:11.642Z"
family_name
string

The family name of the passenger associated with this airline credit.

Example: "Doe"
given_name
stringnullable

The given name of the passenger associated with this airline credit.

Example: "John"
id
string

Duffel's unique identifier for the resource

Example: "acd_00009UhD4ongolulWd91Ky"
invalidated_at
datetimenullable

The ISO 8601 datetime at which the airline credit was invalidated. Invalidated credits are not eligible for payment.

Example: "2020-04-11T15:48:11.642Z"
issued_on
date

The ISO 8601 datetime at which the airline credit was issued by the airline.

Example: "2020-04-11"
live_mode
boolean

Whether the payment was created in live mode. This field will be set to true if the payment was created in live mode, or false if it was created in test mode.

Example: false
order_id
stringnullable

Duffel's unique identifier for the order that the credit is associated with

Example: "ord_00009hj8USM7Ncg31cBCLL"
passenger_id
stringnullable

Duffel's unique identifier for the passenger on the order that the credit is associated with

Example: "pas_00009hj8USM7Ncg31cBCLL"
penalty_amount
stringnullable

The penalty that will be incurred when paying with this airline credit

Example: "10.20"
penalty_currency
stringnullable

The currency of the penalty amount, as an ISO 4217 currency code.

Example: "GBP"
spent_at
datetimenullable

The ISO 8601 datetime at which the airline credit was spent. Spent credits are not eligible for payment.

Example: "2020-04-11T15:48:11.642Z"
type
enum

Type of the airline credit

Possible values: "eticket" or "mco"
user_id
stringnullable

Duffel's unique identifier for the customer user that the credit is associated with

Example: "icu_00009hj8USM7Ncg31cBCLL"

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.

URL parameters

id
stringrequired

Duffel's unique identifier for the airline credit

Example: "acd_00009UhD4ongolulWd91Ky"

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"
}
}

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

after
string

A cursor pointing to the previous page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
before
string

A cursor pointing to the next page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
limit
integer

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.

Example: 1
Default value: 50
user_id
string

Filters the returned airline credits by a specific customer user's unique identifier.

Example: "icu_00009hj8USM7Ncg31cBCLL"

Endpoint

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"
}
]
}

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

airline_iata_code
stringrequired

The two-character IATA code for the airline that issued this credit

Example: "AA"
amount
stringrequired

The monetary value of this airline credit

Example: "90.80"
amount_currency
stringrequired

The currency of the amount, as an ISO 4217 currency code.

Example: "GBP"
code
stringrequired

The code which identifies the airline credit to the airline and will be used to redeem the airline credit

Example: "1234567890123"
expires_at
datetimerequired

The datetime at which the airline credit expires and will no longer be eligible for payment

Example: "2024-04-11T15:48:11.642Z"
family_name
string

The family name of the customer this credit is for.

Required if user_id is not provided.

Example: "Smith"
given_name
string

The given name of the customer this credit is for.

Required if user_id is not provided.

Example: "John"
issued_on
daterequired

The date the airline credit was issued by the airline

Example: "2020-04-11"
type
enumrequired

Type of the airline credit

Possible values: "eticket" or "mco"
user_id
string

Duffel's unique identifier for the customer user that the credit should be associated with.

Either provide user_id or both given_name and family_name.

Example: "icu_00009hj8USM7Ncg31cBCLL"

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"
}
}