curl --request POST \
--url https://api.useaira.com/v1/invoices/{invoiceId}/line-items \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"idempotencyKey": "<string>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"amount": 123,
"name": "<string>",
"lineItemGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subLineItems": []
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scope": "credit_purchase",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"totalUsage": 123,
"usageFormat": "unit",
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"metadata": {
"type": "metric",
"billingModel": "in_full",
"priceTierDivision": "unique_tier"
},
"subLineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "fixed_price",
"name": "<string>",
"description": "<string>",
"usage": 123,
"amount": 123,
"metadata": {
"type": "fixed_price",
"fixedPrice": 123
}
}
],
"adjustments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "monetary_discount",
"amount": 123
}
],
"itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}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.
curl --request POST \
--url https://api.useaira.com/v1/invoices/{invoiceId}/line-items \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"idempotencyKey": "<string>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"amount": 123,
"name": "<string>",
"lineItemGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subLineItems": []
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scope": "credit_purchase",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"totalUsage": 123,
"usageFormat": "unit",
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"metadata": {
"type": "metric",
"billingModel": "in_full",
"priceTierDivision": "unique_tier"
},
"subLineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "fixed_price",
"name": "<string>",
"description": "<string>",
"usage": 123,
"amount": 123,
"metadata": {
"type": "fixed_price",
"fixedPrice": 123
}
}
],
"adjustments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "monetary_discount",
"amount": 123
}
],
"itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Documentation Index
Fetch the complete documentation index at: https://docs.useaira.com/llms.txt
Use this file to discover all available pages before exploring further.
API Key Authentication.
Schema for creating a one-off line item on an existing one-off invoice. When subLineItems is provided, the sum of subLineItems.amount must equal amount.
A unique idempotency key for this line item, scoped to the invoice.
1^[a-zA-Z0-9_-]+$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. When provided, amounts must sum to amount.
Show child attributes
Default Response
credit_purchase, contract_minimum_amount, plan_minimum_amount, plan_fixed_amount, metric, additional_charge, one_off, tax_gross_up unit, currency, null Show child attributes
Show child attributes
Show child attributes