Stripe | Financial Infrastructure to Grow Your Revenue

Stripe | Financial Infrastructure to Grow Your Revenue

4466 articles

The Invoice Line Item object


The Invoice Line Item object

Attributes

  • id string Unique identifier for the object.
  • amount integer The amount, in the smallest currency unit.
  • currency enum Three-letter ISO currency code, in lowercase. Must be a supported currency.
  • description nullable string An arbitrary string attached to the object. Often useful for displaying to users.
  • invoice nullable string The ID of the invoice that contains this line item.
  • metadata map 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. Note that for line items with type=subscription, metadata reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
  • parent nullable object The parent that generated this line item.
  • period object The period this line_item covers. For subscription line items, this is the subscription period. For prorations, this starts when the proration was calculated, and ends at the period end of the subscription. For invoice items, this is the time at which the invoice item was created or the period of the item. If you have Stripe Revenue Recognition enabled, the period will be used to recognize and defer revenue. See the Revenue Recognition documentation for details.
  • pricing nullable object The pricing information of the line item.
  • quantity _ decimal nullable decimal string Non-negative decimal with at most 12 decimal places. The quantity of units for the line item.

More attributes

  • object string, value is "line_item"
  • discount _ amounts nullable array of objects
  • discountable boolean
  • discounts array of strings Expandable
  • livemode boolean
  • pretax _ credit _ amounts nullable array of objects
  • quantity nullable integer Deprecated
  • subtotal integer
  • taxes nullable array of objects

The Invoice Line Item object

{ "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_1NpHiK2eZvKYlo2C9NdV8VrI", "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, "quantity_decimal": "1", "taxes": []}

Update an invoice's line item

POST / v1 / invoices /:id / lines /:id

Updates an invoice’s line item. Some fields, such as tax_amounts, 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

  • invoice string Required Invoice ID of line item
  • line _ item _ id string Required Invoice line item ID
  • amount integer The integer amount in the smallest currency unit 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.
  • description string An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
  • metadata map 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.
  • period object 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.
  • pricing object The pricing information for the invoice item.
  • quantity _ decimal string Non-negative decimal with at most 12 decimal places. The quantity of units for the line item.

More parameters

  • discountable boolean
  • discounts array of objects
  • price _ data object
  • quantity integer Deprecated
  • tax _ amounts array of objects
  • tax _ rates array of strings

Returns

The updated invoice’s line item object is returned upon success. Otherwise, this call raises an error.

Response

{ "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, "quantity_decimal": "1", "taxes": []}

Retrieve an invoice's line items

GET / v1 / invoices /:id / lines

When retrieving an invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

Parameters

No parameters.

More parameters

  • ending _ before string
  • limit integer
  • starting _ after string

Returns

Returns a list of line_item objects.

Response

Last verified 2026-09-24

Is this helpful?