## GET /api/v2/account/invoice-lead

**Get invoice timing**

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`](/endpoints/account/patch-v2-account-invoice-lead/) while `actions.canChange.allowed` is `true`.

### Related Endpoints

- `PATCH /api/v2/account/invoice-lead`: Update invoice timing
- `GET /api/v2/account/service-consolidation`: Get monthly service invoice preferences
- `PATCH /api/v2/account/service-consolidation`: Update monthly service invoice preferences

### Headers

- `Authorization`: Bearer $HOSTUP_API_KEY
- Scope: `read:billing`

### Request Example

```bash
curl "https://cloud.hostup.se/api/v2/account/invoice-lead" \
  -H "Authorization: Bearer $HOSTUP_API_KEY"
```

### Response Schema

- `days` (integer, required, nullable): Days before the due date that renewal invoices are created. `null` when each product's own lead applies.
- `source` (string, required, nullable): 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.
  Allowed values: default, customer, staff
- `available` (boolean, required): `false` while the setting is temporarily unavailable.
- `actions` (object, required)
- `actions.canChange` (object, required): Whether the value can be changed now.
- `actions.canChange.allowed` (boolean, required): `true` when `PATCH /api/v2/account/invoice-lead` can change the value now.
- `actions.canChange.reason` (string, required, nullable): Why the value cannot be changed. `null` when `allowed` is `true`.

### Responses

#### 200 - Current invoice timing.
```json
{
  "days": 30,
  "source": "customer",
  "available": true,
  "actions": {
    "canChange": {
      "allowed": true,
      "reason": null
    }
  }
}
```

#### 400 - Invalid request. The response body is an RFC 7807 Problem Details document.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request is invalid.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 401 - Unauthorized. Authentication is required.
```json
{
  "type": "https://developer.hostup.se/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authentication is required.",
  "code": "unauthorized",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 403 - The API key lacks `read:billing`.

#### 404 - Not found. The resource does not exist or is not owned by the caller.
```json
{
  "type": "https://developer.hostup.se/errors/not_found",
  "title": "Not found",
  "status": 404,
  "detail": "The requested resource could not be found.",
  "code": "not_found",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 429 - Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
```json
{
  "type": "https://developer.hostup.se/errors/rate_limit_exceeded",
  "title": "Too many requests",
  "status": 429,
  "detail": "Rate limit exceeded. Please try again later.",
  "code": "rate_limit_exceeded",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 500 - Internal error. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/internal_error",
  "title": "Internal server error",
  "status": 500,
  "detail": "An unexpected error occurred. Retry later or contact support if the issue persists.",
  "code": "internal_error",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 503 - Invoice timing could not be loaded. Try again.
```json
{
  "type": "https://developer.hostup.se/errors/billing_state_unavailable",
  "title": "Invoice timing",
  "status": 503,
  "detail": "Invoice timing could not be loaded. Please try again.",
  "code": "billing_state_unavailable",
  "instance": "/api/v2/account/invoice-lead"
}
```
