Testing your Cars integration with Duffel Test Drive
Note
It can be difficult to find the right inventory to repeatedly and reliably simulate specific scenarios that are valuable to test before you release your product or a new feature.
Some examples:
How do you find and test a rate that either expires or gets booked by someone else?
How do I make sure I'm displaying all the required information to customers on a booking confirmation?
How can I ensure my logic for handling failure scenarios is working correctly?
To make your life easier, we have an example rental car supplier called “Duffel Test Drive”.
Accessing Duffel Test Drive
There are specific coordinates that must be used in order to find Duffel Test Drive rates.
The coordinates are: -24.38, -128.32 - a sample request is below.
JavaScript
duffel.cars.search({pickup_date: "2026-09-16",pickup_time: "10:00",dropoff_date: "2026-09-17",dropoff_time: "15:00",pickup_location: {radius: 1,geographic_coordinates: {latitude: -24.38,longitude: -128.32}},dropoff_location: {radius: 1,geographic_coordinates: {latitude: -24.38,longitude: -128.32}},driver: {age: 31,residence_country_code: "GB"}});
If your request is successful, you should see a number of rates returned which have a supplier named
Duffel Test Drive.Scenarios
Duffel Test Drive contains a number of scenarios that you can use to test your integration. There are some which will help you test some success or failure scenarios - either successful bookings for all payment types, or errors like
rate_unavailable or payment_declined.
The details on the scenario which the rate refers to are returned in the Car name.JSON
[{car: {name: "Successful Postpaid Booking",max_passengers: 5,transmission: "automatic",air_conditioning: true,fuel: "petrol",images: []baggage: { large: 3, small: 2 },category: "standard",type: "sport",code: "SSAV"},dropoff_location: {...},pickup_location: {...}payment_type: "postpaid",supplier: {logo_url: "https://example.com/logo.png",name: "Duffel Test Drive"},id: "rae_0000B49nObUBsHAG0v8vJy",...},{car: { name: "Rate Unavailable", ...},...}]
We also provide scenarios which simulate bookings which end up in an uncertain state and are later resolved via webhooks. This can help you ensure both that you are handling these response types for your customers, and that your webhook configuration is set up correctly.