cURL
curl --request GET \ --url https://api.paygentic.io/v2/invoices/{id}/lineItems \ --header 'Authorization: Bearer <token>'
{ "invoiceId": "inv_r1s2t3u4v5w6x7y8", "lineItems": [ { "eventType": "usage", "eventId": "usg_a1b2c3d4e5f6g7h8", "eventSourceId": "bm_l5m6n7o8p9q0r1s2", "invoiceDisplayName": "Claude Token Consumption", "lineItemType": "charge", "meterEventId": "me_x9y0z1a2b3c4d5e6", "metricDescription": "Language model token consumption", "metricName": "Token Usage", "metricUnit": "tokens", "quantity": 2500, "taxRate": 0.085, "totalAmount": "0.05425", "totalPrice": "0.05", "totalTax": "0.00425", "unitPrice": "0.00002" }, { "eventType": "fee", "eventId": "fee_b2c3d4e5f6g7h8i9", "eventSourceId": "fee_h3i4j5k6l7m8n9o0", "invoiceDisplayName": "Platform Fee", "meterEventId": "", "metricDescription": "Monthly platform fee", "metricName": "Platform Fee", "metricUnit": "charge", "quantity": 1, "taxRate": 0.1, "totalAmount": "5.50", "totalPrice": "5.00", "totalTax": "0.50", "unitPrice": "5.00" } ], "nextPageToken": null, "totalCount": 3 }
Get paginated line items for an invoice from the analytics service
API key authentication
The invoice ID
Maximum number of line items to return
1 <= x <= 1000
Token for pagination to fetch the next page of results
Paginated list of invoice line items
Array of line items for this page
Show child attributes
Total number of line items across all pages
Token for fetching the next page, null if no more pages