Get Account Billable Usage Info (Version 1, Alpha)
client.billing.usage.paygoInfo(UsagePaygoInfoParams { account_id } params, RequestOptionsoptions?): UsagePaygoInfoResponse { covered, subscriptions }
GET/accounts/{account_id}/billable-usage/info
Returns high-level usage information for the account, including coverage, and subscription metadata.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Get Account Billable Usage Info (Version 1, Alpha)
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const response = await client.billing.usage.paygoInfo({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
console.log(response.covered);{
"errors": [
{
"message": "message",
"code": 0
}
],
"messages": [
{
"message": "message",
"code": 0
}
],
"result": {
"covered": true,
"subscriptions": [
{
"id": "3F3CD4CQ6N7FXO7IK6NVFJBOYA",
"billing_cycle_anchor_timestamp": "2023-01-01T00:00:00Z",
"start_timestamp": "2023-01-01T00:00:00Z",
"end_timestamp": "2023-12-31T23:59:59Z"
}
]
},
"success": true
}Returns Examples
{
"errors": [
{
"message": "message",
"code": 0
}
],
"messages": [
{
"message": "message",
"code": 0
}
],
"result": {
"covered": true,
"subscriptions": [
{
"id": "3F3CD4CQ6N7FXO7IK6NVFJBOYA",
"billing_cycle_anchor_timestamp": "2023-01-01T00:00:00Z",
"start_timestamp": "2023-01-01T00:00:00Z",
"end_timestamp": "2023-12-31T23:59:59Z"
}
]
},
"success": true
}