Getting Started with Cars

This guide takes you through the process of integrating with the Duffel Cars API, which connects you with 40+ car rental brands across 40,000 locations worldwide.
Before you can get started with this guide, you'll need to:
  • Sign up for a Duffel account (it takes about 1 minute!)

  • Request access to Duffel Cars

  • On the navigation header, click on "More", then navigate to "Developers"

  • Create a test access token from the "Access tokens" page in your Dashboard

Refer to our “Making requests” section to set up the appropriate headers to make requests.
To make it easy to build your integration, we updated our JavaScript client library to support Cars.
If you aren't using JavaScript, you can follow along with curl in your terminal, script the flow using your preferred programming language, or use the API via an HTTP client like Postman.
The core Duffel Cars booking flow is simple. Search → Quote → Book. Each step returns an ID, or a set of IDs you can choose from to move to the next step.

1. Search for available rates

The first step on your car rental journey is to create a search.
To create your search, you’ll need to provide the following information:
  • The location and date/time you wish to pick your car up. The location is a latitude and longitude with a radius.

  • The location and date/time you wish to drop your car off. If you are picking up and dropping off at the same location, you can provide the same location again.

  • Some information about the main driver of the car - namely their age on the date of pickup and country of residence. The driver information can affect the pricing and availability of rates which are returned (for example, some suppliers do not allow drivers under a certain age, and some will add a young driver surcharge), so these are required.

JavaScript

duffel.cars.search({
pickup_date: "2026-09-05",
pickup_time: "16:00",
dropoff_date: "2026-09-13",
dropoff_time: "10:00",
pickup_location: {
radius: 1,
geographic_coordinates: {
latitude: 51.470020,
longitude: -0.454295
}
},
dropoff_location: {
radius: 1,
geographic_coordinates: {
latitude: 51.470020,
longitude: -0.454295
}
},
driver: {
age: 30,
residence_country_code: "GB"
}
})
The Search endpoint will return the details of the search you just made, along with all of the rates which were found that match your search.
Each rate has details of a specific car, or category of car (e.g. SUV), along with details of the pricing, conditions of rental and the location/s at which the car will be picked up and dropped off.
There are three ways that a rate can be paid for:
  • prepaid - These rates are paid for in full when creating a booking. These rates often come at a discount compared to postpaid or guarantee rates, but are commonly non-refundable, or only cancellable for a penalty.

  • guarantee - These rates are paid entirely at the counter, but payment card details are required to reserve the car. No charge is made during the booking flow, but a penalty may be due in the case of a late cancellation or no-show.

  • postpaid - These rates are paid entirely at the counter. No card details are required to book these rates. This is the most common scenario when booking a rental car.

When your customer has decided on the rate that they are interested in, you can proceed to the next stage of the flow.

2. Create a quote for your selected rate

Before creating a booking for the rate you have chosen, you will need to create a quote using the quote creation endpoint
The final price on the quote can differ from the price presented on the rate, so it is important that you display the quote pricing to your customers on your checkout page, rather than using the rate pricing.

JavaScript

duffel.cars.quotes.create({
rate_id: "rae_0000B49nObUBsHAG0v8vJy"
})
Quoting a rate does a final check on the pricing and availability of the rate prior to purchase. We will also fetch further information about the rate, such as the terms and conditions.
To ensure your customer has all the necessary information about the rental car they are about to book, you must ensure the following information from the quote is displayed on your checkout page.
Required Checkout fields

Required Checkout fields

2. Create a booking

The final stage is to create a booking using the quote you have created in the previous step. This is done using the booking creation endpoint.
When creating a booking, you must supply at least the quote ID and the driver’s details.

JavaScript

duffel.cars.bookings.create({
quote_id: "qut_0000B49nObUBsHAG0v8vJy",
driver: [
{
given_name: "Amelia",
family_name: "Earhart",
date_of_birth: "1987-07-24",
phone_number: "+44777123123"
}
]
})
Once the booking has been created, you will receive a response confirming this, plus any additional booking information.
To make sure your customer has everything they need to ensure their rental goes smoothly, we require that you show all the same fields as shown on the checkout page, with the addition of
  • The booking reference - booking.reference

  • The booking driver’s name - booking.driver.given_name + booking.driver.family_name

  • The date the booking was confirmed - booking.confirmed_at

  • The phone number of the pickup and drop off locations, if present - booking.pickup_location.phone_number

That’s it! Amelia’s car is now booked.
The booking details can be retrieved any time by its id using the get booking endpoint.