Updates an invoice’s line item. Some fields, such as tax_
, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount
, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.
Parameters
- invoicestringRequired
Invoice ID of line item
- line_
item_ idstringRequired Invoice line item ID
- amountinteger
The integer amount in cents 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.
- descriptionstring
An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
- metadataobject
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
. For type=subscription line items, the incoming metadata specified on the request is directly used to set this value, in contrast to type=invoiceitem line items, where any existing metadata on the invoice line is merged with the incoming data. - periodobject
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 enabled, the period will be used to recognize and defer revenue. See the Revenue Recognition documentation for details.
- period.
endtimestampRequired The end of the period, which must be greater than or equal to the start. This value is inclusive.
- period.
starttimestampRequired The start of the period. This value is inclusive.
- pricingobject
The pricing information for the invoice item.
- pricing.
pricestring The ID of the price object.
- quantityinteger
Non-negative integer. The quantity of units for the line item.
More parameters
- discountableboolean
Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
- discountsarray of objects
The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
- 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.
- price_
dataobject Data used to generate a new Price object inline.
- price_data.
currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- price_data.
productstringRequired conditionally - price_data.
product_ dataobjectRequired conditionally Data used to generate a new Product object inline. One of
product
orproduct_
is required.data - price_data.
product_data. namestringRequired The product’s name, meant to be displayable to the customer.
- price_data.
product_data. descriptionstring The product’s description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
- price_data.
product_data. imagesarray of strings A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
- price_data.
product_data. metadataobject 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
. - price_data.
product_data. tax_ codestringRecommended if calculating taxes A tax code ID.
- 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
- price_data.
unit_ amountintegerRequired conditionally A non-negative integer in cents representing how much to charge. One of
unit_
oramount unit_
is required.amount_ decimal - 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
- tax_
amountsarray of objects A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has tax_rates or if the invoice has default_tax_rates or uses automatic tax. Pass an empty string to remove previously defined tax amounts.
- tax_amounts.
amountintegerRequired The amount, in cents, of the tax.
- tax_amounts.
tax_ rate_ dataobjectRequired Data to find or create a TaxRate object.
Stripe automatically creates or reuses a TaxRate object for each tax amount. If the
tax_
exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’srate_ data tax_
, and cannot be directly added to invoices, payments, or line items.rates - tax_amounts.
tax_rate_data. display_ namestringRequired The display name of the tax rate, which will be shown to users.
- tax_amounts.
tax_rate_data. inclusivebooleanRequired This specifies if the tax rate is inclusive or exclusive.
- tax_amounts.
tax_rate_data. percentagefloatRequired The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the
amount
of the tax is also zero. - tax_amounts.
tax_rate_data. countrystring Two-letter country code (ISO 3166-1 alpha-2).
- tax_amounts.
tax_rate_data. descriptionstring An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
- tax_amounts.
tax_rate_data. jurisdictionstring The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
- tax_amounts.
tax_rate_data. jurisdiction_ levelenum The level of the jurisdiction that imposes this tax rate.
Possible enum valuescity
This value indicates that the jurisdiction imposing the tax rate is at the
city
level.country
This value indicates that the jurisdiction imposing the tax rate is at the
country
level.county
This value indicates that the jurisdiction imposing the tax rate is at the
county
level.district
This value indicates that the jurisdiction imposing the tax rate is at the
district
level.multiple
This value indicates that the jurisdictions imposing the tax rate are at
multiple
different jurisdiction levels.state
This value indicates that the jurisdiction imposing the tax rate is at the
state
level. - tax_amounts.
tax_rate_data. statestring ISO 3166-2 subdivision code, without country prefix. For example, “NY” for New York, United States.
- tax_amounts.
tax_rate_data. tax_ typeenum The high-level tax type, such as
vat
orsales_
.tax Possible enum valuesamusement_
tax Amusement Tax
communications_
tax Communications Tax
gst
Goods and Services Tax
hst
Harmonized Sales Tax
igst
Integrated Goods and Services Tax
jct
Japanese Consumption Tax
lease_
tax Chicago Lease Tax
pst
Provincial Sales Tax
qst
Quebec Sales Tax
retail_
delivery_ fee Retail Delivery Fee
Show 4 more
- tax_amounts.
taxable_ amountintegerRequired The amount on which tax is calculated, in cents.
- tax_amounts.
taxability_ reasonenum The reasoning behind this tax, for example, if the product is tax exempt.
Possible enum valuescustomer_
exempt No tax is applied as the customer is exempt from tax.
not_
collecting No tax is collected either because you are not registered to collect tax in this jurisdiction, or because the non-taxable product tax code (
txcd_
) was used.00000000 not_
subject_ to_ tax No tax is imposed on this transaction.
not_
supported No tax applied. Stripe doesn’t support this jurisdiction, territory, or product.
portion_
product_ exempt A portion of the price is exempt from tax.
portion_
reduced_ rated A portion of the price is taxed at a reduced rate.
portion_
standard_ rated A portion of the price is taxed at the standard rate.
product_
exempt The product or service is nontaxable or exempt from tax.
product_
exempt_ holiday The product or service is not taxed due to a sales tax holiday.
proportionally_
rated The shipping cost tax rate is calculated as a weighted average of the other line items’ rates, weighted by their amounts.
Show 5 more
- tax_
ratesarray of strings The tax rates which apply to the line item. When set, the
default_
on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.tax_ rates
Returns
The updated invoice’s line item object is returned upon success. Otherwise, this call raises an error.
{ "id": "il_tmp_1Nzo1ZGgdF1VjufLzD1UUn9R", "object": "line_item", "amount": 1000, "currency": "usd", "description": "My First Invoice Item (created for API docs)", "discount_amounts": [], "discountable": true, "discounts": [], "livemode": false, "metadata": {}, "parent": { "type": "invoice_item_details", "invoice_item_details": { "invoice_item": "ii_1Nzo1ZGgdF1VjufLzD1UUn9R", "proration": false, "proration_details": { "credited_items": null }, "subscription": null } }, "period": { "end": 1696975413, "start": 1696975413 }, "pricing": { "price_details": { "price": "price_1NzlYfGgdF1VjufL0cVjLJVI", "product": "prod_OnMHDH6VBmYlTr" }, "type": "price_details", "unit_amount_decimal": "1000" }, "quantity": 1, "taxes": []}