A quote models prices and services for a customer.
Parameters
- line_
itemsarray of hashes A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
- line_items.
discountsarray of hashes The discounts applied to this line item.
- line_items.
discounts. couponstring ID of the coupon to create a new discount for.
- line_items.
discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- line_items.
discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- line_items.
idstring The ID of an existing line item on the quote.
- line_items.
pricestring The ID of the price object. One of
price
orprice_
is required.data - line_items.
price_ datahash Data used to generate a new Price object inline. One of
price
orprice_
is required.data - line_items.
price_data. currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- line_items.
price_data. productstringRequired - line_items.
price_data. recurringhash The recurring components of a price such as
interval
andinterval_
.count - line_items.
price_data. recurring. intervalenumRequired Specifies billing frequency. Either
day
,week
,month
oryear
.Possible enum valuesday
month
week
year
- line_items.
price_data. recurring. interval_ countinteger The number of intervals between subscription billings. For example,
interval=month
andinterval_
bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).count=3
- line_items.
price_data. tax_ behaviorenumRecommended if calculating taxes Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
. Once specified as eitherinclusive
orexclusive
, it cannot be changed.Possible enum valuesexclusive
inclusive
unspecified
- line_items.
price_data. unit_ amountinteger A positive integer in cents (or 0 for a free price) representing how much to charge.
- line_items.
price_data. unit_ amount_ decimalstringRequired conditionally Same as
unit_
, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_
andamount unit_
can be set.amount_ decimal
- line_items.
quantityinteger The quantity of the line item.
- line_items.
tax_ ratesarray of strings The tax rates which apply to the line item. When set, the
default_
on the quote do not apply to this line item.tax_ rates
- metadatahash
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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
.
More parameters
- application_
fee_ amountintegerConnect only 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. There cannot be any line items with recurring prices when using this field.
- application_
fee_ percentfloatConnect only A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner’s Stripe account. There must be at least 1 line item with a recurring price to use this field.
- automatic_
taxhash Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
- automatic_tax.
enabledbooleanRequired Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
- automatic_tax.
liabilityhashConnect only The account that’s liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
- automatic_tax.
liability. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccount
Indicates that the account being referenced is a connected account which is different from the account making the API request but related to it.
self
Indicates that the account being referenced is the account making the API request.
- automatic_tax.
liability. accountstringRequired only if type is account The connected account being referenced when
type
isaccount
.
- collection_
methodenum Either
charge_
, orautomatically send_
. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice 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 asinvoice active
. Defaults tocharge_
.automatically Possible enum valuescharge_
automatically send_
invoice - customerstring
The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
- default_
tax_ ratesarray of strings The tax rates that will apply to any line item that does not have
tax_
set.rates - descriptionstring
A description that will be displayed on the quote PDF.
- discountsarray of hashes
The discounts applied to the quote.
- discounts.
couponstring ID of the coupon to create a new discount for.
- discounts.
discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- discounts.
promotion_ codestring ID of the promotion code to create a new discount for.
- expires_
attimestamp A future timestamp on which the quote will be canceled if in
open
ordraft
status. Measured in seconds since the Unix epoch. - string
A footer that will be displayed on the quote PDF.
- headerstring
A header that will be displayed on the quote PDF.
- invoice_
settingshash All invoices will be billed using the specified settings.
- invoice_settings.
days_ until_ dueinteger Number of days within which a customer must pay the invoice generated by this quote. This value will be
null
for quotes wherecollection_
.method=charge_ automatically - invoice_settings.
issuerhashConnect only The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
- invoice_settings.
issuer. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccount
Indicates that the account being referenced is a connected account which is different from the account making the API request but related to it.
self
Indicates that the account being referenced is the account making the API request.
- invoice_settings.
issuer. accountstringRequired only if type is account The connected account being referenced when
type
isaccount
.
- on_
behalf_ ofstringConnect only The account on behalf of which to charge.
- subscription_
datahash 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_
is present and in the future, otherwise a subscription is created.data[effective_ date] - subscription_data.
descriptionstring The subscription’s description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
- subscription_data.
effective_ datestring | timestamp When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The
effective_
is ignored if it is in the past when the quote is accepted.date - subscription_data.
metadatahash Set of key-value pairs that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in
line_
, this field will be passed to the resulting subscription’sitems metadata
field. Ifsubscription_
is used, this field will be passed to the resulting subscription schedule’sdata. effective_ date phases.
field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.metadata - subscription_data.
trial_ period_ daysinteger Integer representing the number of trial period days before the customer is charged for the first time.
- transfer_
datahashConnect only The data with which to automatically create a Transfer for each of the invoices.
- transfer_data.
destinationstringRequired ID of an existing, connected Stripe account.
- transfer_data.
amountinteger The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
- transfer_data.
amount_ percentfloat A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field.
Returns
Returns the updated quote object.
{ "id": "qt_1Mr7wVLkdIwHu7ixJYSiPTGq", "object": "quote", "amount_subtotal": 2198, "amount_total": 2198, "application": null, "application_fee_amount": null, "application_fee_percent": null, "automatic_tax": { "enabled": false, "liability": null, "status": null }, "collection_method": "charge_automatically", "computed": { "recurring": null, "upfront": { "amount_subtotal": 2198, "amount_total": 2198, "total_details": { "amount_discount": 0, "amount_shipping": 0, "amount_tax": 0 } } }, "created": 1680130691, "currency": "usd", "customer": "cus_NcMfB0SSFHINCV", "default_tax_rates": [], "description": null, "discounts": [], "expires_at": 1682722691, "footer": null, "from_quote": null, "header": null, "invoice": null, "invoice_settings": { "days_until_due": null, "issuer": { "type": "self" } }, "livemode": false, "metadata": { "order_id": "6735" }, "number": null, "on_behalf_of": null, "status": "draft", "status_transitions": { "accepted_at": null, "canceled_at": null, "finalized_at": null }, "subscription": null, "subscription_data": { "description": null, "effective_date": null, "trial_period_days": null }, "subscription_schedule": null, "test_clock": null, "total_details": { "amount_discount": 0, "amount_shipping": 0, "amount_tax": 0 }, "transfer_data": null}