curl --request POST \
--url https://api.useaira.com/v1/invoices/{invoiceId}/line-item-groups \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"idempotencyKey": "<string>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"name": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"lineItems": [
{
"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 group on a one-off invoice. The group is created empty; group amounts are derived from child line items. Empty groups are allowed.
curl --request POST \
--url https://api.useaira.com/v1/invoices/{invoiceId}/line-item-groups \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"idempotencyKey": "<string>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"name": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"lineItems": [
{
"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 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.
A unique idempotency key for this group, scoped to the invoice.
1^[a-zA-Z0-9_-]+$The product to associate with this group.
Optional group name; defaults to the product name when null.
Default Response
Show child attributes