Skip to main content
POST
Create invoice line item group

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Path Parameters

invoiceId
string<uuid>
required

The unique identifier of the invoice to add the line item group to.

Body

application/json

Schema for creating a line item group container for an existing one-off invoice. The group is created empty; line items are added via the line-items endpoint. Empty groups are allowed.

idempotencyKey
string
required

A unique idempotency key for this group, scoped to the invoice.

Minimum string length: 1
Pattern: ^[a-zA-Z0-9_-]+$
productId
string<uuid>
required

The product to associate with this group.

startDate
string<date>
required

Start of the period covered by the group.

endDate
string<date>
required

End of the period covered by the group.

name
string | null

Optional group name; defaults to the product name when null.

Response

Schema representing a line item group: a container that gathers the line items generated from one plan instance (or created as a group on one-off invoices). Monetary amounts are integers in cents.

id
string<uuid>
required

The unique identifier of the line item group in our system.

idempotencyKey
string
required

A unique key that identifies the group within the invoice. Supplied by the caller for one-off groups; generated by the billing engine otherwise.

customerId
string<uuid>
required

The unique identifier of the customer whose consumption this group bills.

productId
string<uuid>
required

The unique identifier of the product this group belongs to.

planId
string<uuid> | null
required

The unique identifier of the plan whose instance generated this group. Null for groups not generated from a plan (e.g. on one-off invoices).

planInstanceId
string<uuid> | null
required

The unique identifier of the plan instance that generated this group. Null for groups not generated from a plan instance.

name
string
required

Display name of the group as it appears on the invoice, typically the plan or product name.

startDate
string<date>
required

Start of the period covered by the group.

endDate
string<date>
required

End of the period covered by the group.

subtotalAmount
number
required

Sum of the group's line item subtotals before adjustments, in cents.

adjustmentAmount
number
required

Net amount of the adjustments applied to the group's line items (discounts and allocation offsets), in cents. Negative when adjustments reduce the amount owed.

totalAmount
number
required

Final group amount, in cents: subtotalAmount + adjustmentAmount.

discountAmount
number
required

The discount portion of adjustmentAmount, in cents (sum of monetary discount adjustments only). Negative when discounts were applied.

lineItems
object[]
required

The line items contained in this group.