Skip to content

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

GET /api/v2/account/invoice-lead
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
}
}
}
Response fields
daysinteger or null
Days before the due date that renewal invoices are created. null when each product’s own lead applies.
sourcestring or null
Who 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.
availableboolean
false while the setting is temporarily unavailable.
actionsobject
canChangeobject
Whether the value can be changed now.
allowedboolean
true when PATCH /api/v2/account/invoice-lead can change the value now.
reasonstring or null
Why 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.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication 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.
503Invoice timing could not be loaded. Try again.