Line items
Line items represent the individual products and charges on an invoice. Each line item includes a quantity, pricing details, and computed subtotal and total amounts after discounts and taxes.
Line items are managed through the Invoices API. Include them when creating or updating an invoice — there are no separate line item endpoints.
The LineItem object
- Name
object
- Type
- "line_item",
- Description
- Literal representing the object’s type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
- Has the value
trueif the object exists in a production environment or the valuefalseif the object exists in a sandbox environment.
- Name
created_at
- Type
- integer,
- Description
- Time at which the object was created. Measured in milliseconds since the Unix epoch.
- Name
description
- Type
- string or null,
- Description
- Optional descriptive text for this line item.
- Name
discounts
- Type
- array of Discounts or null,
- Description
- Expandable. The discounts applied to this line item.
- Name
name
- Type
- string or null,
- Description
- The display name for this line item when not backed by a catalog price.
- Name
price
- Type
- string or Price or null,
- Description
- Expandable. The catalog price backing this line item, if any.
- Name
quantity
- Type
- number, at most 9999,
- Description
- The quantity of this product being purchased.
- Name
subtotal
- Type
- integer,
- Description
- The subtotal amount in cents after discounts.
- Name
taxes
- Type
- array of objects,
- Description
- The taxes applied to this line item.
- Properties
- Name
total
- Type
- integer,
- Description
- The total amount in cents after applying discounts and taxes.
- Name
type
- Type
- enum,
- Description
- Discriminates how this line item is priced.
- Name
unit_amount
- Type
- integer or null,
- Description
- The unit amount in cents for this line item when it is not backed by a catalog price.
- Name
updated_at
- Type
- integer,
- Description
- Time at which the object was last updated. Measured in milliseconds since the Unix epoch.
The LineItem object
Adding line items
When creating an invoice, include at least one line item in the line_items array. Each invoice must have at least one line item.
Line items can reference catalog prices or use one-off custom pricing. See Line item types below.
Create an invoice with line items
Response example
Updating line items
When updating a draft invoice, provide a new line_items array. This replaces all existing line items on the invoice.
Only draft invoices can have their line items changed. Once an invoice is finalized, its line items are locked.
Update invoice line items
Response example
Line item types
Invoice line items are discriminated by the type field.
Catalog line items
Catalog line items reference an existing price from your product catalog. The price determines the unit amount and product details.
Custom line items
Custom line items are one-off charges with an inline name and unit_amount. Use these for ad hoc fees, services, or adjustments that are not backed by a catalog price.
Custom line items may have a negative unit_amount to represent a credit or adjustment. The invoice total cannot be negative — credit line items may not exceed the value of the other line items.
Taxes
Apply taxes to individual line items by including a taxes array on each line item input. Each tax requires a percentage and display_name.
If no line-level taxes are provided, the invoice’s default_taxes are applied instead.
Discounts
Apply discounts to a line item by including discount IDs in the discounts array. Discounts are applied before taxes when computing the line item subtotal and total.