CorefinityCorefinityDocs
Open the Control PanelControl Panel
Billing · 16 of 16

Get a month of usage

Answers what the account accrued in one calendar month (UTC): the month's total, each day's total (a day on which nothing accrued is left out) and each contract line with its hours and its own days. credits_applied lists the credits applied to invoices whose period starts in the month, as negative amounts.

GET/api/corestack/billing/usage

Query parameters

accountinteger

The billing account to read, by its id (see GET /corestack/billing/account). Left out, the request acts on your company's default billing account. An account that does not exist and one that is not your company's answer the same 404. At least 1.

account_idinteger

The same as account, under the name the MCP tools use. Send one of the two: when they name different accounts the request is refused 422 invalid on account_id. At least 1.

monthstring

The month, as YYYY-MM. Left out, the current month (UTC).

Returns

200 The month's usage.

Fields of the 200 answer
credits_appliedarray of objectsRequired
Fields of each item
amountobjectRequired

The credit applied, as a negative amount.

Fields
amountstringRequired
currencystringRequired
creditobjectRequired
Fields
idintegerRequired

At least 1.

public_notestringRequired
invoiceobjectRequired
Fields
idintegerRequired

At least 1.

numberstringRequired
currencystringRequired
daysarray of objectsRequired
Fields of each item
amountobjectRequired
Fields
amountstringRequired
currencystringRequired
daystringRequired

Format: date.

linesarray of objectsRequired
Fields of each item
amountobjectRequired
Fields
amountstringRequired
currencystringRequired
contract_lineobjectRequired

A line of a contract, by name.

Fields
idintegerRequired

At least 1.

kindstringRequired

package, an addon (extra cores, memory, disk, log storage, a dedicated IP address) or uat, a staging environment.

packageaddonuat
labelstringRequired
daysarray of objectsRequired
Fields of each item
amountobjectRequired
Fields
amountstringRequired
currencystringRequired
daystringRequired

Format: date.

hoursintegerRequired
hoursintegerRequired
monthstringRequired

The month, as YYYY-MM.

totalobjectRequired
Fields
amountstringRequired
currencystringRequired

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403billing_forbiddenBilling is for the organisation's owner and billing contacts. Ask one of them to do this.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl https://manage.corefinity.com/api/corestack/billing/usage \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "credits_applied": [],
  "currency": "GBP",
  "days": [
    {
      "amount": {
        "amount": "19.35",
        "currency": "GBP"
      },
      "day": "2027-01-01"
    },
    {
      "amount": {
        "amount": "19.35",
        "currency": "GBP"
      },
      "day": "2027-01-02"
    },
    {
      "amount": {
        "amount": "19.35",
        "currency": "GBP"
      },
      "day": "2027-01-03"
    }
  ],
  "lines": [
    {
      "amount": {
        "amount": "337.10",
        "currency": "GBP"
      },
      "contract_line": {
        "id": 9001,
        "kind": "package",
        "label": "CC8 · Northwind UK 1"
      },
      "days": [
        {
          "amount": {
            "amount": "19.35",
            "currency": "GBP"
          },
          "day": "2027-01-01",
          "hours": 24
        },
        {
          "amount": {
            "amount": "19.35",
            "currency": "GBP"
          },
          "day": "2027-01-02",
          "hours": 24
        },
        {
          "amount": {
            "amount": "19.35",
            "currency": "GBP"
          },
          "day": "2027-01-03",
          "hours": 24
        }
      ],
      "hours": 418
    }
  ],
  "month": "2027-01",
  "total": {
    "amount": "337.10",
    "currency": "GBP"
  }
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT