Get invoice timing
GET /api/v2/account/invoice-lead
Returns how many days before the due date the account’s renewal invoices are created and sent. One value covers every service and domain renewal on the account. days: null means each product’s own lead applies: 30 days for web hosting and domains, 14 days for VPS. Change the value with PATCH /api/v2/account/invoice-lead while actions.canChange.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/invoice-lead" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Current invoice timing.
{ "days": 30, "source": "customer", "available": true, "actions": { "canChange": { "allowed": true, "reason": null } }}{ "days": null, "source": null, "available": true, "actions": { "canChange": { "allowed": true, "reason": null } }}{ "days": null, "source": null, "available": false, "actions": { "canChange": { "allowed": false, "reason": "Invoice timing is temporarily unavailable. Please try again later." } }}Response fields
daysinteger or nullDays before the due date that renewal invoices are created.
null when each product’s own lead applies.sourcestring or nullWho set the value:
default (a default Hostup applies), customer (chosen on the account) or staff (set by Hostup support). null when no value is set. One of default, customer, staff.availablebooleanfalse while the setting is temporarily unavailable.actionsobjectcanChangeobjectWhether the value can be changed now.
allowedbooleantrue when PATCH /api/v2/account/invoice-lead can change the value now.reasonstring or nullWhy the value 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 | Unauthorized. 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 | Invoice timing could not be loaded. Try again. |