Skip to content

Get billing account

GET /api/v2/billing/account

Returns the account’s billing details: name, e-mail, country, account type, account credit and registration identifier. creditBalance is the account credit available for paying invoices, in the account currency currencyCode. Which payment methods an invoice accepts is on that invoice’s paymentMethods, not here.

Authentication: An API key with the scope read:billing. About keys and scopes

Example

GET /api/v2/billing/account
curl "https://cloud.hostup.se/api/v2/billing/account" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 Billing details of the account.

Response 200
{
"name": "Alex Example",
"firstName": "Alex",
"lastName": "Example",
"companyName": null,
"email": "[email protected]",
"countryCode": "SE",
"accountType": "private",
"creditBalance": 150,
"currencyCode": "SEK",
"registrationIdentifier": null
}
Response fields
namestring
Company name when set, otherwise the account holder’s full name.
firstNamestring or null
First name of the account holder.
lastNamestring or null
Last name of the account holder.
companyNamestring or null
Company name, when the account has one.
emailstring
Billing e-mail address.
countryCodestring or null
Billing country, ISO 3166-1 alpha-2.
accountTypestring
organisation for a company account, otherwise private. One of private, organisation.
creditBalancenumber
Account credit in major units of currencyCode.
currencyCodestring
Account currency, ISO 4217.
registrationIdentifierobject | null
Organisation or personal number on the account. null when none is stored.
valuestring
The identifier, formatted for display.
countryCodestring or null
Country the identifier belongs to, when stored.
typestring
organization_number or personal_identifier for a valid Swedish number, otherwise unknown. One of organization_number, personal_identifier, unknown.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
503The billing details could not be loaded. Try again shortly.