## GET /api/v2/vps/paid-periods

**Read verified paid periods for VPS instances**

Cheap bounded batch read for up to 100 owned public VPS IDs from GET /api/v2/vps. Does not query hypervisors, change service dates, suspend instances or apply payments. Poll only refreshing results with bounded backoff. Paid-through dates are inclusive calendar dates in Europe/Stockholm. Unknown data is not evidence of unpaid service. Authentication and read:vm are required.

### Related Endpoints

- `GET /api/v2/vps`: List VPS instances
- `GET /api/v2/vps/{id}`: Get VPS details
- `GET /api/v2/vps/metrics`: List live VPS metrics

### Headers

- `Accept`: application/json
- `Authorization`: Bearer YOUR_API_KEY
- Required API scope: `read:vm`

### Parameters

- `ids` (query, string, required): Comma-separated list of 1–100 public VPS IDs. Example: `vps_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

```bash
curl -X GET "https://cloud.hostup.se/api/v2/vps/paid-periods?ids=vps_01hxa3b4c5d6e7f8g9h0j1k2m3" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

### Response Schema

- `results` (array<object>, required)
- `results[].vpsId` (string, required)
- `results[].paidPeriod` (object, required)
- `results[].paidPeriod.revision` (integer, required): Monotonic source revision used to reject stale responses.
- `results[].paidPeriod.refreshRevision` (integer, required): Refresh generation. Compare this before revision when merging concurrent reads.
- `results[].paidPeriod.status` (string, required)
  Allowed values: verified, refreshing, needs_review, unavailable
- `results[].paidPeriod.paidThroughDate` (string, required, nullable): Inclusive last verified paid calendar day in Europe/Stockholm. Not an invoice due date or a suspension instruction.
- `results[].paidPeriod.outstandingInvoiceDueDate` (string, required, nullable): Nullable (may be null when not applicable).
- `results[].paidPeriod.sourceInvoiceNumbers` (array<string>, required)
- `results[].paidPeriod.observedAt` (string, required, nullable): Nullable (may be null when not applicable).

### Responses

#### 200 - Paid-period evidence for every requested VPS.
```json
{
  "results": [
    {
      "vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m3",
      "paidPeriod": {
        "revision": 17,
        "refreshRevision": 3,
        "status": "verified",
        "paidThroughDate": "2026-09-30",
        "outstandingInvoiceDueDate": null,
        "observedAt": "2026-09-06T12:00:00Z",
        "sourceInvoiceNumbers": [
          "202600001"
        ]
      }
    }
  ]
}
```

#### 400 - invalid_request: invalid/oversized identifiers or unknown query fields.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/orders",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/eppCode",
      "detail": "`eppCode` is required for this transfer.",
      "code": "missing_required"
    }
  ],
  "extensions": {}
}
```

#### 401 - unauthorized: authentication required.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/orders",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/eppCode",
      "detail": "`eppCode` is required for this transfer.",
      "code": "missing_required"
    }
  ],
  "extensions": {}
}
```

#### 403 - forbidden: missing read:vm scope.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/orders",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/eppCode",
      "detail": "`eppCode` is required for this transfer.",
      "code": "missing_required"
    }
  ],
  "extensions": {}
}
```

#### 404 - vps_not_found: an identifier is absent or belongs to another customer.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/orders",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/eppCode",
      "detail": "`eppCode` is required for this transfer.",
      "code": "missing_required"
    }
  ],
  "extensions": {}
}
```

#### 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": "Too many requests. Retry after the limit resets.",
  "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 - service_billing_unavailable: ownership inventory could not be read.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/orders",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/eppCode",
      "detail": "`eppCode` is required for this transfer.",
      "code": "missing_required"
    }
  ],
  "extensions": {}
}
```
