## Upgrade packs (`package-upgrades`)

Quotas or features bought per unit on top of a base package.

Authentication: Admin only · Docs: https://www-demo.kuxitong.com/en/docs/api/package-upgrades

### GET `/api/v2/package-upgrades`

List upgrade packs · Authentication: Admin only

Query parameters:

| Field | Type | Required | Description |
|---|---|---|---|
| `page` | integer |  | Page number, starting from 1 Default: 1 |
| `page_size` | integer |  | Items per page Default: 20 |
| `sort` | string |  | Sort fields, comma-separated; prefix `-` for descending, e.g. `-created_at,id` |

```sh
curl "https://panel.example.com/api/v2/package-upgrades" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### POST `/api/v2/package-upgrades`

Create upgrade pack · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | integer |  | Amount added per unit; always 1 for feature items (custom_cc_rule/websocket). |
| `bind_packages` | integer[] |  | Only these base packages may buy it; empty = no restriction. |
| `des` | string |  | Description |
| `enabled` | boolean |  | Whether enabled |
| `name` | string | Yes | Name |
| `price_cents` | integer | Yes | Price per unit per month, in cents. |
| `type` | string | Yes | Add-on item: traffic GB, domains, non-standard ports, TCP/UDP forwarding ports, custom CC, bandwidth Mbps, connections, WebSocket, dedicated IPs. Values: ["traffic","domain","http_port","stream_port","custom_cc_rule","bandwidth","connection","websocket","ip_num"] |

```sh
curl -X POST "https://panel.example.com/api/v2/package-upgrades" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":10,"name":"域名 +10","price_cents":1000,"type":"domain"}'
```

### GET `/api/v2/package-upgrades/{id}`

Get upgrade pack · Authentication: Admin only

```sh
curl "https://panel.example.com/api/v2/package-upgrades/{id}" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### PUT `/api/v2/package-upgrades/{id}`

Update upgrade pack · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | integer |  | Amount added per unit; always 1 for feature items (custom_cc_rule/websocket). |
| `bind_packages` | integer[] |  | Only these base packages may buy it; empty = no restriction. |
| `des` | string |  | Description |
| `enabled` | boolean |  | Whether enabled |
| `name` | string | Yes | Name |
| `price_cents` | integer | Yes | Price per unit per month, in cents. |
| `type` | string | Yes | Add-on item: traffic GB, domains, non-standard ports, TCP/UDP forwarding ports, custom CC, bandwidth Mbps, connections, WebSocket, dedicated IPs. Values: ["traffic","domain","http_port","stream_port","custom_cc_rule","bandwidth","connection","websocket","ip_num"] |

```sh
curl -X PUT "https://panel.example.com/api/v2/package-upgrades/{id}" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":10,"name":"域名 +10","price_cents":1000,"type":"domain"}'
```

### DELETE `/api/v2/package-upgrades/{id}`

Delete upgrade pack · Authentication: Admin only

```sh
curl -X DELETE "https://panel.example.com/api/v2/package-upgrades/{id}" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

Upgrade packs object:

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | integer |  | Amount added per unit; always 1 for feature items (custom_cc_rule/websocket). |
| `bind_packages` | integer[] |  | Only these base packages may buy it; empty = no restriction. |
| `created_at` | string |  | Created at (read-only) |
| `des` | string |  | Description |
| `enabled` | boolean |  | Whether enabled |
| `id` | integer |  | Record ID (read-only) |
| `name` | string |  | Name |
| `price_cents` | integer |  | Price per unit per month, in cents. |
| `type` | string |  | Add-on item: traffic GB, domains, non-standard ports, TCP/UDP forwarding ports, custom CC, bandwidth Mbps, connections, WebSocket, dedicated IPs. Values: ["traffic","domain","http_port","stream_port","custom_cc_rule","bandwidth","connection","websocket","ip_num"] |
| `updated_at` | string |  | Updated at (read-only) |
