Travel.Stays.Quotes (travel v0.2.0)

Copy Markdown View Source

Create and retrieve quotes for stays.

Endpoints

  • POST /stays/quotes - Create a quote
  • GET /stays/quotes/{id} - Get a quote

Examples

# Create a quote from a rate
{:ok, response} = Travel.Stays.Quotes.create("rate_123")

# Get a quote by ID
{:ok, response} = Travel.Stays.Quotes.get("quo_123")

@link https://duffel.com/docs/api/stays/quotes

Summary

Functions

Create a quote for the selected rate.

Get a quote by ID.

Functions

create(rate_id)

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

Create a quote for the selected rate.

Parameters

  • rate_id - The ID of the rate to quote

Returns

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

get(quote_id)

@spec get(String.t()) ::
  {:ok, Travel.Types.DuffelResponse.t()} | {:error, Travel.Error.t() | term()}

Get a quote by ID.

Parameters

  • quote_id - The ID of the quote

Returns

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