Cars Bookings

A booking for a rental car quote.

base_amount
stringnullable

The base amount as a decimal string.

Example: "95.22"
base_currency
string

The base currency code (ISO 4217).

Example: "GBP"
cancelled_at
datetimenullable

The date and time when the booking was cancelled.

Example: null
car
object
charges
listnullable

A list of charges included in the booking.

conditions
list

Terms and conditions for the rental.

confirmed_at
datetimenullable

The date and time when the booking was confirmed.

Example: "2022-12-20T15:45:01.000000Z"
driver
object

Information about the driver for a car booking.

dropoff_date
date

Requested vehicle dropoff date.

Example: "2024-01-20"
dropoff_location
object
dropoff_time
string

Requested vehicle dropoff time, in 24-hour format (HH:MM).

Example: "15:00"
id
string

The unique identifier for the booking.

Example: "boo_0000Cx4Af0b5l45AT50eqO"
live_mode
boolean

Whether this booking was created in live mode.

Example: false
metadata
objectnullable

Metadata contains a set of key-value pairs you passed in the request when you created the booking. Duffel does not use this information. This field should not be used for storing sensitive information. The purpose of this field is to allow you to store additional information about the booking in a structured format that you can use for your own purposes.

Example: {"custom_field":"custom_value_123"}
mileage
object
payment_type
enum

The type of payment required for the rental.

Possible values: "postpaid", "guarantee", or "prepaid"
pickup_date
date

Requested vehicle pickup date.

Example: "2024-01-15"
pickup_location
object
pickup_time
string

Requested vehicle pickup time, in 24-hour format (HH:MM).

Example: "10:30"
privacy_policies
listnullable

Privacy policy entries associated with this booking.

quote_id
string

The identifier of the quote this booking is based on.

Example: "qut_0000Bx4Af0b5l45AT50eqO"
reference
string

The booking reference code.

Example: "DTD-ABC123"
status
enum

The current status of the booking.

Possible values: "confirmed" or "cancelled"
supplier
object
total_amount
string

The total amount as a decimal string.

Example: "101.34"
total_currency
string

The total currency code (ISO 4217).

Example: "GBP"
users
string[]

The ids of customer users that would be allowed to manage the booking.

Example: ["icu_0000B0nwceAOyWuOFJ23NJ"]

Cancels a booking for a rental car.

URL parameters

id
stringrequired

The unique identifier for the booking.

Example: "boo_0000Cx4Af0b5l45AT50eqO"

Endpoint

POST https://api.duffel.com/cars/bookings/{id}/actions/cancel

Request

curl -X POST --compressed "https://api.duffel.com/cars/bookings/{id}/actions/cancel" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"data": {
"users": [
"icu_0000B0nwceAOyWuOFJ23NJ"
],
"total_currency": "GBP",
"total_amount": "101.34",
"supplier": {
"name": "Duffel Test Drive",
"logo_url": "https://duffel.com/logo.jpg"
},
"status": "confirmed",
"reference": "DTD-ABC123",
"quote_id": "qut_0000Bx4Af0b5l45AT50eqO",
"privacy_policies": [
{
"text": "Your data may be shared with the supplier to process your booking.",
"title": "Customer Data Use"
}
],
"pickup_time": "10:30",
"pickup_location": {
"phone_number": "+44 1234 567890",
"opening_hours": [
{
"to": "20:00",
"from": "08:00"
}
],
"name": "Duffel Test Drive Dropoff",
"geographic_coordinates": {
"longitude": -0.4543,
"latitude": 51.47
},
"address": {
"region": "England",
"postal_code": "W1J 9BR",
"line_one": "150 Piccadilly",
"country_code": "GB",
"city_name": "London"
},
"additional_information": [
{
"title": "Pickup Instructions",
"text": "Please follow the signs to the rental car area."
}
]
},
"pickup_date": "2024-01-15",
"payment_type": "guarantee",
"metadata": {
"custom_field": "custom_value_123"
},
"live_mode": false,
"id": "boo_0000Cx4Af0b5l45AT50eqO",
"dropoff_time": "15:00",
"dropoff_location": {
"phone_number": "+44 1234 567890",
"opening_hours": [
{
"to": "20:00",
"from": "08:00"
}
],
"name": "Duffel Test Drive Dropoff",
"geographic_coordinates": {
"longitude": -0.4543,
"latitude": 51.47
},
"address": {
"region": "England",
"postal_code": "W1J 9BR",
"line_one": "150 Piccadilly",
"country_code": "GB",
"city_name": "London"
},
"additional_information": [
{
"title": "Pickup Instructions",
"text": "Please follow the signs to the rental car area."
}
]
},
"dropoff_date": "2024-01-20",
"driver": {
"user_id": "icu_0000B0nwceAOyWuOF3pz1M",
"phone_number": "+441234567890",
"given_name": "Amelia",
"family_name": "Earheart",
"email": "[email protected]",
"date_of_birth": "1990-01-01"
},
"confirmed_at": "2022-12-20T15:45:01.000000Z",
"conditions": [
{
"title": "Cancellation Policy",
"text": "Free cancellation up to 24 hours before pickup."
}
],
"charges": [
{
"amount": "5.00",
"currency": "GBP",
"description": "Insurance fee"
}
],
"car": {
"type": "four_door",
"transmission": "automatic",
"name": "Kia Picanto",
"max_passengers": 5,
"images": [
{
"url": "https://car.com/kia_picanto.jpg"
}
],
"fuel": "petrol",
"code": "CDAV",
"category": "compact",
"baggage": {
"small": 2,
"large": 3
},
"air_conditioning": true
},
"base_currency": "GBP",
"base_amount": "95.22"
}
}

Creates a booking for a rental car from a Quote

Body parameters

driver
objectrequired
inbound_flight_number
stringnullable

The inbound flight number, if applicable.

Example:
metadata
objectnullable

Metadata contains a set of key-value pairs that you can attach to an object. It can be useful for storing additional information about the object, in a structured format. Duffel does not use this information. You should not store sensitive information in this field. The metadata is a collection of key-value pairs, both of which are strings. You can store a maximum of 50 key-value pairs, where each key has a maximum length of 40 characters and each value has a maximum length of 500 characters. Keys must only contain numbers, letters, dashes, or underscores.

Example: {"custom_field":"custom_value_123"}
payment
objectnullable

Payment information for the booking.

quote_id
stringrequired

The identifier of the quote to book.

Example: "qut_0000Bx4Af0b5l45AT50eqO"
supplier_loyalty_programme_account_number
stringnullable

The supplier loyalty programme account number, if applicable.

Example:
users
string[]

The ids of customer users that would be allowed to manage the booking.

Example: ["icu_0000B0nwceAOyWuOFJ23NJ"]

Endpoint

POST https://api.duffel.com/cars/bookings

Request

curl -X POST --compressed "https://api.duffel.com/cars/bookings" \
-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": {
"users": [
"icu_0000B0nwceAOyWuOFJ23NJ"
],
"quote_id": "qut_0000Bx4Af0b5l45AT50eqO",
"payment": {
"method": "card",
"card_id": "crd_0000A3t2sL46m5eDF45kWW"
},
"metadata": {
"custom_field": "custom_value_123"
},
"driver": {
"user_id": "icu_0000B0nwceAOyWuOF3pz1M",
"phone_number": "+442080160509",
"given_name": "Amelia",
"family_name": "Earheart",
"email": "[email protected]",
"date_of_birth": "1990-01-01"
}
}
}'

Response

{
"data": {
"users": [
"icu_0000B0nwceAOyWuOFJ23NJ"
],
"total_currency": "GBP",
"total_amount": "101.34",
"supplier": {
"name": "Duffel Test Drive",
"logo_url": "https://duffel.com/logo.jpg"
},
"status": "confirmed",
"reference": "DTD-ABC123",
"quote_id": "qut_0000Bx4Af0b5l45AT50eqO",
"privacy_policies": [
{
"text": "Your data may be shared with the supplier to process your booking.",
"title": "Customer Data Use"
}
],
"pickup_time": "10:30",
"pickup_location": {
"phone_number": "+44 1234 567890",
"opening_hours": [
{
"to": "20:00",
"from": "08:00"
}
],
"name": "Duffel Test Drive Dropoff",
"geographic_coordinates": {
"longitude": -0.4543,
"latitude": 51.47
},
"address": {
"region": "England",
"postal_code": "W1J 9BR",
"line_one": "150 Piccadilly",
"country_code": "GB",
"city_name": "London"
},
"additional_information": [
{
"title": "Pickup Instructions",
"text": "Please follow the signs to the rental car area."
}
]
},
"pickup_date": "2024-01-15",
"payment_type": "guarantee",
"metadata": {
"custom_field": "custom_value_123"
},
"live_mode": false,
"id": "boo_0000Cx4Af0b5l45AT50eqO",
"dropoff_time": "15:00",
"dropoff_location": {
"phone_number": "+44 1234 567890",
"opening_hours": [
{
"to": "20:00",
"from": "08:00"
}
],
"name": "Duffel Test Drive Dropoff",
"geographic_coordinates": {
"longitude": -0.4543,
"latitude": 51.47
},
"address": {
"region": "England",
"postal_code": "W1J 9BR",
"line_one": "150 Piccadilly",
"country_code": "GB",
"city_name": "London"
},
"additional_information": [
{
"title": "Pickup Instructions",
"text": "Please follow the signs to the rental car area."
}
]
},
"dropoff_date": "2024-01-20",
"driver": {
"user_id": "icu_0000B0nwceAOyWuOF3pz1M",
"phone_number": "+441234567890",
"given_name": "Amelia",
"family_name": "Earheart",
"email": "[email protected]",
"date_of_birth": "1990-01-01"
},
"confirmed_at": "2022-12-20T15:45:01.000000Z",
"conditions": [
{
"title": "Cancellation Policy",
"text": "Free cancellation up to 24 hours before pickup."
}
],
"charges": [
{
"amount": "5.00",
"currency": "GBP",
"description": "Insurance fee"
}
],
"car": {
"type": "four_door",
"transmission": "automatic",
"name": "Kia Picanto",
"max_passengers": 5,
"images": [
{
"url": "https://car.com/kia_picanto.jpg"
}
],
"fuel": "petrol",
"code": "CDAV",
"category": "compact",
"baggage": {
"small": 2,
"large": 3
},
"air_conditioning": true
},
"base_currency": "GBP",
"base_amount": "95.22"
}
}

Retrieves a previously created rental car booking.

URL parameters

id
stringrequired

The unique identifier for the booking.

Example: "boo_0000Cx4Af0b5l45AT50eqO"

Endpoint

GET https://api.duffel.com/cars/bookings/{id}

Request

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

Response

{
"data": {
"users": [
"icu_0000B0nwceAOyWuOFJ23NJ"
],
"total_currency": "GBP",
"total_amount": "101.34",
"supplier": {
"name": "Duffel Test Drive",
"logo_url": "https://duffel.com/logo.jpg"
},
"status": "confirmed",
"reference": "DTD-ABC123",
"quote_id": "qut_0000Bx4Af0b5l45AT50eqO",
"privacy_policies": [
{
"text": "Your data may be shared with the supplier to process your booking.",
"title": "Customer Data Use"
}
],
"pickup_time": "10:30",
"pickup_location": {
"phone_number": "+44 1234 567890",
"opening_hours": [
{
"to": "20:00",
"from": "08:00"
}
],
"name": "Duffel Test Drive Dropoff",
"geographic_coordinates": {
"longitude": -0.4543,
"latitude": 51.47
},
"address": {
"region": "England",
"postal_code": "W1J 9BR",
"line_one": "150 Piccadilly",
"country_code": "GB",
"city_name": "London"
},
"additional_information": [
{
"title": "Pickup Instructions",
"text": "Please follow the signs to the rental car area."
}
]
},
"pickup_date": "2024-01-15",
"payment_type": "guarantee",
"metadata": {
"custom_field": "custom_value_123"
},
"live_mode": false,
"id": "boo_0000Cx4Af0b5l45AT50eqO",
"dropoff_time": "15:00",
"dropoff_location": {
"phone_number": "+44 1234 567890",
"opening_hours": [
{
"to": "20:00",
"from": "08:00"
}
],
"name": "Duffel Test Drive Dropoff",
"geographic_coordinates": {
"longitude": -0.4543,
"latitude": 51.47
},
"address": {
"region": "England",
"postal_code": "W1J 9BR",
"line_one": "150 Piccadilly",
"country_code": "GB",
"city_name": "London"
},
"additional_information": [
{
"title": "Pickup Instructions",
"text": "Please follow the signs to the rental car area."
}
]
},
"dropoff_date": "2024-01-20",
"driver": {
"user_id": "icu_0000B0nwceAOyWuOF3pz1M",
"phone_number": "+441234567890",
"given_name": "Amelia",
"family_name": "Earheart",
"email": "[email protected]",
"date_of_birth": "1990-01-01"
},
"confirmed_at": "2022-12-20T15:45:01.000000Z",
"conditions": [
{
"title": "Cancellation Policy",
"text": "Free cancellation up to 24 hours before pickup."
}
],
"charges": [
{
"amount": "5.00",
"currency": "GBP",
"description": "Insurance fee"
}
],
"car": {
"type": "four_door",
"transmission": "automatic",
"name": "Kia Picanto",
"max_passengers": 5,
"images": [
{
"url": "https://car.com/kia_picanto.jpg"
}
],
"fuel": "petrol",
"code": "CDAV",
"category": "compact",
"baggage": {
"small": 2,
"large": 3
},
"air_conditioning": true
},
"base_currency": "GBP",
"base_amount": "95.22"
}
}