Migrating API Version from v1 to v2
Refresher on API versions
Every request to Duffel's API must have the version specified. This determines the requests, responses, and overall behaviour. Over time we improve our API. Generally this doesn't require migration. When it does, we provide a migration guide, such as this document. You can read more about how we do versioning in our API reference.
From v1 to v2
Migration requires changing the Duffel-Version header in your requests from Duffel-Version: v1 to Duffel-Version: v2.
Listed below are the breaking changes to v2.
Flights Order airline-initiated changes (AIC)
Conditions are an object instead of a list
added.conditions and removed.conditions on airline-initiated changes were previously lists and are now objects, to match Order slice conditions.
Pared down webhook event payload
order.airline_initiated_change_detected event data no longer includes the changes field. Use data.object.id to get more information by listing the AICs for the order and finding the one matching data.object.aic_id.
Flights Order cancellation can have null amount and currency
Order cancellationrefund_amount and refund_currency can be null in cases where the refund amount is unknown. This only applies in cases where we are unable to get a refund quote from the carrier, and does not apply to any of the carriers where cancellation is supported in v1.
Previously deprecated fields have been removed
Flights Offer
accepted_loyalty_programmesremoved in favour ofsupported_loyalty_programmesallowed_passenger_identity_document_typesremoved in favour ofsupported_passenger_identity_document_types
Go to offer schema on v2 API reference
Flights Create Order
passengers.typeremoved
Go to order creation on v2 API reference
Flights Order
slices.changeableremoved in favour of the top-levelavailable_actionsslices.segments.arrival_datetimeremoved in favour ofslices.segments.arriving_atslices.segments.arrival_terminalremoved in favour ofslices.segments.destination_terminalslices.segments.departure_datetimeremoved in favour ofslices.segments.departing_atslices.segments.departure_terminalremoved in favour ofslices.segments.origin_terminal
Go to order schema on v2 API reference
Caution
If you have used card payment in a previous version of the API, please consult the API documentation carefully for changes in behaviour. Especially with regards to the new response codes documented here.
Stays Accommodation
cheapest_rate_currencyremoved from the Accommodation and moved to Search Resultcheapest_rate_total_amountremoved from the Accommodation and moved to Search Result
Go to accommodation schema on v2 API reference
Stays Booking
key_collectionremoved from Booking and moved to Accommodation
Go to booking schema on v2 API reference
Stays Quote
adultsremoved in favour ofguestscard_component_keyremoved in favour of the/identity/component_client_keysendpoint
Go to quote schema on v2 API reference
Stays Rate
payment_methodremoved in favour ofavailable_payment_methods
Go to rate schema on v2 API reference
Stays Search Request
adultsremoved in favour ofguests
Go to search request schema on v2 API reference
Stays Search Result
adultsremoved in favour ofguests
Go to search result schema on v2 API reference
Cards Request
saveremoved in favour ofmulti_use
Cards Response
savedremoved in favour ofmulti_use
Places Suggestion
nameremoved in favour ofquery