Get Billing Data
Billing
Get Billing Data
Retrieve invoices and payment status for your organization
GET
Get Billing Data
Documentation Index
Fetch the complete documentation index at: https://docs.unpod.dev/llms.txt
Use this file to discover all available pages before exploring further.
Get Billing Data
Retrieve invoices and payment history for your organization with pagination support. This endpoint returns billing records including invoice amounts, currency, payment status, and invoice dates.Prerequisites: Make sure you have your API Token and Org-Handle ready. See Authentication for details.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Org-Handle | string | Yes | Organization domain handle |
You can get the
Org-Handle by hitting the Get All Organizations API. The domain_handle field in the response is your Org-Handle.Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number for pagination (default = 1) |
| page_size | integer | No | Number of records per page (default = 20) |
Response Fields
| Field | Type | Description |
|---|---|---|
| count | integer | Total number of billing records |
| status_code | integer | HTTP status code |
| message | string | Response message |
| results | array | Array of invoice/billing objects |
Invoice Object Fields
| Field | Type | Description |
|---|---|---|
| id | integer | Unique invoice identifier |
| amount | string | Invoice amount as decimal string |
| currency | string | Currency code (e.g., USD, INR) |
| status | string | Payment status: paid, pending, failed |
| invoice_date | string | Invoice creation date (ISO 8601) |
Common Error Codes
| Status Code | Description |
|---|---|
| 200 | Success - Billing data fetched successfully |
| 400 | Bad Request - Invalid parameters provided |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Invalid organization handle |
| 404 | Not Found - Organization not found |
| 500 | Internal Server Error - Server-side error |
Code Examples
Best Practices
- Pagination: Use
pageandpage_sizeto retrieve billing records in manageable chunks - Status Monitoring: Watch for
pendingorfailedinvoice statuses that may require action - Currency Handling: Always check the
currencyfield before displaying amounts to users - Org-Handle: Ensure the correct organization handle is used for accurate billing records
- Reconciliation: Use
invoice_datealongsideidfor billing reconciliation workflows - Security: Keep API tokens secure and rotate them regularly