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 cancellation refund_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_programmes removed in favour of supported_loyalty_programmes

  • allowed_passenger_identity_document_types removed in favour of supported_passenger_identity_document_types

Flights Create Order

  • passengers.type removed

Flights Order

  • slices.changeable removed in favour of the top-level available_actions

  • slices.segments.arrival_datetime removed in favour of slices.segments.arriving_at

  • slices.segments.arrival_terminal removed in favour of slices.segments.destination_terminal

  • slices.segments.departure_datetime removed in favour of slices.segments.departing_at

  • slices.segments.departure_terminal removed in favour of slices.segments.origin_terminal

Stays Accommodation

  • cheapest_rate_currency removed from the Accommodation and moved to Search Result

  • cheapest_rate_total_amount removed from the Accommodation and moved to Search Result

Stays Booking

Stays Quote

  • adults removed in favour of guests

  • card_component_key removed in favour of the /identity/component_client_keys endpoint

Stays Rate

  • payment_method removed in favour of available_payment_methods

Stays Search Request

  • adults removed in favour of guests

Stays Search Result

  • adults removed in favour of guests

Cards Request

  • save removed in favour of multi_use

Cards Response

  • saved removed in favour of multi_use

Places Suggestion

  • name removed in favour of query