Skip to content

Stripe: Create a quote

Stripe quotes.postQuotes: arguments, response, policy and SDK examples.

← Quotes operations · Get started

Operation stripe.postquotes

Provider route: POST /v1/quotes. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["quotes"]["postQuotes"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.quotes.postQuotes(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.quotes.post_quotes(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.application_fee_amountJSONOptionalThe 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.
body.application_fee_amount (anyOf 1)integerAlternative
body.application_fee_amount (anyOf 2)stringAlternativeOne of:
body.application_fee_percentJSONOptionalA 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.
body.application_fee_percent (anyOf 1)numberAlternative
body.application_fee_percent (anyOf 2)stringAlternativeOne of:
body.automatic_taxobjectOptionalSettings for automatic tax lookup for this quote and resulting invoices and subscriptions.
body.automatic_tax.enabledbooleanRequired within parent
body.automatic_tax.liabilityobjectOptional
body.automatic_tax.liability.accountstringOptional
body.automatic_tax.liability.typestringRequired within parentOne of: account, self
body.collection_methodstringOptionalEither `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`.
One of: charge_automatically, send_invoice
body.customerstringOptionalThe customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
Maximum length: 5000
body.customer_accountstringOptionalThe account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
Maximum length: 5000
body.default_tax_ratesJSONOptionalThe tax rates that will apply to any line item that does not have `tax_rates` set.
body.default_tax_rates (anyOf 1)arrayAlternative
body.default_tax_rates (anyOf 1)[]stringEach itemMaximum length: 5000
body.default_tax_rates (anyOf 2)stringAlternativeOne of:
body.descriptionJSONOptionalA 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.
body.description (anyOf 1)stringAlternativeMaximum length: 500
body.description (anyOf 2)stringAlternativeOne of:
body.discountsJSONOptionalThe discounts applied to the quote.
body.discounts (anyOf 1)arrayAlternative
body.discounts (anyOf 1)[]objectEach item
body.discounts (anyOf 1)[].couponstringOptionalMaximum length: 5000
body.discounts (anyOf 1)[].discountstringOptionalMaximum length: 5000
body.discounts (anyOf 1)[].promotion_codestringOptionalMaximum length: 5000
body.discounts (anyOf 2)stringAlternativeOne of:
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.expires_atintegerOptionalA 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.
Format: unix-time
body.footerJSONOptionalA 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.
body.footer (anyOf 1)stringAlternativeMaximum length: 500
body.footer (anyOf 2)stringAlternativeOne of:
body.from_quoteobjectOptionalClone 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`.
body.from_quote.is_revisionbooleanOptional
body.from_quote.quotestringRequired within parentMaximum length: 5000
body.headerJSONOptionalA 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.
body.header (anyOf 1)stringAlternativeMaximum length: 50
body.header (anyOf 2)stringAlternativeOne of:
body.invoice_settingsModelOptionalExpand Create a quote — request body — body invoice settings
body.line_itemsarrayOptionalA list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
body.line_items[]objectEach item
body.line_items[].discountsJSONOptional
body.line_items[].discounts (anyOf 1)arrayAlternative
body.line_items[].discounts (anyOf 1)[]objectEach item
body.line_items[].discounts (anyOf 1)[].couponstringOptionalMaximum length: 5000
body.line_items[].discounts (anyOf 1)[].discountstringOptionalMaximum length: 5000
body.line_items[].discounts (anyOf 1)[].promotion_codestringOptionalMaximum length: 5000
body.line_items[].discounts (anyOf 2)stringAlternativeOne of:
body.line_items[].pricestringOptionalMaximum length: 5000
body.line_items[].price_dataModelOptionalExpand Create a quote — request body — body line items item price data
body.line_items[].quantityintegerOptional
body.line_items[].tax_ratesJSONOptional
body.line_items[].tax_rates (anyOf 1)arrayAlternative
body.line_items[].tax_rates (anyOf 1)[]stringEach itemMaximum length: 5000
body.line_items[].tax_rates (anyOf 2)stringAlternativeOne of:
body.metadataobjectOptionalSet 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`.
Additional keys: see wildcard field
body.metadata.*stringAdditional keys
body.on_behalf_ofJSONOptionalThe account on behalf of which to charge.
body.on_behalf_of (anyOf 1)stringAlternative
body.on_behalf_of (anyOf 2)stringAlternativeOne of:
body.subscription_dataobjectOptionalWhen 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.
body.subscription_data.billing_modeobjectOptional
body.subscription_data.billing_mode.flexibleobjectOptional
body.subscription_data.billing_mode.flexible.proration_discountsstringOptionalOne of: included, itemized
body.subscription_data.billing_mode.typestringRequired within parentOne of: classic, flexible
body.subscription_data.descriptionstringOptionalMaximum length: 500
body.subscription_data.effective_dateJSONOptional
body.subscription_data.effective_date (anyOf 1)stringAlternativeOne of: current_period_end
Maximum length: 5000
body.subscription_data.effective_date (anyOf 2)integerAlternativeFormat: unix-time
body.subscription_data.effective_date (anyOf 3)stringAlternativeOne of:
body.subscription_data.metadataobjectOptionalAdditional keys: see wildcard field
body.subscription_data.metadata.*stringAdditional keys
body.subscription_data.trial_period_daysJSONOptional
body.subscription_data.trial_period_days (anyOf 1)integerAlternative
body.subscription_data.trial_period_days (anyOf 2)stringAlternativeOne of:
body.test_clockstringOptionalID of the test clock to attach to the quote.
Maximum length: 5000
body.transfer_dataJSONOptionalThe data with which to automatically create a Transfer for each of the invoices.
body.transfer_data (anyOf 1)objectAlternative
body.transfer_data (anyOf 1).amountintegerOptional
body.transfer_data (anyOf 1).amount_percentnumberOptional
body.transfer_data (anyOf 1).destinationstringRequired within parent
body.transfer_data (anyOf 2)stringAlternativeOne of:

Referenced models: Create a quote — request body — body invoice settings, Create a quote — request body — body line items item price data

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Accept a quote — response body

Referenced models: Accept a quote — response body

719 more schemas are linked from the tables above, on the schema pages.

Create a quote — request body — body invoice settings
FieldTypePresenceDescription and constraints
$objectRootAll invoices will be billed using the specified settings.
custom_fieldsJSONOptional
custom_fields (anyOf 1)arrayAlternative
custom_fields (anyOf 1)[]objectEach item
custom_fields (anyOf 1)[].namestringRequired within parentMaximum length: 40
custom_fields (anyOf 1)[].valuestringRequired within parentMaximum length: 140
custom_fields (anyOf 2)stringAlternativeOne of:
days_until_dueintegerOptional
descriptionJSONOptional
description (anyOf 1)stringAlternativeMaximum length: 500
description (anyOf 2)stringAlternativeOne of:
footerJSONOptional
footer (anyOf 1)stringAlternativeMaximum length: 5000
footer (anyOf 2)stringAlternativeOne of:
issuerobjectOptional
issuer.accountstringOptional
issuer.typestringRequired within parentOne of: account, self
Create a quote — request body — body line items item price data
FieldTypePresenceDescription and constraints
$objectRoot
currencystringRequired within parentFormat: currency
productstringRequired within parentMaximum length: 5000
recurringobjectOptional
recurring.intervalstringRequired within parentOne of: day, month, week, year
recurring.interval_countintegerOptional
tax_behaviorstringOptionalOne of: exclusive, inclusive, unspecified
unit_amountintegerOptional
unit_amount_decimalstringOptionalFormat: decimal
PostApplicationFeesIdRefund — response body — application / object: application
FieldTypePresenceDescription and constraints
$objectRoot
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
nameJSONOptional
name (anyOf 1)stringAlternativeThe name of the application.
Maximum length: 5000
name (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: application
Accept a quote — response body — application / value / deleted: True, object: application
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
nameJSONOptional
name (anyOf 1)stringAlternativeThe name of the application.
Maximum length: 5000
name (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: application
Delete a customer — response body
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: customer
Delete a draft invoice — response body
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: invoice
Get Customers Customer Discount — response body
FieldTypePresenceDescription and constraints
$objectRootA discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes).
It contains information about when the discount began, when it will end, and what it is applied to.

Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts)
checkout_sessionJSONOptional
checkout_session (anyOf 1)stringAlternativeThe Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Not present for subscription mode.
Maximum length: 5000
checkout_session (anyOf 2)nullAlternative
customerJSONOptional
customer (anyOf 1)JSONAlternativeThe ID of the customer associated with this discount.
customer (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
customer (anyOf 1) (anyOf 2)ModelAlternativeExpand Create a customer — response body
customer (anyOf 1) (anyOf 3)ModelAlternativeExpand Delete a customer — response body
customer (anyOf 2)nullAlternative
customer_accountJSONOptional
customer_account (anyOf 1)stringAlternativeThe ID of the account representing the customer associated with this discount.
Maximum length: 5000
customer_account (anyOf 2)nullAlternative
endJSONOptional
end (anyOf 1)JSONAlternative
end (anyOf 1) (anyOf 1)integerAlternativeIf the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null.
Format: unix-time
end (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
end (anyOf 2)nullAlternative
idstringRequired within parentThe ID of the discount object. Discounts can't be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array.
Maximum length: 5000
invoiceJSONOptional
invoice (anyOf 1)stringAlternativeThe invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
Maximum length: 5000
invoice (anyOf 2)nullAlternative
invoice_itemJSONOptional
invoice_item (anyOf 1)stringAlternativeThe invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.
Maximum length: 5000
invoice_item (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: discount
promotion_codeJSONOptional
promotion_code (anyOf 1)JSONAlternativeThe promotion code applied to create this discount.
promotion_code (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
promotion_code (anyOf 1) (anyOf 2)ModelAlternativeExpand Create a promotion code — response body
promotion_code (anyOf 2)nullAlternative
sourceModelRequired within parentExpand Get Customers Customer Discount — response body — source
startJSONRequired within parent
start (anyOf 1)integerAlternativeDate that the coupon was applied.
Format: unix-time
start (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
subscriptionJSONOptional
subscription (anyOf 1)stringAlternativeThe subscription that this coupon is applied to, if it is applied to a particular subscription.
Maximum length: 5000
subscription (anyOf 2)nullAlternative
subscription_itemJSONOptional
subscription_item (anyOf 1)stringAlternativeThe subscription item that this coupon is applied to, if it is applied to a particular subscription item.
Maximum length: 5000
subscription_item (anyOf 2)nullAlternative

Referenced models: Create a customer — response body, Delete a customer — response body, Get Customers Customer Discount — response body — source, Create a promotion code — response body

Accept a quote — response body — from quote value is revision, quote
FieldTypePresenceDescription and constraints
$objectRoot
is_revisionbooleanRequired within parentWhether this quote is a revision of a different quote.
quoteJSONRequired within parentThe quote that was cloned.
quote (anyOf 1)stringAlternativeMaximum length: 5000
quote (anyOf 2)ModelAlternativeExpand Accept a quote — response body

Referenced models: Accept a quote — response body

SDK function policy ID: stripe.postquotes. Catalog operation: PostQuotes. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.