Update Account Trade Permission(更新账户权限)
POST
/v1/whaleapi/account/update_account_trade_permission
WhaleUpdateAccountTradePermission
概述
(account_no, [changes...]) 入参一次性变更账户的一项或多项交易权限(账户基础权限 / 市场交易 / 交易渠道,本期不含风险声明问卷类),绕过后台工单审批,加快「开户后即开通港美股」类客户体验。请求参数
顶层字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
account_no | string | 是 | 证券账号,对应 accounts.origin_id |
changes | PermissionChange[] | 是 | 权限变更列表,N ≥ 1 |
PermissionChange
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
permission_type | string | 是 | 形如 {product}.{market},如 stock.US;合法值见下表 |
permission_status | string | 是 | 只接受 open / close,大小写敏感 |
permission_type 合法值
下表是代码层面支持的全集。实际可用子集由 sg_mexc的 SaaS Config 决定;本期flag.*整组一律拒绝。
市场代码
| 代码 | 含义 |
|---|---|
HK | 港股 |
US | 美股 |
SH | 沪 A |
SZ | 深 A |
SG | 新加坡 |
JP | 日本 |
UK | 英国 |
DE | 德国 |
AU | 澳洲 |
账户基础权限 account.*
| permission_type | 含义 |
|---|---|
account.trade | 账户级交易 开关 |
account.exchange | 换汇 |
account.rollover | 转仓 |
account.withdraw | 出金 |
account.deposit | 入金 |
account.public_funds | 公募基金 |
account.private_funds | 私募基金 |
account.otc | 场外交易市场 |
account.balance_funds | 余额通 |
市场交易权限
{MARKET} 从上方「市场代码」中取值,例如 stock.HK 表示港股股票市场。| permission_type | 含义 |
|---|---|
stock.{MARKET} | 股票市场(普通买卖) |
options.{MARKET} | 期权 |
shortsell.{MARKET} | 做空 / 融券 |
ipo.{MARKET} | 新股申购 |
warrant.{MARKET} | 窝轮 / 牛熊证 |
stockgrey.{MARKET} | 暗盘 |
otc.{MARKET} | 场外交易 |
虚拟资产 va.*
| permission_type | 含义 |
|---|---|
va.OSL | OSL 通道 |
va.HAS | HashKey 通道 |
交易渠道 trade.*
| permission_type | 含义 |
|---|---|
trade.client | 网上交易 |
trade.bo | 柜台交易 |
trade.fix | FIX 通道 |
trade.openapi | Open API |
本期不支持
flag.* 整组(flag.options / flag.warrant / flag.shortsell ...)调用即返回「枚举不合法」错误,不会落库。响应参数
| 字段 | 类型 | 说明 |
|---|---|---|
failure_index | int32 | 前置校验 fail-fast 时,挂的那条 change 在 changes 数组中的下标(0 起);其他情况不设(零值) |
failure_index 在各场景下的取值
| 场景 | failure_index |
|---|---|
| 全部成功 | 不设(零值) |
| 前置校验失败 — 枚举不合法 | 触发条 change 的下标 |
前置校验失败 — permission_status 不合法 | 触发条 change 的下标 |
| 前置校验失败 — 变更前后状态一致 | 触发条 change 的下标 |
| 账户级错误 — 账户不存在 / 已注销 | 不设(零值) |
WhaleUpdateAccountTradePermission
Overview
(account_no, [changes...]) — covering account-level permissions, market trading, and trade channels (the risk-disclosure questionnaire category is not included in this iteration). This bypasses back-office ticket approval and accelerates the "HK/US trading available right after account opening" customer experience.Request Parameters
Top-level Fields
| Field | Type | Required | Description |
|---|---|---|---|
account_no | string | Yes | Securities account number, mapped to accounts.origin_id |
changes | PermissionChange[] | Yes | List of permission changes, N ≥ 1 |
PermissionChange
| Field | Type | Required | Description |
|---|---|---|---|
permission_type | string | Yes | Format: {product}.{market}, e.g. stock.US; see the table below for valid values |
permission_status | string | Yes | Only open / close accepted, case-sensitive |
Valid permission_type Values
The table below lists the full set supported at the code level. The actually available subset is determined by the SaaS Config of sg_mexc; the entireflag.*group is rejected in this iteration.
Market Codes
| Code | Meaning |
|---|---|
HK | Hong Kong stocks |
US | US stocks |
SH | Shanghai A-shares |
SZ | Shenzhen A-shares |
SG | Singapore |
JP | Japan |
UK | United Kingdom |
DE | Germany |
AU | Australia |
Account-level Permissions account.*
| permission_type | Meaning |
|---|---|
account.trade | Account-level trading switch |
account.exchange | Currency exchange |
account.rollover | Position transfer |
account.withdraw | Withdrawal |
account.deposit | Deposit |
account.public_funds | Public mutual funds |
account.private_funds | Private funds |
account.otc | OTC market |
account.balance_funds | Balance funds (cash sweep) |
Market Trading Permissions
{MARKET} is one of the values from "Market Codes" above. For example, stock.HK denotes the Hong Kong equity market.| permission_type | Meaning |
|---|---|
stock.{MARKET} | Equity market (regular buy/sell) |
options.{MARKET} | Options |
shortsell.{MARKET} | Short selling / margin shorting |
ipo.{MARKET} | IPO subscription |
warrant.{MARKET} | Warrants / CBBC |
stockgrey.{MARKET} | Grey market |
otc.{MARKET} | OTC trading |
Virtual Assets va.*
| permission_type | Meaning |
|---|---|
va.OSL | OSL channel |
va.HAS | HashKey channel |
Trade Channels trade.*
| permission_type | Meaning |
|---|---|
trade.client | Online trading |
trade.bo | Back-office (counter) trading |
trade.fix | FIX channel |
trade.openapi | Open API |
Not Supported in This Iteration
flag.* group (flag.options / flag.warrant / flag.shortsell ...) returns an "invalid enum" error and is not persisted.Response Parameters
| Field | Type | Description |
|---|---|---|
failure_index | int32 | When pre-validation fails fast, this is the index (0-based) of the offending change in the changes array. Unset (zero value) in other cases. |
failure_index Across Scenarios
| Scenario | failure_index |
|---|---|
| All succeed | Unset (zero value) |
| Pre-validation failure — invalid enum | Index of the offending change |
Pre-validation failure — invalid permission_status | Index of the offending change |
| Pre-validation failure — no actual state change | Index of the offending change |
| Account-level error — account not found / deregistered | Unset (zero value) |
| Write-phase failure — DB error, etc. | Unset (zero value) |
Request
Body Params application/json
Responses
Modified at 2026-06-15 02:57:10