Get the billing report
const url = 'https://qinto-api.blotout.io/teams/7b8d1a52-6c1e-4b6f-9a30-2f8a54d1c3e9/billing?sitesAfter=shop.example.com&invoicesAfter=in_1QaBcDeFgHiJkLmN&appsAfter=order-sync&app=order-sync&appSitesAfter=shop.example.com&bundlesAfter=9b1e2c4d-7f36-4a2e-9c1d-2e5f8a7b6c3d&bundle=9b1e2c4d-7f36-4a2e-9c1d-2e5f8a7b6c3d&bundleSitesAfter=shop.example.com';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://qinto-api.blotout.io/teams/7b8d1a52-6c1e-4b6f-9a30-2f8a54d1c3e9/billing?sitesAfter=shop.example.com&invoicesAfter=in_1QaBcDeFgHiJkLmN&appsAfter=order-sync&app=order-sync&appSitesAfter=shop.example.com&bundlesAfter=9b1e2c4d-7f36-4a2e-9c1d-2e5f8a7b6c3d&bundle=9b1e2c4d-7f36-4a2e-9c1d-2e5f8a7b6c3d&bundleSitesAfter=shop.example.com' \ --header 'Authorization: Bearer <token>'Reads what the team pays for the Blotout platform this month: the core usage charges so far and projected with each site’s share, what each app and each bundle purchase charges so far and projected with their sites, when the team is charged next, how it pays, and its past invoices. Call it to follow a team’s costs without the Billing page.
How it works
The amounts match the team’s Billing page, at list prices. Core usage settles two days late, so soFar counts up to countedUntil; app and bundle charges count through yesterday. Each list pages with the cursor of its name: sitesAfter, invoicesAfter, appsAfter, bundlesAfter, and app with appSitesAfter or bundle with bundleSitesAfter for one line’s sites. For a team Blotout has taken out of billing, the report says only notBilled: true. The report is read-only and sets up nothing: a team that has not opened its Billing page yet has no payment method, card terms, no next charge and no invoices.
Required permissions
team:manage_billing:readon the team
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Unique id (UUID) of the team that owns the addressed resources, as shown in the team settings on the Blotout platform.
Example
7b8d1a52-6c1e-4b6f-9a30-2f8a54d1c3e9Unique id (UUID) of the team that owns the addressed resources, as shown in the team settings on the Blotout platform.
Query Parameters
Section titled “Query Parameters”Continue the sites after this one, from the previous response’s sites.nextCursor.
Example
shop.example.comContinue the sites after this one, from the previous response’s sites.nextCursor.
Continue the invoices after this one, from the previous response’s invoices.nextCursor.
Example
in_1QaBcDeFgHiJkLmNContinue the invoices after this one, from the previous response’s invoices.nextCursor.
Continue the app lines after this app’s slug, from the previous response’s apps.lines.nextCursor.
Example
order-syncContinue the app lines after this app’s slug, from the previous response’s apps.lines.nextCursor.
The slug of the app whose sites appSitesAfter continues; it takes effect only together with appSitesAfter.
Example
order-syncThe slug of the app whose sites appSitesAfter continues; it takes effect only together with appSitesAfter.
Continue the sites of the app named in app after this one, from that line’s sites.nextCursor.
Example
shop.example.comContinue the sites of the app named in app after this one, from that line’s sites.nextCursor.
Continue the bundle lines after this purchase’s id, from the previous response’s bundles.lines.nextCursor.
Example
9b1e2c4d-7f36-4a2e-9c1d-2e5f8a7b6c3dContinue the bundle lines after this purchase’s id, from the previous response’s bundles.lines.nextCursor.
The id of the bundle purchase whose sites bundleSitesAfter continues; it takes effect only together with bundleSitesAfter.
Example
9b1e2c4d-7f36-4a2e-9c1d-2e5f8a7b6c3dThe id of the bundle purchase whose sites bundleSitesAfter continues; it takes effect only together with bundleSitesAfter.
Continue the sites of the purchase named in bundle after this one, from that line’s sites.nextCursor.
Example
shop.example.comContinue the sites of the purchase named in bundle after this one, from that line’s sites.nextCursor.
Responses
Section titled “Responses”The billing report.
The report of a team that is not billed, which has no charges and no invoices.
object
Blotout has taken the team out of automatic billing: it needs no card, is charged nothing, and gets no invoice.
What a billed team pays for the Blotout platform this month, and how it pays.
object
The team is billed: the rest of the report applies.
The billing month the report covers, as YYYY-MM in UTC.
The instant up to which usage is counted in soFar, as an ISO 8601 UTC timestamp; usage settles two days late. Null in the first two days of a month.
The core usage amount every team gets free each month, in USD.
The charges this month so far.
object
The core usage cost this month so far, in USD at list prices.
The part of it that the free platform amount covers, in USD.
What the team owes, in USD: the cost minus the free amount.
The projection for the whole month from recent usage, or null while the team has under 10 days of usage.
object
The core usage cost projected for the whole month, in USD at list prices.
The part of it that the free platform amount covers, in USD.
What the team owes, in USD: the cost minus the free amount.
The number of sites across every page of sites.
object
How many of the team’s sites are charged.
How many run on the team’s own Cloudflare account and are not charged.
The team’s live sites, and a deleted site with a cost this month.
object
One page of 20 sites by hostname.
One site of the team and its share of this month’s core usage cost.
object
Id of the site.
Hostname of the site.
Whether the site’s usage is charged; a site on the team’s own Cloudflare account is not.
Whether the site was deleted this month; it is listed while it has a cost.
The site’s core usage cost this month so far, in USD at list prices.
Pass as sitesAfter for the next page, or null on the last one.
What the team’s apps charge this month. The free platform amount never covers them.
object
What every app of the team charges this month through yesterday, in USD.
The apps’ projected charge for the whole month, in USD, or null while one app has no projection yet.
One line per app that charged or can charge this month.
object
One page of 20 apps by slug.
One app the team pays for this month, or can pay for, and its sites.
object
Id of the app.
Slug of the app.
Name of the app.
What the app charges this month through yesterday, in USD, over every site of the team.
The app’s projected charge for the whole month, in USD: so far, the average daily usage charge of the last 30 days for each day left, and the base fees already known for those days. Null while the app has usage on fewer than 10 of those days.
Whether the app’s usage has reached its usage cap on one of the team’s sites this month.
The UTC day the team’s free trial of the app ends, as YYYY-MM-DD, or null when no trial is on.
The team’s sites with a charge of the app this month or an install of it that can charge.
object
One page of 20 sites by hostname.
One site of the team and what the app charges for it this month.
object
Id of the site.
Hostname of the site.
Whether the site was deleted this month; it is listed while it has a charge.
What the app charges for the site this month so far, in USD: its base fees and usage charges.
Whether the app’s usage on the site has reached its usage cap this month.
Pass as appSitesAfter, with the app’s slug as app, for the next page, or null on the last one.
Pass as appsAfter for the next page, or null on the last one.
What the team’s bundle purchases charge this month. The free platform amount never covers them.
object
What every bundle purchase of the team charges this month through yesterday, in USD.
The bundles’ projected charge for the whole month, in USD, or null while one purchase has no projection yet.
One line per bundle purchase that charged or can charge this month.
object
One page of 20 purchases by bundle name.
One bundle purchase the team pays for this month, or can pay for, and its sites.
object
Id of the team’s purchase of the bundle.
Id of the bundle.
Name of the bundle.
What the purchase charges this month through yesterday, in USD: its fee, its extra sites and the usage of the installs it covers.
The purchase’s projected charge for the whole month, in USD: so far, the average daily usage charge of the last 30 days for each day left, and the fees already known for those days. Null while a purchase with usage charges has usage on fewer than 10 of those days.
Whether the usage the purchase covers has reached the purchase’s usage cap this month.
The sites past the purchase’s site limit charged this month through today, each at the extra-site price. A site counts on the first day the peak number of covered sites goes over the limit in its period.
The UTC day the team’s free trial of the bundle ends, as YYYY-MM-DD, or null when no trial is on.
The next day the purchase’s price is charged for a period: the first day of the next month for a monthly purchase, the anniversary for a yearly one, the one day for a one-time one. Null when the purchase has no price, its one-time price is charged, or it ends first.
object
The UTC day of the charge, as YYYY-MM-DD.
The amount charged for the period that starts on that day, in USD.
When the purchase ends: the first instant it no longer covers, still ahead while a cancel waits to take effect; null while active.
The sites the purchase covers.
object
One page of 20 sites by hostname.
One site a bundle purchase covers.
object
Id of the site.
Hostname of the site.
Pass as bundleSitesAfter, with the purchase’s id as bundle, for the next page, or null on the last one.
Pass as bundlesAfter for the next page, or null on the last one.
The totals of the core usage, the apps and the bundles together, as the Billing page’s summary shows them.
object
What the team owes this month so far, in USD: the core total after the free amount plus the apps and the bundles.
The same over the projections, or null while the core usage, an app or a bundle purchase has no projection yet.
When the team is charged next, as an ISO 8601 UTC timestamp; null for a team that has no billing yet.
Whether the team has a payment method on file, a card or a bank account.
How the team pays: card is charged at nextChargeAt, invoice is sent an invoice.
On invoice terms, the days a team has to pay an invoice; null on card terms.
The team’s past invoices.
object
One page of up to 12 invoices, newest first.
One past invoice of the team.
object
The billing month the invoice covers, as YYYY-MM in UTC.
The invoice number, or null while it has none.
The invoice total in USD cents.
Where the invoice stands: open awaits payment, paid is settled.
Pass as invoicesAfter for the next page, or null on the last one.
Example
{ "notBilled": true}invalid_params — A path parameter failed validation (for example a malformed UUID); details pinpoints the offending parameter.
object
Machine-readable error slug; switch on this value rather than on the HTTP status alone.
Field-level validation errors: a tree keyed by input property, each node carrying an errors array of human-readable messages. Render it to help the caller correct the request.
object
Example
{ "error": "invalid_params", "details": { "errors": [], "properties": { "teamId": { "errors": [ "Invalid UUID" ] } } }}unauthenticated — The Authorization: Bearer token is missing, malformed, or no longer valid. Generate a team API token or obtain a new OAuth access token.
object
Machine-readable error slug; switch on this value rather than on the HTTP status alone.
Example
{ "error": "unauthenticated"}forbidden — The bearer credential lacks the required permission or belongs to another team, or its user lacks the organization role a developer operation needs. Update its policies, use a credential bound to the addressed team, or ask an organization owner for the role; message states the reason when one is known.
object
Machine-readable error slug; switch on this value rather than on the HTTP status alone.
Human-readable reason for this specific failure, intended for display — do not parse it programmatically.
Example
{ "error": "forbidden", "message": "The Cloudflare API token is invalid or expired."}internal — Unexpected server error. Nothing is guaranteed to have been persisted; idempotent operations are safe to retry.
object
Machine-readable error slug; switch on this value rather than on the HTTP status alone.
Example
{ "error": "internal"}billing_unavailable — The payment provider, which holds the team’s next charge date and invoices, could not be reached or refused the request, so no report was read. Retry in a few minutes.
object
Machine-readable error slug; switch on this value rather than on the HTTP status alone.
Human-readable reason for this specific failure, intended for display — do not parse it programmatically.
Example
{ "error": "billing_unavailable", "message": "The Cloudflare API token is invalid or expired."}