View Source Stripe.Quote (Striped v0.5.0) (generated)

A Quote is a way to model prices that you'd like to provide to a customer. Once accepted, it will automatically create an invoice, subscription or subscription schedule.

Link to this section Summary

Types

Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.

Clone an existing quote. The new quote will be created in status=draft. When using this parameter, you cannot specify any other parameters except for expires_at.

All invoices will be billed using the specified settings.

Data used to generate a new Price object inline. One of price or price_data is required.

The recurring components of a price such as interval and interval_count.

When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if subscription_data[effective_date] is present and in the future, otherwise a subscription is created.

t()

The quote type.

Functions

A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the quote template.

Returns a list of your quotes.

When retrieving a quote, there is an includable computed.upfront.line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.

When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

Download the PDF for a finalized quot.

Retrieves the quote with the given ID.

A quote models prices and services for a customer.

Link to this section Types

@type automatic_tax() :: %{optional(:enabled) => boolean()}

Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.

@type discounts() :: %{optional(:coupon) => binary(), optional(:discount) => binary()}
@type from_quote() :: %{
  optional(:is_revision) => boolean(),
  optional(:quote) => binary()
}

Clone an existing quote. The new quote will be created in status=draft. When using this parameter, you cannot specify any other parameters except for expires_at.

@type invoice_settings() :: %{optional(:days_until_due) => integer()}

All invoices will be billed using the specified settings.

@type line_items() :: %{
  optional(:price) => binary(),
  optional(:price_data) => price_data(),
  optional(:quantity) => integer(),
  optional(:tax_rates) => [binary()] | binary()
}
@type price_data() :: %{
  optional(:currency) => binary(),
  optional(:product) => binary(),
  optional(:recurring) => recurring(),
  optional(:tax_behavior) => :exclusive | :inclusive | :unspecified,
  optional(:unit_amount) => integer(),
  optional(:unit_amount_decimal) => binary()
}

Data used to generate a new Price object inline. One of price or price_data is required.

@type recurring() :: %{
  optional(:interval) => :day | :month | :week | :year,
  optional(:interval_count) => integer()
}

The recurring components of a price such as interval and interval_count.

@type subscription_data() :: %{
  optional(:description) => binary(),
  optional(:effective_date) => :current_period_end | integer() | binary(),
  optional(:trial_period_days) => integer() | binary()
}

When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if subscription_data[effective_date] is present and in the future, otherwise a subscription is created.

@type t() :: %Stripe.Quote{
  amount_subtotal: integer(),
  amount_total: integer(),
  application: (binary() | term() | term()) | nil,
  application_fee_amount: integer() | nil,
  application_fee_percent: term() | nil,
  automatic_tax: term(),
  collection_method: binary(),
  computed: term(),
  created: integer(),
  currency: binary() | nil,
  customer: (binary() | Stripe.Customer.t() | Stripe.DeletedCustomer.t()) | nil,
  default_tax_rates: term(),
  description: binary() | nil,
  discounts: term(),
  expires_at: integer(),
  footer: binary() | nil,
  from_quote: term() | nil,
  header: binary() | nil,
  id: binary(),
  invoice: (binary() | Stripe.Invoice.t() | Stripe.DeletedInvoice.t()) | nil,
  invoice_settings: term() | nil,
  line_items: term(),
  livemode: boolean(),
  metadata: term(),
  number: binary() | nil,
  object: binary(),
  on_behalf_of: (binary() | Stripe.Account.t()) | nil,
  status: binary(),
  status_transitions: term(),
  subscription: (binary() | Stripe.Subscription.t()) | nil,
  subscription_data: term(),
  subscription_schedule: (binary() | Stripe.SubscriptionSchedule.t()) | nil,
  test_clock: (binary() | Stripe.TestHelpers.TestClock.t()) | nil,
  total_details: term(),
  transfer_data: term() | nil
}

The quote type.

  • application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote.
  • computed
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as active. Defaults to charge_automatically.
  • line_items A list of items the customer is being quoted for.
  • metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  • subscription_data
  • description A description that will be displayed on the quote PDF.
  • footer A footer that will be displayed on the quote PDF.
  • header A header that will be displayed on the quote PDF.
  • subscription_schedule The subscription schedule that was created or updated from this quote.
  • on_behalf_of The account on behalf of which to charge. See the Connect documentation for details.
  • customer The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
  • invoice The invoice that was created from this quote.
  • application ID of the Connect Application that created the quote.
  • object String representing the object's type. Objects of the same type share the same value.
  • invoice_settings All invoices will be billed using the specified settings.
  • total_details
  • expires_at The date on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch.
  • status_transitions
  • test_clock ID of the test clock this quote belongs to.
  • automatic_tax
  • currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • discounts The discounts applied to this quote.
  • amount_subtotal Total before any discounts or taxes are applied.
  • amount_total Total after discounts and taxes are applied.
  • subscription The subscription that was created or updated from this quote.
  • status The status of the quote.
  • from_quote Details of the quote that was cloned. See the cloning documentation for more details.
  • number A unique number that identifies this particular quote. This number is assigned once the quote is finalized.
  • application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote.
  • transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices.
  • id Unique identifier for the object.
  • default_tax_rates The tax rates applied to this quote.
@type transfer_data() :: %{
  optional(:amount) => integer(),
  optional(:amount_percent) => number(),
  optional(:destination) => binary()
}

Link to this section Functions

Link to this function

accept(client, quote, params \\ %{}, opts \\ [])

View Source
@spec accept(
  client :: Stripe.t(),
  quote :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Accepts the specified quote.

Details

  • Method: post
  • Path: /v1/quotes/{quote}/accept
Link to this function

cancel(client, quote, params \\ %{}, opts \\ [])

View Source
@spec cancel(
  client :: Stripe.t(),
  quote :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Cancels the quote.

Details

  • Method: post
  • Path: /v1/quotes/{quote}/cancel
Link to this function

create(client, params \\ %{}, opts \\ [])

View Source
@spec create(
  client :: Stripe.t(),
  params :: %{
    optional(:application_fee_amount) => integer() | binary(),
    optional(:application_fee_percent) => number() | binary(),
    optional(:automatic_tax) => automatic_tax(),
    optional(:collection_method) => :charge_automatically | :send_invoice,
    optional(:customer) => binary(),
    optional(:default_tax_rates) => [binary()] | binary(),
    optional(:description) => binary(),
    optional(:discounts) => [discounts()] | binary(),
    optional(:expand) => [binary()],
    optional(:expires_at) => integer(),
    optional(:footer) => binary(),
    optional(:from_quote) => from_quote(),
    optional(:header) => binary(),
    optional(:invoice_settings) => invoice_settings(),
    optional(:line_items) => [line_items()],
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:on_behalf_of) => binary() | binary(),
    optional(:subscription_data) => subscription_data(),
    optional(:test_clock) => binary(),
    optional(:transfer_data) => transfer_data() | binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the quote template.

Details

  • Method: post
  • Path: /v1/quotes
Link to this function

finalize_quote(client, quote, params \\ %{}, opts \\ [])

View Source
@spec finalize_quote(
  client :: Stripe.t(),
  quote :: binary(),
  params :: %{
    optional(:expand) => [binary()],
    optional(:expires_at) => integer()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Finalizes the quote.

Details

  • Method: post
  • Path: /v1/quotes/{quote}/finalize
Link to this function

list(client, params \\ %{}, opts \\ [])

View Source
@spec list(
  client :: Stripe.t(),
  params :: %{
    optional(:customer) => binary(),
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:limit) => integer(),
    optional(:starting_after) => binary(),
    optional(:status) => :accepted | :canceled | :draft | :open,
    optional(:test_clock) => binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Returns a list of your quotes.

Details

  • Method: get
  • Path: /v1/quotes
Link to this function

list_computed_upfront_line_items(client, quote, params \\ %{}, opts \\ [])

View Source
@spec list_computed_upfront_line_items(
  client :: Stripe.t(),
  quote :: binary(),
  params :: %{
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:limit) => integer(),
    optional(:starting_after) => binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(Stripe.Item.t())}
  | {:error, Stripe.ApiErrors.t()}
  | {:error, term()}

When retrieving a quote, there is an includable computed.upfront.line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.

Details

  • Method: get
  • Path: /v1/quotes/{quote}/computed_upfront_line_items
Link to this function

list_line_items(client, quote, params \\ %{}, opts \\ [])

View Source
@spec list_line_items(
  client :: Stripe.t(),
  quote :: binary(),
  params :: %{
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:limit) => integer(),
    optional(:starting_after) => binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(Stripe.Item.t())}
  | {:error, Stripe.ApiErrors.t()}
  | {:error, term()}

When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

Details

  • Method: get
  • Path: /v1/quotes/{quote}/line_items
Link to this function

pdf(client, quote, params \\ %{}, opts \\ [])

View Source
@spec pdf(
  client :: Stripe.t(),
  quote :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, []} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Download the PDF for a finalized quot.

Details

  • Method: get
  • Path: /v1/quotes/{quote}/pdf
Link to this function

retrieve(client, quote, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  client :: Stripe.t(),
  quote :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves the quote with the given ID.

Details

  • Method: get
  • Path: /v1/quotes/{quote}
Link to this function

update(client, quote, params \\ %{}, opts \\ [])

View Source
@spec update(
  client :: Stripe.t(),
  quote :: binary(),
  params :: %{
    optional(:application_fee_amount) => integer() | binary(),
    optional(:application_fee_percent) => number() | binary(),
    optional(:automatic_tax) => automatic_tax(),
    optional(:collection_method) => :charge_automatically | :send_invoice,
    optional(:customer) => binary(),
    optional(:default_tax_rates) => [binary()] | binary(),
    optional(:description) => binary(),
    optional(:discounts) => [discounts()] | binary(),
    optional(:expand) => [binary()],
    optional(:expires_at) => integer(),
    optional(:footer) => binary(),
    optional(:header) => binary(),
    optional(:invoice_settings) => invoice_settings(),
    optional(:line_items) => [line_items()],
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:on_behalf_of) => binary() | binary(),
    optional(:subscription_data) => subscription_data(),
    optional(:transfer_data) => transfer_data() | binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

A quote models prices and services for a customer.

Details

  • Method: post
  • Path: /v1/quotes/{quote}