Stripe | Financial Infrastructure to Grow Your Revenue

Stripe | Financial Infrastructure to Grow Your Revenue

5282 articles

Manage bulk invoice line items


Public preview

Manage bulk invoice line items Public preview

Add, update and remove multiple invoice line items with the Invoices API.

You can edit multiple line items on an invoice by bulk adding, updating, and removing line items with the Invoices API.

Create an invoice

To update an invoice, you need to create one first. You can create an invoice in the Dashboard or with the Invoices API. You can only update invoices in a draft state.

Add line items

To create multiple line items on the same invoice, reference the invoice ID. You can also assign a preexisting unassigned invoice item with the invoice item ID. Here’s how to create two new line items and assign an existing invoice item to this invoice.

Command Line

Common mistake

Ensure that you’re using the invoice item ID, using a line item ID here will result in an error.

Update line items

From here, you can update multiple line items on the same invoice based on the invoice ID and line item IDs like the following:

Command Line

The example above updates the description and metadata for line item 1, the price for line item 2, and whether it’s discountable for line item 3.

Remove line items

You can delete or unassign multiple line items on the same invoice by referencing the invoice ID and line item IDs and distinguishing between different removal types with the behavior key. Here’s how to permanently delete the related setting and unassign the related setting. You can reassign the related setting to another invoice in another request.

Command Line

Restrictions

There are some restrictions when using this feature

  • The invoice must still be in a draft state
  • There are two types of invoice line items
  1. type: invoiceitem : Generated when an invoice item is added to an invoice.
  2. type: subscription : Automatically generated for a subscription invoice from each subscription item. This is the full list of fields that are available to update for each line item. While all fields are supported for invoiceitem line items, you can only update a small subset for subscription line items. Fields that are supported for subscription line items are tax _ rates , or discounts .
  • You can update a maximum of 50 line items in one API call. This limit is subject to change and might increase or decrease.

Invoice metadata

You can set invoice metadata in the same request for any of the above endpoints. Here’s an example calling update_lines.

Command Line

Last verified 2026-09-25

Is this helpful?