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.
The quote type.
Functions
Accepts the specified quote.
Cancels the 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.
Finalizes the quote.
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.
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_percentA 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.computedlivemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.collection_methodEithercharge_automatically, orsend_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 asactive. Defaults tocharge_automatically.line_itemsA list of items the customer is being quoted for.metadataSet 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_datadescriptionA description that will be displayed on the quote PDF.footerA footer that will be displayed on the quote PDF.headerA header that will be displayed on the quote PDF.subscription_scheduleThe subscription schedule that was created or updated from this quote.on_behalf_ofThe account on behalf of which to charge. See the Connect documentation for details.customerThe customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.invoiceThe invoice that was created from this quote.applicationID of the Connect Application that created the quote.objectString representing the object's type. Objects of the same type share the same value.invoice_settingsAll invoices will be billed using the specified settings.total_detailsexpires_atThe date on which the quote will be canceled if inopenordraftstatus. Measured in seconds since the Unix epoch.status_transitionstest_clockID of the test clock this quote belongs to.automatic_taxcurrencyThree-letter ISO currency code, in lowercase. Must be a supported currency.createdTime at which the object was created. Measured in seconds since the Unix epoch.discountsThe discounts applied to this quote.amount_subtotalTotal before any discounts or taxes are applied.amount_totalTotal after discounts and taxes are applied.subscriptionThe subscription that was created or updated from this quote.statusThe status of the quote.from_quoteDetails of the quote that was cloned. See the cloning documentation for more details.numberA unique number that identifies this particular quote. This number is assigned once the quote is finalized.application_fee_amountThe 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_dataThe 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.idUnique identifier for the object.default_tax_ratesThe tax rates applied to this quote.
Link to this section Functions
@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
@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
@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
@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
@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
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
@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
@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
@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}
@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}