Skip to content

Get the billing report

GET
/teams/{teamId}/billing
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:read on the team
teamId
required

Unique id (UUID) of the team that owns the addressed resources, as shown in the team settings on the Blotout platform.

string format: uuid

Example

7b8d1a52-6c1e-4b6f-9a30-2f8a54d1c3e9

Unique id (UUID) of the team that owns the addressed resources, as shown in the team settings on the Blotout platform.

sitesAfter

Continue the sites after this one, from the previous response’s sites.nextCursor.

string
>= 1 characters

Example

shop.example.com

Continue the sites after this one, from the previous response’s sites.nextCursor.

invoicesAfter

Continue the invoices after this one, from the previous response’s invoices.nextCursor.

string
>= 1 characters

Example

in_1QaBcDeFgHiJkLmN

Continue the invoices after this one, from the previous response’s invoices.nextCursor.

appsAfter

Continue the app lines after this app’s slug, from the previous response’s apps.lines.nextCursor.

string
>= 1 characters

Example

order-sync

Continue the app lines after this app’s slug, from the previous response’s apps.lines.nextCursor.

app

The slug of the app whose sites appSitesAfter continues; it takes effect only together with appSitesAfter.

string
>= 1 characters

Example

order-sync

The slug of the app whose sites appSitesAfter continues; it takes effect only together with appSitesAfter.

appSitesAfter

Continue the sites of the app named in app after this one, from that line’s sites.nextCursor.

string
>= 1 characters

Example

shop.example.com

Continue the sites of the app named in app after this one, from that line’s sites.nextCursor.

bundlesAfter

Continue the bundle lines after this purchase’s id, from the previous response’s bundles.lines.nextCursor.

string
>= 1 characters

Example

9b1e2c4d-7f36-4a2e-9c1d-2e5f8a7b6c3d

Continue the bundle lines after this purchase’s id, from the previous response’s bundles.lines.nextCursor.

bundle

The id of the bundle purchase whose sites bundleSitesAfter continues; it takes effect only together with bundleSitesAfter.

string
>= 1 characters

Example

9b1e2c4d-7f36-4a2e-9c1d-2e5f8a7b6c3d

The id of the bundle purchase whose sites bundleSitesAfter continues; it takes effect only together with bundleSitesAfter.

bundleSitesAfter

Continue the sites of the purchase named in bundle after this one, from that line’s sites.nextCursor.

string
>= 1 characters

Example

shop.example.com

Continue the sites of the purchase named in bundle after this one, from that line’s sites.nextCursor.

The billing report.

Media typeapplication/json
Any of:

The report of a team that is not billed, which has no charges and no invoices.

object
notBilled
required

Blotout has taken the team out of automatic billing: it needs no card, is charged nothing, and gets no invoice.

boolean

Example

{
"notBilled": true
}

invalid_params — A path parameter failed validation (for example a malformed UUID); details pinpoints the offending parameter.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: invalid_params
details

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
key
additional properties

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.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: unauthenticated

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.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: forbidden
message

Human-readable reason for this specific failure, intended for display — do not parse it programmatically.

string

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.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: internal

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.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: billing_unavailable
message

Human-readable reason for this specific failure, intended for display — do not parse it programmatically.

string

Example

{
"error": "billing_unavailable",
"message": "The Cloudflare API token is invalid or expired."
}