Skip to content

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

daysintegerrequired
Days before the due date: 7, 14 or 30. 0 means each product’s own lead. One of 0, 7, 14, 30.

Example

PATCH /api/v2/account/invoice-lead
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
}'

Responses

200 The invoice timing as saved.

{
"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.

400Send days as 0, 7, 14 or 30 and no other field.
401Unauthorized. Authentication is required.
403The API key lacks write:billing. A session that is not the account owner gets it too.
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 change could not be confirmed. Read the setting again before you retry.