POST
/v1/invoiceitems/{invoiceitem}Update an invoice item
Updates the amount, description, pricing, discounts, tax settings, or other supported fields of an invoice item on an upcoming invoice. You can update the item only before the invoice it is attached to is closed; use expand to expand selected response fields.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
invoiceitemstringrequired
The identifier of the invoice item to update. Maximum 5,000 characters.
Optional fields for updating an invoice item on an upcoming invoice.
amountintegeroptional
The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
descriptionstringoptional
An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
discountablebooleanoptional
Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations.
discountsarray<DiscountsDataParam>optional
The coupons, promotion codes & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
expandarray<string>optional
Specifies which fields in the response should be expanded.
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`.
periodobjectoptional
The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://docs.stripe.com/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://docs.stripe.com/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
price_dataobjectoptional
Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
pricingobjectoptional
The pricing information for the invoice item.
quantityintegeroptional
Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version.
quantity_decimalstringoptional
Non-negative decimal with at most 12 decimal places. The quantity of units for the line item.
tax_behaviorstringoptional
Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) 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.
tax_codestringoptional
A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
tax_ratesarray<string>optional
The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates.
unit_amount_decimalstringoptional
The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places.
200Returns the updated invoice item with its current amount, pricing, discounts, tax settings, and invoice association.
amountintegerrequired
Amount (in the `currency` specified) of the invoice item. This should always be equal to `unit_amount * quantity`.
currencystringrequired
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).
customerstringrequired
The ID of the customer to bill for this invoice item.
customer_accountstringoptional
The ID of the account to bill for this invoice item.
dateintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
descriptionstringoptional
An arbitrary string attached to the object. Often useful for displaying to users.
discountablebooleanrequired
If true, discounts will apply to this invoice item. Always false for prorations.
discountsarray<string>optional
The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
frozen_fieldsarray<string>optional
Array of field names that can't be modified. Attempting to update a frozen field returns an error.
idstringrequired
Unique identifier for the object.
invoicestringoptional
The ID of the invoice this invoice item belongs to.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
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.
net_amountintegeroptional
The amount after discounts, but before credits and taxes. This field is `null` for `discountable=true` items.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
parentobjectoptional
The parent that generated this invoice item.
periodobjectrequired
pricingobjectoptional
The pricing information of the invoice item.
prorationbooleanrequired
Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.
proration_detailsobjectoptional
quantityintegerrequired
Quantity of units for the invoice item in integer format, with any decimal precision truncated. For the item's full-precision decimal quantity, use `quantity_decimal`. This field will be deprecated in favor of `quantity_decimal` in a future version. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.
quantity_decimalstringrequired
Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item.
tax_ratesarray<TaxRate>optional
The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item.
test_clockstringoptional
ID of the test clock this invoice item belongs to.
defaultReturned when the request cannot be processed; the response contains an API error object with a required `type` field.
errorobjectrequired
Error handling
invoiceitem must be a string no longer than 5,000 characters and must identify the invoice item to update. period requires start and end, price_data requires currency and product, quantities must be non-negative, and enum fields such as tax_behavior accept only their documented values.