Update a quote 

Billing
Quote
Update a quote

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 or price_data is required.

    • line_items.price_datahash

      Data used to generate a new Price object inline. One of price or price_data is required.

      • line_items.price_data.currencyenumRequired

        Three-letter ISO currency code, in lowercase. Must be a supported currency.

      • line_items.price_data.productstringRequired

        The ID of the Product that this Price will belong to.

      • line_items.price_data.recurringhash

        The recurring components of a price such as interval and interval_count.

        • line_items.price_data.recurring.intervalenumRequired

          Specifies billing frequency. Either day, week, month or year.

          Possible enum values
          day
          month
          week
          year
        • line_items.price_data.recurring.interval_countinteger

          The number of intervals between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).

      • 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, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed.

        Possible enum values
        exclusive
        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_amount, but accepts a decimal value in cents with at most 12 decimal places. Only one of unit_amount and unit_amount_decimal can be set.

    • 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_tax_rates on the quote do not apply to this line item.

  • 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 values
        account

        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 is account.

  • collection_methodenum

    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.

    Possible enum values
    charge_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_rates set.

  • 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 or draft status. Measured in seconds since the Unix epoch.

  • footerstring

    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 where collection_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 values
        account

        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 is account.

  • 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_data[effective_date] is present and in the future, otherwise a subscription is created.

    • 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_date is ignored if it is in the past when the quote is accepted.

    • 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_items, this field will be passed to the resulting subscription’s metadata field. If subscription_data.effective_date is used, this field will be passed to the resulting subscription schedule’s phases.metadata field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.

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

POST /v1/quotes/:id
Stripe.api_key = 'sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2'
quote = Stripe::Quote.update(
'qt_1Mr7wVLkdIwHu7ixJYSiPTGq',
{metadata: {order_id: '6735'}},
)
Response
{
"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
}