Skip to content

Get monthly service invoice preferences

GET /api/v2/account/service-consolidation

Returns whether renewal invoices for monthly services are combined into one invoice a month. Monthly services are VPS and web hosting on monthly billing. Domain renewals have their own setting, billing.separateInvoices in PATCH /api/v2/me/preferences. Change this setting with PATCH /api/v2/account/service-consolidation while actions.canToggle.allowed is true.

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

Example

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

Responses

200 Current setting.

Response 200
{
"enabled": false,
"available": true,
"suggestion": {
"show": true,
"settingsUrl": "/account?tab=billing#service-invoices"
},
"actions": {
"canToggle": {
"allowed": true,
"reason": null
}
}
}
Response fields
enabledboolean
true when renewal invoices for monthly services are combined into one invoice a month.
availableboolean
false while the setting is temporarily unavailable.
suggestionobject
Whether to suggest turning the setting on.
showboolean
true when the account has two or more upcoming service renewals on different dates and the setting is off, not turned off on purpose and not dismissed.
settingsUrlstring
Client-area path to the setting.
actionsobject
canToggleobject
Whether the setting can be changed now.
allowedboolean
true when PATCH /api/v2/account/service-consolidation can change the setting now.
reasonstring or null
Why the setting cannot be changed. null when allowed is true.

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.
401Authentication is required.
403The API key lacks read:billing.
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 setting could not be loaded. Try again.