Create invoice line item
Creates a line item on a one-off invoice, optionally with sub-line items. When sub-line items are provided, their amounts must sum to the line item amount.
Authorizations
API Key Authentication.
Path Parameters
The unique identifier of the invoice to add the line item to.
Body
Schema for creating a one-off line item on an existing one-off invoice. When subLineItems is provided, the sum of usage × price (rounded to whole cents per row) must equal amount.
A unique idempotency key for this line item, scoped to the invoice.
1^[a-zA-Z0-9_-]+$The unique identifier of the product this line item belongs to.
The unique identifier of the catalog item this line item bills.
Start of the period covered by the line item.
End of the period covered by the line item.
Amount billed by the line item, in cents.
Optional line item name; defaults to the item name (or product name as fallback) when null.
Optional line item group to attach this line item to. The group must belong to the same invoice.
Optional breakdown of the line item amount into sub-line items. The sum of usage × price (rounded to whole cents per row) must equal amount.
Response
Schema representing an invoice line item. Monetary amounts are integers in cents; the price breakdown lives in subLineItems.
The unique identifier of the line item in our system.
A unique key that identifies the line item within the invoice. Supplied by the caller for one-off line items; generated by the billing engine otherwise.
The unique identifier of the customer whose consumption this line item bills. On split or consolidated invoices it may be a subsidiary of the invoice's customer.
The unique identifier of the product this line item belongs to.
The unique identifier of the metered resource behind a usage_based line item. Null for line items not driven by resource usage.
The unique identifier of the license behind a license_based line item. Null for line items not driven by a license count.
The unique identifier of the line item group containing this line item. Null for standalone line items.
Display name of the line item as it appears on the invoice.
What the line item charges for: usage_based (metered resource consumption), license_based (a license's reported count billed in full), fixed (recurring fixed charge of a plan), minimum_commitment (plan-level minimum top-up), contract_minimum_commitment (contract-level minimum top-up), credit_purchase (credit pool top-up), additional_charge (extra charge added manually), one_off (line item of a one-off invoice), or tax_gross_up (tax gross-up charge).
credit_purchase, contract_minimum_commitment, minimum_commitment, fixed, usage_based, license_based, additional_charge, one_off, tax_gross_up Start of the period covered by this line item.
End of the period covered by this line item.
Total usage billed by the line item, in the unit given by usageFormat. Null for line items without usage (e.g. fixed charges).
How to read totalUsage and the sub-line usage values: unit means a count of resource units; currency means a monetary base amount in cents. Null when the line item has no usage.
unit, currency, null Line item amount before adjustments, in cents (sum of its sub-line item amounts).
Net amount of the adjustments applied to this line item (discounts and allocation offsets), in cents. Negative when adjustments reduce the amount owed.
Final line item amount, in cents: subtotalAmount + adjustmentAmount.
The discount portion of adjustmentAmount, in cents (sum of monetary discount adjustments only). Negative when discounts were applied.
Pricing metadata for the line item, where the shape is keyed by type. Always present, but null for line items without pricing metadata: fixed, credit_purchase, additional_charge, one_off, and tax_gross_up. It is populated only for usage_based, license_based, minimum_commitment, and contract_minimum_commitment line items.
- Fixed
- Usage-based
- License-based
- Contract minimum commitment
- Minimum commitment
Breakdown of the line item amount into priced rows (included quantities, unit/package/tier prices, prorations, companions). Empty for line items without a breakdown.
Adjustments applied on top of the line item subtotal, such as discounts and allocation offsets.
The unique identifier of the catalog item this line bills. Null for line items not backed by a catalog item.