Skip to main content
POST
Create invoice line item

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Body

application/json
start_date
string<date>
required

A date string to specify the line item's start date in the customer's timezone.

Example:

"2023-09-22"

end_date
string<date>
required

A date string to specify the line item's end date in the customer's timezone.

Example:

"2023-09-22"

quantity
number
required

The number of units on the line item

Example:

1

invoice_id
string
required

The id of the Invoice to add this line item.

Example:

"4khy3nwzktxv7"

amount
string
required

The total amount in the invoice's currency to add to the line item.

Example:

"12.00"

name
string | null

The name to use for the line item. If item_id is not provided, Orb will search for an item with this name. If found, that item will be associated with the line item. If not found, a new item will be created with this name. If item_id is provided, this name will be used for the line item, but the item association will be based on item_id. At least one of name or item_id must be provided.

Example:

"Item Name"

item_id
string | null

The id of the item to associate with this line item. If provided without name, the item's name will be used for the price/line item. If provided with name, the item will be associated but name will be used for the line item. At least one of name or item_id must be provided.

Example:

"4khy3nwzktxv7"

Response

Created

amount
string
required

The final amount for a line item after all adjustments and pre paid credits have been applied.

Example:

"7.00"

end_date
string<date-time>
required

The end date of the range of time applied for this line item's price.

Example:

"2022-02-01T08:00:00+00:00"

grouping
string | null
required

[DEPRECATED] For configured prices that are split by a grouping key, this will be populated with the key and a value. The amount and subtotal will be the values for this particular grouping.

adjustments
(MonetaryUsageDiscountAdjustment · object | MonetaryAmountDiscountAdjustment · object | MonetaryPercentageDiscountAdjustment · object | MonetaryTieredPercentageDiscountAdjustment · object | MonetaryMinimumAdjustment · object | MonetaryMaximumAdjustment · object)[]
required

All adjustments applied to the line item in the order they were applied based on invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums -> maximums).

name
string
required

The name of the price associated with this line item.

Example:

"Fixed Fee"

quantity
number
required

Either the fixed fee quantity or the usage during the service period.

Example:

1

start_date
string<date-time>
required

The start date of the range of time applied for this line item's price.

Example:

"2022-02-01T08:00:00+00:00"

subtotal
string
required

The line amount before any adjustments, rounded to the invoicing currency's precision.

Example:

"9.00"

adjusted_subtotal
string
required

The line amount after any adjustments and before overage conversion, credits and partial invoicing. Unlike subtotal and amount, this is not rounded to the currency's precision, so it matches the adjusted_subtotal in data exports. To find the effect of adjustments, use adjustments rather than the difference between subtotal and adjusted_subtotal. Each adjustment amount is rounded to the currency's precision, so a sub-cent adjustment can show as zero.

Example:

"5.00"

credits_applied
string
required

The number of prepaid credits applied.

Example:

"6.00"

partially_invoiced_amount
string
required

Any amount applied from a partial invoice

Example:

"4.00"

sub_line_items
(MatrixSubLineItem · object | TierSubLineItem · object | OtherSubLineItem · object)[]
required

For complex pricing structures, the line item can be broken down further in sub_line_items.

tax_amounts
TaxAmount · object[]
required

An array of tax rates and their incurred tax amounts. Empty if no tax integration is configured.

id
string
required

A unique ID for this line item.

price
UnitPrice · object
required

The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in the form of an invoice line item. Prices take a quantity and determine an amount to bill.

Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given Price object. The model_type field determines the key for the configuration object that is present.

For more on the types of prices, see the core concepts documentation

usage_customer_ids
string[] | null
required

A list of customer ids that were used to calculate the usage for this line item.

filter
string | null
required

An additional filter that was used to calculate the usage for this line item.