## GET /api/v2/account/service-consolidation

**Get monthly service invoice preferences**

Returns whether renewal invoices for monthly services are combined into one invoice a month. Monthly services are VPS and web hosting on monthly billing. Domain renewals have their own setting, `billing.separateInvoices` in [`PATCH /api/v2/me/preferences`](/endpoints/account/patch-v2-me-preferences/). Change this setting with [`PATCH /api/v2/account/service-consolidation`](/endpoints/account/patch-v2-account-service-consolidation/) while `actions.canToggle.allowed` is `true`.

### Related Endpoints

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

### Headers

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

### Request Example

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

### Response Schema

- `enabled` (boolean, required): `true` when renewal invoices for monthly services are combined into one invoice a month.
- `available` (boolean, required): `false` while the setting is temporarily unavailable.
- `suggestion` (object, required): Whether to suggest turning the setting on.
- `suggestion.show` (boolean, required): `true` when the account has two or more upcoming service renewals on different dates and the setting is off, not turned off on purpose and not dismissed.
- `suggestion.settingsUrl` (string, required): Client-area path to the setting.
- `actions` (object, required)
- `actions.canToggle` (object, required): Whether the setting can be changed now.
- `actions.canToggle.allowed` (boolean, required): `true` when `PATCH /api/v2/account/service-consolidation` can change the setting now.
- `actions.canToggle.reason` (string, required, nullable): Why the setting cannot be changed. `null` when `allowed` is `true`.

### Responses

#### 200 - Current setting.
```json
{
  "enabled": false,
  "available": true,
  "suggestion": {
    "show": true,
    "settingsUrl": "/account?tab=billing#service-invoices"
  },
  "actions": {
    "canToggle": {
      "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 - Authentication is required.
```json
{
  "type": "https://developer.hostup.se/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authentication is required. Provide a valid API key or session.",
  "code": "unauthorized",
  "instance": "/api/v2/account/service-consolidation"
}
```

#### 403 - The API key lacks `read:billing`.
```json
{
  "type": "https://developer.hostup.se/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "This endpoint requires an API key with the `read:billing` scope. Broader service keys also work. Update your key's permissions in the dashboard.",
  "code": "forbidden",
  "instance": "/api/v2/account/service-consolidation",
  "requiredScopes": [
    "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 - The setting could not be loaded. Try again.
```json
{
  "type": "https://developer.hostup.se/errors/billing_state_unavailable",
  "title": "Invoice preferences",
  "status": 503,
  "detail": "Invoice preferences could not be loaded. Please try again.",
  "code": "billing_state_unavailable",
  "instance": "/api/v2/account/service-consolidation"
}
```
