## Account (`account`)

The current users own balance and freeze status; admins manage other users accounts through the user account endpoints.

Authentication: User · Docs: https://www.gocdn888.com/en/docs/api/account

### GET `/api/v2/account`

Get my account · Authentication: User

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

### PUT `/api/v2/account/currency`

Change my account currency · Authentication: User

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `currency` | string | Yes | Account currency (ISO 4217); balance, recharges and deductions are all kept in it. |

```sh
curl -X PUT "https://panel.example.com/api/v2/account/currency" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"currency":"USD"}'
```

Account object:

| Field | Type | Required | Description |
|---|---|---|---|
| `active_packages` | integer |  | Number of active packages (end_at in the future; one of the blockers for changing the account currency). Only the admin GET /users/{user_id}/account returns it. |
| `balance_cents` | integer |  | Account balance in cents. |
| `currencies` | AccountCurrencyOption[] |  | Selectable enabled currencies (base first, then by code); only present when currency_changeable is true, only in GET /account and the admin GET /users/{user_id}/account. |
| `currency` | string |  | Account currency (ISO 4217); balance, recharges and deductions are all kept in it. |
| `currency_changeable` | boolean |  | Whether the tenant can change the account currency now (zero balance, no unpaid orders, no active packages). Only GET /account and the admin GET /users/{user_id}/account return it. |
| `default_currency` | string |  | Default account currency for new users (ISO 4217); lets the tenant UI tell whether the account currency was never changed (only then is it preselected by UI language). Sent together with currencies, only when currency_changeable is true, only in GET /account and the admin GET /users/{user_id}/account. |
| `freeze_reason` | string |  | Freeze reason; empty if not frozen. |
| `frozen` | boolean |  | Whether the account is frozen; deductions are rejected while frozen. |
| `unpaid_orders` | integer |  | Number of unpaid orders (one of the blockers for changing the account currency). Only the admin GET /users/{user_id}/account returns it. |
| `updated_at` | string |  | Updated at |
| `user_id` | integer |  | User ID |
