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
curl "https://cloud.hostup.se/api/v2/account/service-consolidation" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Current setting.
{ "enabled": false, "available": true, "suggestion": { "show": true, "settingsUrl": "/account?tab=billing#service-invoices" }, "actions": { "canToggle": { "allowed": true, "reason": null } }}Response fields
enabledbooleantrue when renewal invoices for monthly services are combined into one invoice a month.availablebooleanfalse while the setting is temporarily unavailable.suggestionobjectWhether to suggest turning the setting on.
showbooleantrue 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.settingsUrlstringClient-area path to the setting.
actionsobjectcanToggleobjectWhether the setting can be changed now.
allowedbooleantrue when PATCH /api/v2/account/service-consolidation can change the setting now.reasonstring or nullWhy 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.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Authentication is required. |
| 403 | The API key lacks read:billing. |
| 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 setting could not be loaded. Try again. |