Update invoice timing

PATCH /api/v2/account/invoice-lead

How many days before the due date the account's renewal invoices are created and sent.

The value applies to every service and domain renewal on the account and takes effect from the next renewal; the due date itself does not change.

Standard (null) means each product's own lead: 30 days for web hosting and domains, 14 for VPS.

Monthly-only hosting customers without domains get 14 days by default; a customer's own choice is never changed by that default.

Read actions.canChange before offering a change.

Changing it requires account-owner access or an explicitly scoped API key.

After a 503, reload before retrying.

Account & Access Account

Authentication

Required API scope: write:billing

Authenticate with an API key in the Authorization: Bearer <token> header.

Context

Headers

Authorization Bearer <token>
Accept application/json
Content-Type application/json

Body

required
application/json
days integer · enum required

0 = standard (product lead), or 7, 14 or 30 days before the due date.

0
7
14
30

Responses

200 Current invoice timing.
days integer · nullable · enum required

Days before the due date renewal invoices are created, or null when each product's own lead applies (30 for web hosting and domains, 14 for VPS).

7
14
30
source string · nullable · enum required

Who set the current value.

default
customer
staff
available boolean required
actions object required
actions.canChange object required
actions.canChange.allowed boolean required
actions.canChange.reason string · nullable required

Nullable: may be null when not applicable.

400 days must be 0, 7, 14 or 30.

No response body

401 Unauthorized. Authentication is required.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
403 No customer account selected, or not the account owner.

No response body

404 Not found. The resource does not exist or is not owned by the caller.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
429 Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
500 Internal error. Retry later or contact support if the issue persists.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
503 Invoice timing could not be read or confirmed; reload before retrying.

No response body

PATCH https://cloud.hostup.se/api/v2/account/invoice-lead
For AI assistants
View as Markdown
cURL
curl -X PATCH "https://cloud.hostup.se/api/v2/account/invoice-lead" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "days": 0
  }'
Response
// Customer chose 30 days
{
  "days": 30,
  "source": "customer",
  "available": true,
  "actions": {
    "canChange": {
      "allowed": true,
      "reason": null
    }
  }
}

// Reset to the standard product lead (days 0)
{
  "days": null,
  "source": null,
  "available": true,
  "actions": {
    "canChange": {
      "allowed": true,
      "reason": null
    }
  }
}
Request Body
{
  "days": 0
}