Sample - Stripe API
POST/v1/quotes

Create a 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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

21 body fields
application_fee_amountintegeroptional
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_percentnumberoptional
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_taxobjectoptional
Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
collection_methodstringoptional
Either `charge_automatically`, or `send_invoice`. 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 as `active`. Defaults to `charge_automatically`.
Allowed:charge_automaticallysend_invoice
customerstringoptional
The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
customer_accountstringoptional
The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
default_tax_ratesarray<string>optional
The tax rates that will apply to any line item that does not have `tax_rates` set.
descriptionstringoptional
A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
discountsarray<DiscountsDataParam>optional
The discounts applied to the quote.
expandarray<string>optional
Specifies which fields in the response should be expanded.
expires_atintegeroptional
A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
footerstringoptional
A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
from_quoteobjectoptional
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`.
headerstringoptional
A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
invoice_settingsobjectoptional
All invoices will be billed using the specified settings.
line_itemsarray<LineItemCreateParams>optional
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.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) 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`.
on_behalf_ofstringoptional
The account on behalf of which to charge.
subscription_dataobjectoptional
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.
test_clockstringoptional
ID of the test clock to attach to the quote.
transfer_dataobjectoptional
The data with which to automatically create a Transfer for each of the invoices.

2 status codes
200Successful response.
amount_subtotalintegerrequired
Total before any discounts or taxes are applied.
amount_totalintegerrequired
Total after discounts and taxes are applied.
applicationstringoptional
ID of the Connect Application that created the quote.
application_fee_amountintegeroptional
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.
application_fee_percentnumberoptional
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. Only applicable if there are line items with recurring prices on the quote.
automatic_taxobjectrequired
collection_methodstringrequired
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`.
Allowed:charge_automaticallysend_invoice
computedobjectrequired
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
currencystringoptional
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customerstringoptional
The customer who received this quote. A customer is required to finalize the quote. Once specified, you can't change it.
customer_accountstringoptional
The account representing the customer who received this quote. A customer or account is required to finalize the quote. Once specified, you can't change it.
default_tax_ratesarray<string>optional
The tax rates applied to this quote.
descriptionstringoptional
A description that will be displayed on the quote PDF.
discountsarray<string>required
The discounts applied to this quote.
expires_atintegerrequired
The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
footerstringoptional
A footer that will be displayed on the quote PDF.
from_quoteobjectoptional
Details of the quote that was cloned. See the [cloning documentation](https://docs.stripe.com/quotes/clone) for more details.
headerstringoptional
A header that will be displayed on the quote PDF.
idstringrequired
Unique identifier for the object.
invoicestringoptional
The invoice that was created from this quote.
invoice_settingsobjectrequired
line_itemsobjectoptional
A list of items the customer is being quoted for.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectrequired
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
numberstringoptional
A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://docs.stripe.com/quotes/overview#finalize).
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:quote
on_behalf_ofstringoptional
The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details.
statusstringrequired
The status of the quote.
Allowed:acceptedcanceleddraftopen
status_transitionsobjectrequired
subscriptionstringoptional
The subscription that was created or updated from this quote.
subscription_dataobjectrequired
subscription_schedulestringoptional
The subscription schedule that was created or updated from this quote.
test_clockstringoptional
ID of the test clock this quote belongs to.
total_detailsobjectrequired
transfer_dataobjectoptional
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.
defaultError response.
errorobjectrequired

Error handling

Any other status is an error: Error response.