comecerodocs

Get a billing run

GET
/usage/runs/{billing_run_id}

One billed period, with its invoice lines. URL-encode the id. Secret and trusted tokens may call it; a limited token may not (403).

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

billing_run_id*string

The billing run id.

Query Parameters

billing_region?string

The agreement's region. Defaults to us.

Response Body

Success.

application/json
  1. response
object?string

Always billing_run.

billing_run_id?string

billing_run:{agreement_id}:{period_start}, sometimes with a suffix. URL-encode it in paths.

billing_agreement_id?string

The agreement.

period_start?string

Start of the period billed.

Formatdate-time
period_end?string

End of the period billed.

Formatdate-time
kind?string

final_late is the last late-usage pass after an agreement ends.

Value in"period""final_late"
status?string

The run's state.

Value in"pending""completed""failed"
invoice_id?|

The invoice the usage is on: usually the subscription's renewal invoice, otherwise a separate usage invoice. Null when every line has zero cash to charge, including a fully credit-funded or capped run, or when the amount waits for the minimum. The run can still complete and debit credit.

carried_forward?boolean

true when the amount was under the minimum and waits for the next invoice.

prepared_lines?array<>

The rated lines, including zero-cash lines paid by credit or capped. A separate invoice uses only positive cash lines.

failure_code?|

Set when failed. You can fix and retry, from the dashboard: currency_mismatch, missing_metric_or_plan, subscription_not_found, invalid_customer_id, missing_credit_entitlement, funding_not_a_credit, credit_region_mismatch. needs_review (over 5,000 USD, or over 10 times the last invoice) is approved by Comecero.

failure_message?|

Set when failed.

billing_region?string

Billing region. Defaults to us.

Value in"us""uk""eu"
test?boolean

Test or live.

pricing_context?
unit_snapshot?
rated_principal?string|null
rated_credits?string|null
funded_principal?string|null
funded_credits?string|null
cash_principal?string|null
cash_credits?string|null
capped_principal?string|null
capped_credits?string|null
period_contexts?array<>|null
worked_from_credit_revision?integer
worked_from_credit_policy_revision?integer|null
worked_from_calendar_revision?integer|null
Example Request
curl -X GET 'https://api.comecero.com/api/v1/usage/runs/string'
Example Response
{  "object": "billing_run",  "billing_run_id": "billing_run:agr_cust_8412:2026-11-01T00:00:00Z",  "billing_agreement_id": "agr_cust_8412",  "period_start": "2026-11-01T00:00:00Z",  "period_end": "2026-12-01T00:00:00Z",  "kind": "period",  "status": "completed",  "invoice_id": "IN0123456789",  "carried_forward": false,  "prepared_lines": [    {      "kind": "usage",      "name": "AI tokens (token): 500000 used, 1 Nov 2026 00:00 to 1 Dec 2026 00:00 UTC",      "quantity": 500000,      "rated_amount": 8,      "credit_debit": 5,      "capped_amount": 0,      "amount": 3    }  ],  "failure_code": null,  "failure_message": null,  "billing_region": "us",  "test": false}