Travel.Flights.PartialOfferRequests (travel v0.2.0)

Copy Markdown View Source

Multi-step search partial offer requests.

Endpoints

  • POST /air/partial_offer_requests - Create a partial offer request
  • GET /air/partial_offer_requests/{id} - Get a partial offer request
  • GET /air/partial_offer_requests/{id}/fares - Get fares by ID

Examples

# Create a partial offer request
{:ok, response} = Travel.Flights.PartialOfferRequests.create(%{
  slices: [%{origin: "LHR", destination: "JFK", departure_date: "2025-06-01"}],
  passengers: [%{type: "adult"}]
})

# Get with selected partial offers
{:ok, response} = Travel.Flights.PartialOfferRequests.get("por_123", %{
  selected_partial_offer: ["off_123"]
})

@link https://duffel.com/docs/api/partial-offer-requests

Summary

Functions

Create a partial offer request.

Get a partial offer request by ID.

Get fares matching selected partial offers.

Functions

create(params, opts \\ nil)

@spec create(map(), map() | nil) ::
  {:ok, Travel.Types.DuffelResponse.t()} | {:error, Travel.Error.t() | term()}

Create a partial offer request.

Parameters

  • params - Partial offer request parameters
  • opts - Optional query parameters (supplier_timeout)

Returns

  • {:ok, %Travel.Types.DuffelResponse{data: %Types.OfferRequest{}}} on success
  • {:error, %Travel.Error{}} on failure

get(partial_offer_request_id, opts \\ nil)

This function is deprecated. This endpoint will be removed in the next major version of the Duffel API.
@spec get(String.t(), map() | nil) ::
  {:ok, Travel.Types.DuffelResponse.t()} | {:error, Travel.Error.t() | term()}

Get a partial offer request by ID.

DEPRECATED: This endpoint will be removed in the next major version of the Duffel API.

Parameters

  • partial_offer_request_id - The partial offer request ID
  • opts - Optional query parameters (selected_partial_offer)

Returns

  • {:ok, %Travel.Types.DuffelResponse{data: %Types.OfferRequest{}}} on success
  • {:error, %Travel.Error{}} on failure

get_fares_by_id(partial_offer_request_id, opts \\ nil)

This function is deprecated. This endpoint will be removed in the next major version of the Duffel API.
@spec get_fares_by_id(String.t(), map() | nil) ::
  {:ok, Travel.Types.DuffelResponse.t()} | {:error, Travel.Error.t() | term()}

Get fares matching selected partial offers.

DEPRECATED: This endpoint will be removed in the next major version of the Duffel API.

Parameters

  • partial_offer_request_id - The partial offer request ID
  • opts - Optional query parameters (selected_partial_offer)

Returns

  • {:ok, %Travel.Types.DuffelResponse{data: %Types.OfferRequest{}}} on success
  • {:error, %Travel.Error{}} on failure