Usage records
List usage records
List the usage reported against one metered subscription.
GET/v1/subscriptions/{subscription_id}/usage_records
Parameters
| Parameter | Description |
|---|---|
| subscription_idstring · pathrequired | No description in the spec. |
| invoice_idstring | null · queryoptional | Filter by billing state: 'pending' for records not yet invoiced, or an invoice id for the records it billed. |
| limitinteger · queryoptional | Defaults to 10. Between 1 and 100. |
| starting_afterstring | null · queryoptional | At most 128 characters. |
Cursor-paginated. limit caps a page and starting_after takes the last id you
saw.
Returns
Returns a page of UsageRecordResponse objects. data holds the page and has_more says whether another one exists. Page forward by passing the last id of the page as starting_after; a short page is not the end of the list.
Errors
| Status | Cause |
|---|---|
| 401 | Missing or invalid API key. |
| 403 | Key is missing the usage_records:read scope. |
| 404 | No such object, or it belongs to the other mode. |
| 422 | Validation Error |
| 429 | Rate limited. Back off and retry. |
Other usage records operations
- Create usage record POST /v1/subscriptions/{subscription_id}/usage_records
- Get usage summary GET /v1/subscriptions/{subscription_id}/usage_summary
BillKit