Duffel.OrderChangeRequests (Duffel v0.1.0)

Copy Markdown View Source

Request changes to an existing order's slices.

The change flow: create an order change request describing slices to add/remove, pick from the resulting Duffel.OrderChangeOffers, then create and confirm a Duffel.OrderChanges.

See the Duffel documentation.

Summary

Functions

Creates an order change request.

Retrieves a single order change request by ID.

Functions

create(client, params, opts \\ [])

@spec create(Duffel.Client.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Duffel.Error.t()}

Creates an order change request.

Examples

Duffel.OrderChangeRequests.create(client, %{
  order_id: "ord_123",
  slices: %{
    remove: [%{slice_id: "sli_123"}],
    add: [
      %{
        origin: "LHR",
        destination: "JFK",
        departure_date: "2026-07-14",
        cabin_class: "economy"
      }
    ]
  }
})

get(client, id)

@spec get(Duffel.Client.t(), String.t()) :: {:ok, map()} | {:error, Duffel.Error.t()}

Retrieves a single order change request by ID.