Card

In order to pay travel suppliers by card you first need to create a card in the vault.

Once created, the card can be used to pay for travel using its ID.

By default, cards remain in the vault for 25 minutes, after which they are deleted.

If you plan to reuse a card multiple times, you can create a multi-use card record by setting multi_use to true. The created record cannnot be used for payment, as it will not include a CVC.

Instead, you can create additional card records for use for future payment, requiring only a cvc value to be supplied on checkout by providing cvc and card_id with the multi-use card id as value.

NOTE the API url is https://api.duffel.cards

brand
enum

Card brand name.

Possible values: "visa", "mastercard", "uatp", "american_express", "diners_club", "jcb", or "discover"
id
string

Duffel's unique identifier for the resource

Example: "tcd_00009hthhsUZ8W4LxQgkjb"
last_4_digits
string

Last 4 digits of the card number.

Example: "1234"
live_mode
boolean

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

Example: true
multi_use
boolean

A true value indicates that the card can be used for future transactions until the expiration or until deleted. A false value indicates that the card will be automatically deleted once used or until the time indicated by unavailable_at, whichever happens first.

Example: false
unavailable_at
datetime

The ISO 8601 datetime at which the card will be automatically deleted.

Example: "2023-04-13T15:48:11.642Z"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

In order to pay travel suppliers by card you first need to create a card in the vault.

Once created, the card can be used to pay for travel using its ID.

By default, cards remain in the vault for 25 minutes, after which they are deleted.

If you plan to reuse a card multiple times, you can create a multi-use card record by setting multi_use to true. The created record cannnot be used for payment, as it will not include a CVC.

Instead, you can create additional card records for use for future payment, requiring only a cvc value to be supplied on checkout by providing cvc and card_id with the multi-use card id as value.

NOTE the API url is https://api.duffel.cards

Body parameters

address_city
stringrequired

The city of the billing address associated with the card.

Example: "London"
address_country_code
stringrequired

The ISO 3166-1 alpha-2 code for the country of the billing address associated with the card.

Example: "GB"
address_line_1
stringrequired

The first line of the billing address associated with the card.

Example: "10 Downing St"
address_line_2
string

The second line of the billing address associated with the card.

Example: "Westminster"
address_postal_code
stringrequired

The postal code of the billing address associated with the card.

Example: "SW1A 2AA"
address_region
stringrequired

The region of the billing address associated with the card.

Example: "London"
card_id
string

Duffel's unique identifier for the saved card that should be used to create a single use card record.

Example: "tcd_00009hthhsUZ8W4LxQgkjb"
cvc
stringrequired

The card CVC. Value not accepted when creating multi-use cards.

Example: "123"
expiry_month
stringrequired

The card expiry month as an integer with two digits, e.g. for February use 02.

Example: "02"
expiry_year
stringrequired

The card expiry year as an integer with two digits, e.g. for 2023 use 23.

Example: "23"
multi_use
boolean

Set to true to indicate that this card can be used multiple times. Should not be provided when creating a card from a multi-use card record.

Example: false
name
stringrequired

The name on the card.

Example: "Neil Armstrong"
number
stringrequired

The card number.

Example: "4242424242424242"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Endpoint

POST https://api.duffel.cards/payments/cards

Request

curl -X POST --compressed "https://api.duffel.cards/payments/cards" \
-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": {
"number": "4242424242424242",
"name": "Neil Armstrong",
"multi_use": false,
"expiry_year": "23",
"expiry_month": "02",
"cvc": "123",
"card_id": "tcd_00009hthhsUZ8W4LxQgkjb",
"address_region": "London",
"address_postal_code": "SW1A 2AA",
"address_line_2": "Westminster",
"address_line_1": "10 Downing St",
"address_country_code": "GB",
"address_city": "London"
}
}'

Response

{
"data": {
"unavailable_at": "2023-04-13T15:48:11.642Z",
"multi_use": false,
"live_mode": true,
"last_4_digits": "1234",
"id": "tcd_00009hthhsUZ8W4LxQgkjb",
"brand": "mastercard"
}
}

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

You can use this endpoint to delete card records.

The endpoint works for all cards, but it's particularly useful for multi-use cards, as single use cards are automatically deleted after 25 minutes or after they are used, whichever comes first.

NOTE the API url is https://api.duffel.cards

URL parameters

id
stringrequired

Duffel's unique identifier for the resource

Example: "tcd_00009hthhsUZ8W4LxQgkjb"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Endpoint

DELETE https://api.duffel.cards/payments/cards/{id}

Request

curl -X DELETE --compressed "https://api.duffel.cards/payments/cards/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Retrieves a card by its ID

URL parameters

id
stringrequired

Duffel's unique identifier for the resource

Example: "tcd_00009hthhsUZ8W4LxQgkjb"

Preview

This is not yet finalised. It may change, or be removed or be not yet accessible.

Endpoint

GET https://api.duffel.com/payments/cards/{id}

Request

curl -X GET --compressed "https://api.duffel.com/payments/cards/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"data": {
"unavailable_at": "2023-04-13T15:48:11.642Z",
"multi_use": false,
"live_mode": true,
"last_4_digits": "1234",
"id": "tcd_00009hthhsUZ8W4LxQgkjb",
"brand": "mastercard"
}
}