Book a rental car from a quote, then retrieve or cancel the booking.
See the Duffel documentation.
Summary
Functions
@spec cancel(Duffel.Client.t(), String.t()) :: {:ok, map()} | {:error, Duffel.Error.t()}
Cancels a booking.
@spec create(Duffel.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, Duffel.Error.t()}
Creates a booking from a quote.
Options
:idempotency_key- value for theIdempotency-Keyheader. A key is generated when you do not pass one (seeDuffel.Client.post/4).
Examples
Duffel.Cars.Bookings.create(
client,
%{
quote_id: "quo_123",
driver: %{
given_name: "Amelia",
family_name: "Earhart",
email: "amelia@duffel.com",
phone_number: "+442080160508",
date_of_birth: "1897-07-24"
},
supplier_loyalty_programme_account_number: "12901014"
},
idempotency_key: "car-booking-1"
)
@spec get(Duffel.Client.t(), String.t()) :: {:ok, map()} | {:error, Duffel.Error.t()}
Retrieves a single booking by ID.