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 invoice-level 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 AppliedDiscounts or null,
- Description
- Expandable. The discounts applied directly 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,
- 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.
- Properties
- Name
unit_amount
- Type
- integer or null,
- Description
- The snapshotted unit amount in cents for this line item, if available.
- 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 or services that are not backed by a catalog price.
Custom line items must have a unit_amount of zero or greater. To reduce the amount owed or record a billing adjustment, issue a credit note.
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.