Manage unbilled usage records, consumption tracking, and pending billing data in the usage management system.
/api/unbilled-usage
The Unbilled Usage API provides endpoints for managing unbilled usage records including creation, retrieval, and listing. Tracks consumption data that has not yet been billed to customers.
Creates a new unbilled usage record for a subscription.
{
"subscriptionId": "sub_123",
"customerId": "cust_456",
"usageType": "cpu_hours",
"quantity": 50,
"unitPrice": 0.50,
"estimatedAmount": 25.00,
"currency": "USD",
"usageDate": "2026-06-02T10:30:00Z",
"billableStartDate": "2026-07-01"
}
{
"id": "usage_791",
"subscriptionId": "sub_123",
"usageType": "cpu_hours",
"quantity": 50,
"estimatedAmount": 25.00,
"createdAt": "2026-06-02T10:30:00Z"
}
Gets unbilled usage record details by ID.
| Parameter | Type |
|---|---|
| id | string |
{
"id": "usage_791",
"subscriptionId": "sub_123",
"customerId": "cust_456",
"usageType": "cpu_hours",
"quantity": 50,
"unitPrice": 0.50,
"estimatedAmount": 25.00,
"currency": "USD",
"usageDate": "2026-06-02T10:30:00Z",
"billableStartDate": "2026-07-01",
"createdAt": "2026-06-02T10:30:00Z"
}
Gets all unbilled usage records with filtering and pagination.
| Parameter | Type | Description |
|---|---|---|
| $filter | string | OData filter expression |
| $orderby | string | Sort by columns |
| $skip | integer | Skip n records |
| $top | integer | Take n records |
{
"value": [
{
"id": "usage_791",
"subscriptionId": "sub_123",
"usageType": "cpu_hours",
"quantity": 50,
"estimatedAmount": 25.00,
"billableStartDate": "2026-07-01"
}
],
"count": 150
}
| Code | HTTP Status | Description |
|---|---|---|
| USAGE_RECORD_NOT_FOUND | 404 | Usage record does not exist |
| SUBSCRIPTION_NOT_FOUND | 404 | Associated subscription not found |
| INVALID_QUANTITY | 400 | Invalid quantity value |
| INVALID_BILLABLE_DATE | 400 | Billable date must be in the future |