View Source Stripe.Quote (Striped v0.1.0)

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

t()

The quote type.

Functions

Accepts the specified quote.

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 quote

Retrieves the quote with the given ID.

A quote models prices and services for a customer.

Link to this section Types

@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. 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.

Link to this section Functions

Link to this function

accept(client, quote, params \\ %{})

View Source
@spec accept(client :: term(), quote :: binary(), params :: map()) ::
  {: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 \\ %{})

View Source
@spec cancel(client :: term(), quote :: binary(), params :: map()) ::
  {: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 \\ %{})

View Source
@spec create(client :: term(), params :: map()) ::
  {: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 \\ %{})

View Source
@spec finalize_quote(client :: term(), quote :: binary(), params :: map()) ::
  {: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 \\ %{})

View Source
@spec list(client :: term(), params :: map()) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Returns a list of your quotes.

Details

  • Method: get
  • Path: /v1/quotes

Query parameters

  • :customer string
  • :ending_before string
  • :expand array of: string
  • :limit integer
  • :starting_after string
  • :status string
  • :test_clock string
Link to this function

list_computed_upfront_line_items(client, quote, params \\ %{})

View Source
@spec list_computed_upfront_line_items(
  client :: term(),
  quote :: binary(),
  params :: map()
) ::
  {: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

Query parameters

  • :ending_before string
  • :expand array of: string
  • :limit integer
  • :starting_after string
Link to this function

list_line_items(client, quote, params \\ %{})

View Source
@spec list_line_items(client :: term(), quote :: binary(), params :: map()) ::
  {: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

Query parameters

  • :ending_before string
  • :expand array of: string
  • :limit integer
  • :starting_after string
Link to this function

pdf(client, quote, params \\ %{})

View Source
@spec pdf(client :: term(), quote :: binary(), params :: map()) ::
  {:ok, []} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Download the PDF for a finalized quote

Details

  • Method: get
  • Path: /v1/quotes/{quote}/pdf

Query parameters

  • :expand array of: string
Link to this function

retrieve(client, quote, params \\ %{})

View Source
@spec retrieve(client :: term(), quote :: binary(), params :: map()) ::
  {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves the quote with the given ID.

Details

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

Query parameters

  • :expand array of: string
Link to this function

update(client, quote, params \\ %{})

View Source
@spec update(client :: term(), quote :: binary(), params :: map()) ::
  {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

A quote models prices and services for a customer.

Details

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