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
curl "https://cloud.hostup.se/api/v2/billing/account" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Billing details of the account.
{ "name": "Alex Example", "firstName": "Alex", "lastName": "Example", "companyName": null, "countryCode": "SE", "accountType": "private", "creditBalance": 150, "currencyCode": "SEK", "registrationIdentifier": null}Response fields
namestringCompany name when set, otherwise the account holder’s full name.
firstNamestring or nullFirst name of the account holder.
lastNamestring or nullLast name of the account holder.
companyNamestring or nullCompany name, when the account has one.
emailstringBilling e-mail address.
countryCodestring or nullBilling country, ISO 3166-1 alpha-2.
accountTypestringorganisation for a company account, otherwise private. One of private, organisation.creditBalancenumberAccount credit in major units of
currencyCode.currencyCodestringAccount currency, ISO 4217.
registrationIdentifierobject | nullOrganisation or personal number on the account.
null when none is stored.valuestringThe identifier, formatted for display.
countryCodestring or nullCountry the identifier belongs to, when stored.
typestringorganization_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.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |
| 503 | The billing details could not be loaded. Try again shortly. |