Update invoice timing
PATCH /api/v2/account/invoice-lead
Sets how many days before the due date the account’s renewal invoices are created and sent. Send days as 7, 14 or 30. Send 0 to go back to each product’s own lead: 30 days for web hosting and domains, 14 days for VPS. The value covers every service and domain renewal on the account and applies from the next renewal. Due dates do not change. The response is the setting as saved. A 503 means the change could not be confirmed. Read the setting with GET /api/v2/account/invoice-lead before you retry.
Authentication: An API key with the scope write:billing. About keys and scopes
Request
Body
daysintegerrequiredDays before the due date: 7, 14 or 30. 0 means each product’s own lead. One of
0, 7, 14, 30.Example
curl -X PATCH "https://cloud.hostup.se/api/v2/account/invoice-lead" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "days": 30 }'curl -X PATCH "https://cloud.hostup.se/api/v2/account/invoice-lead" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "days": 0 }'Responses
200 The invoice timing as saved.
{ "days": 30, "source": "customer", "available": true, "actions": { "canChange": { "allowed": true, "reason": null } }}{ "days": null, "source": null, "available": true, "actions": { "canChange": { "allowed": true, "reason": null } }}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 | Send days as 0, 7, 14 or 30 and no other field. |
| 401 | Unauthorized. Authentication is required. |
| 403 | The API key lacks write:billing. A session that is not the account owner gets it too. |
| 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 change could not be confirmed. Read the setting again before you retry. |