# Prepaid Types

Prepaid payment categories for externally-paid tabs (e.g. third-party channels)

## GET /api/v1/prepaid-types

List prepaid types

List prepaid types for a location

**Permissions:** 🔵 `prepaid_types.read`

Query parameters:
- `locationId` (number, optional) — Filter by location ID (required)
- `includeArchived` (boolean, optional) — Include archived rows

Response 200 — Default Response

```ts
{
  status: "success"
  data: {
    prepaidTypes: Array<{
        id: string
        locationId: number
        code: string
        label: string
        sortOrder: number
        costCenterId: number | null
        inheritToChildren?: boolean
        requiresComment: boolean
        archivedAt: string | null // date-time
        createdAt: string // date-time
        updatedAt: string // date-time
      }>
  }
  meta: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```

## POST /api/v1/prepaid-types

Create prepaid type

Create a new prepaid type

**Permissions:** 🟢 `prepaid_types.create`

Request body:

```ts
{
  locationId: number
  code: string
  label: string
  sortOrder?: number
  costCenterId?: number | null
  inheritToChildren?: boolean
  requiresComment?: boolean
}
```

Response 201 — Default Response

```ts
{
  status: "success"
  data: {
    id: string
    locationId: number
    code: string
    label: string
    sortOrder: number
    costCenterId: number | null
    inheritToChildren?: boolean
    requiresComment: boolean
    archivedAt: string | null // date-time
    createdAt: string // date-time
    updatedAt: string // date-time
  }
  meta: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```

## GET /api/v1/prepaid-types/{id}

Get prepaid type

Get a single prepaid type by ID

**Permissions:** 🔵 `prepaid_types.read`

Path parameters:
- `id` (string, required) — Prepaid-type UUID

Response 200 — Default Response

```ts
{
  status: "success"
  data: {
    id: string
    locationId: number
    code: string
    label: string
    sortOrder: number
    costCenterId: number | null
    inheritToChildren?: boolean
    requiresComment: boolean
    archivedAt: string | null // date-time
    createdAt: string // date-time
    updatedAt: string // date-time
  }
  meta: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```

## PUT /api/v1/prepaid-types/{id}

Update prepaid type

Update an existing prepaid type

**Permissions:** 🟠 `prepaid_types.update`

Path parameters:
- `id` (string, required) — Prepaid-type UUID

Request body:

```ts
{
  code?: string
  label?: string
  sortOrder?: number
  costCenterId?: number | null
  inheritToChildren?: boolean
  requiresComment?: boolean
}
```

Response 200 — Default Response

```ts
{
  status: "success"
  data: {
    id: string
    locationId: number
    code: string
    label: string
    sortOrder: number
    costCenterId: number | null
    inheritToChildren?: boolean
    requiresComment: boolean
    archivedAt: string | null // date-time
    createdAt: string // date-time
    updatedAt: string // date-time
  }
  meta: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```

## DELETE /api/v1/prepaid-types/{id}

Archive prepaid type

Soft-delete a prepaid type by setting archived_at. Historical psp_events keep their snapshot.

**Permissions:** 🔴 `prepaid_types.delete`

Path parameters:
- `id` (string, required) — Prepaid-type UUID

Response 204 — Prepaid type archived

```ts
unknown
```
