CorefinityCorefinityDocs
Open the Control PanelControl Panel
Billing · 3 of 16

Get the balance

Answers the account's balance on its own: what has accrued this month, what is outstanding on open invoices, the credits available, each contract line's running figure, when the next invoice is issued and the latest activity. The same block as balance in GET /corestack/billing/account.

GET/api/corestack/billing/balance

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.

Returns

200 The balance.

Fields of the 200 answer
accrued_this_periodobjectRequired

What has accrued this month so far.

Fields
amountstringRequired
currencystringRequired
balanceobjectRequired

What has accrued and is not invoiced yet, plus what is outstanding on open invoices.

Fields
amountstringRequired
currencystringRequired
credits_availableobjectRequired
Fields
amountstringRequired
currencystringRequired
currencystringRequired
last_accrual_atstring or nullRequired

The last hour that was accrued. Format: date-time.

linesarray of objectsRequired
Fields of each item
accruedobjectRequired

What the line has accrued this month.

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
hourlyobjectRequired

The line's price for one hour, with six decimal places.

Fields
amountstringRequired
currencystringRequired
hoursintegerRequired
monthlyobjectRequired
Fields
amountstringRequired
currencystringRequired
next_invoice_atstringRequired

Format: date-time.

outstandingobjectRequired

What is due on open invoices.

Fields
amountstringRequired
currencystringRequired
periodobjectRequired

This month (UTC).

Fields
endstring or nullRequired

Format: date-time.

startstringRequired

Format: date-time.

recent_activityarray of objectsRequired
Fields of each item
amountobjectRequired
Fields
amountstringRequired
currencystringRequired
atstring

Format: date-time.

contract_idinteger

At least 1.

currencystring
descriptionstring
invoiceobject or any or null
kindstringRequired
usage_mtdinvoicepaymentrefundcredit_appliedcredit_grantadjustment
productstring
throughstring or null

The last hour the running figure counts. Format: date-time.

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/balance \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "accrued_this_period": {
    "amount": "337.10",
    "currency": "GBP"
  },
  "balance": {
    "amount": "1057.10",
    "currency": "GBP"
  },
  "credits_available": {
    "amount": "25.00",
    "currency": "GBP"
  },
  "currency": "GBP",
  "last_accrual_at": null,
  "lines": [
    {
      "accrued": {
        "amount": "337.10",
        "currency": "GBP"
      },
      "contract_line": {
        "id": 9001,
        "kind": "package",
        "label": "CC8"
      },
      "hourly": {
        "amount": "0.806452",
        "currency": "GBP"
      },
      "hours": 418,
      "monthly": {
        "amount": "600.00",
        "currency": "GBP"
      }
    }
  ],
  "next_invoice_at": "2027-02-01T00:30:00Z",
  "outstanding": {
    "amount": "720.00",
    "currency": "GBP"
  },
  "period": {
    "end": "2027-02-01T00:00:00Z",
    "start": "2027-01-01T00:00:00Z"
  },
  "recent_activity": [
    {
      "amount": {
        "amount": "337.10",
        "currency": "GBP"
      },
      "contract_id": 5120,
      "currency": "GBP",
      "kind": "usage_mtd",
      "product": "CC8 · Northwind UK 1",
      "through": null
    },
    {
      "amount": {
        "amount": "25.00",
        "currency": "GBP"
      },
      "at": "2027-01-12T14:20:00Z",
      "description": "Credit granted · Goodwill credit",
      "invoice": null,
      "kind": "credit_grant"
    },
    {
      "amount": {
        "amount": "720.00",
        "currency": "GBP"
      },
      "at": "2027-01-01T00:30:00Z",
      "description": "Invoice CF-100057",
      "invoice": {
        "id": 8140,
        "number": "CF-100057"
      },
      "kind": "invoice"
    },
    {
      "amount": {
        "amount": "-660.00",
        "currency": "GBP"
      },
      "at": "2026-12-01T00:31:12Z",
      "description": "Payment for CF-100042",
      "invoice": {
        "id": 8123,
        "number": "CF-100042"
      },
      "kind": "payment"
    },
    {
      "amount": {
        "amount": "-60.00",
        "currency": "GBP"
      },
      "at": "2026-12-01T00:30:00Z",
      "description": "Credit applied to CF-100042",
      "invoice": {
        "id": 8123,
        "number": "CF-100042"
      },
      "kind": "credit_applied"
    },
    {
      "amount": {
        "amount": "720.00",
        "currency": "GBP"
      },
      "at": "2026-12-01T00:30:00Z",
      "description": "Invoice CF-100042",
      "invoice": {
        "id": 8123,
        "number": "CF-100042"
      },
      "kind": "invoice"
    },
    {
      "amount": {
        "amount": "50.00",
        "currency": "GBP"
      },
      "at": "2026-11-01T09:00:00Z",
      "description": "Credit granted · Welcome credit",
      "invoice": null,
      "kind": "credit_grant"
    }
  ]
}
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