Cancel orders in two steps: create a pending cancellation to see the refund amount, then confirm it.
Only the most recent pending cancellation for an order can be confirmed.
See the Duffel documentation.
Summary
Functions
Confirms a pending order cancellation. This actually cancels the order and cannot be undone.
Creates a pending order cancellation, returning the refund details.
Retrieves a single order cancellation by ID.
Lists one page of order cancellations.
Lazily streams all order cancellations across pages.
Functions
@spec confirm(Duffel.Client.t(), String.t()) :: {:ok, map()} | {:error, Duffel.Error.t()}
Confirms a pending order cancellation. This actually cancels the order and cannot be undone.
@spec create(Duffel.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, Duffel.Error.t()}
Creates a pending order cancellation, returning the refund details.
Examples
Duffel.OrderCancellations.create(client, %{order_id: "ord_123"})
@spec get(Duffel.Client.t(), String.t()) :: {:ok, map()} | {:error, Duffel.Error.t()}
Retrieves a single order cancellation by ID.
@spec list(Duffel.Client.t(), keyword() | map()) :: {:ok, Duffel.Page.t()} | {:error, Duffel.Error.t()}
Lists one page of order cancellations.
Parameters
:order_id- filter by order:limit/:after/:before- pagination (seeDuffel.Page)
@spec stream(Duffel.Client.t(), keyword() | map()) :: Enumerable.t()
Lazily streams all order cancellations across pages.
Takes the same parameters as list/2. Raises Duffel.Error if a page
request fails.