WhaleAPI(Public)
  1. Accounts
WhaleAPI(Public)
  • Passthrough Headers
  • Generate signature
  • Account Trade Auth
    • Trade Password Auth(交易密码校验)
      POST
    • Trade Password Set(交易密码设置)
      POST
    • Trade Password Reset(交易密码修改/重置)
      POST
    • Account No. Login Password Auth 证券帐号登录密码校验
      POST
  • Accounts
    • Whale Record Agreement(同步签署协议状态)
      POST
    • Get Account Trade Permission(获取账户交易权限)
      GET
    • Update Account Trade Permission(更新账户权限)
      POST
    • Retrieve Account Application Information(获取证券账户开户资料信息)
      GET
    • Get Account List(获取用户账户列表)
      GET
    • Get Account Request List(获取用户开户申请列表)
      GET
    • Get Account Contact Info(获取账户联系方式)
      GET
    • Get Account Status(获取账户状态)
      POST
    • Get Account Bcan Information(获取账户 Bcan 信息)
      GET
    • Query Account List V2(获取账户列表V2)
      GET
    • Update Application(修改开户资料)
      POST
    • Update Account State/Disable Account(修改账户状态 / 冻结账户)
      POST
    • Submit Application V2(提交开户申请资料 V2)
      POST
    • Update Application V2(修改开户资料 V2)
      POST
    • Close Account(注销账户)
      POST
    • Open additional account(增开账户)
      POST
    • get account opening application information (开户申请信息获取)
      POST
    • Query Account Risk And Pi Info(获取用户风险测评以及Pi信息)
      GET
  • Asset
    • Query Total Holdings(查询全量股票持仓)
      GET
    • Query Account Cash Balance(账户现金查询)
      GET
    • Query Total Cash(查询全量现金)
      GET
    • Query Account Position(账户持仓查询)
      GET
    • Account Cash Balance Adjustment(账户资金调账)
      POST
    • Account Position Adjustment(账户持仓调账,只支持股票)
      POST
    • Account Cash Balance Freeze(账户资金冻结)
      POST
    • Account Cash Balance Unfreeze(账户资金解冻)
      POST
    • Account Cash Balance Unfreeze Debit(账户资金解冻扣款)
      POST
    • Account Stock Transaction History(账户股票流水)
      POST
    • Account Cash Transaction History(账户资金流水)
      POST
    • Account Stock Freeze Transaction History(账户股票冻结流水)
      GET
    • Account Cash Freeze Transaction History(账户资金冻结流水)
      GET
    • Query Limited Amount Information(限额信息查询)
      GET
    • Query Buy Power(购买力查询)
      GET
    • Query Short Sellable Quantity(可卖空数量查询)
      GET
    • Query OB Account Cash Balance(账户现金详情查询)【定制非通用】
      POST
    • Query Account Total Asset(账户资产查询)
      POST
    • Query account risk limit config(查询用户限额信息)
      GET
    • Query Account Total Asset OverView(账户资产总览)
      GET
    • Query HashKey Cash List(查询hashkey的现金列表)
      GET
    • Create account risk limit config(创建用户限额信息)
      POST
    • Update account risk limit config(更新用户限额信息)
      POST
    • Temp Adjust 临时调账新增
      POST
    • Temp Adjust Expire 临时调账手动失效
      POST
    • Get All Users Cash Balance (获取所有用户现金信息)
      GET
    • Temporary Adjustment(临时调账)
      POST
  • Billing
    • Fee estimate(费用预估)
  • Cash And Stocks Transfer
    • Add Bank Card
    • Delete Bank Card
    • Region Bank
    • Get User Bank Card List
    • User Card Detail
    • Deposit Detail
    • Submit Deposit Application
    • Deposit Application List
    • Update Bank Card
    • Obtain the deposit information
    • Withdraw Records
    • Withdraw Detail
    • Cancel Withdraw Application
    • Get Exchange
    • Cancel Deposit
    • Submit Withdrawal Applylication
    • Information acquisition before withdrawal v3 (提现前信息获取V3)
    • Update Bank Card
    • Submit Files For Review Withdraw Card
    • Currency List
    • Exchange records(兑换记录)
    • Stock transfer out detail (查看转出详情)
    • Stock transfer out records (查询转出记录)
    • Transfer in detail (查看转入详情)
    • Transfer in records (查询转入记录)
  • File
    • Get Tenant File Upload URL(获取租户文件上传链接)
  • IPO
    • Get Available IPO List(查詢可申购IPO列表)
    • Get IPO Detail Info(查詢IPO详情)
    • Get IPO Payable List(查詢申购股数单位等限制)
    • Get IPO Margin List(查詢IPO认购方式及费率方案)
    • Get Order List (查询IPO历史订单)
    • Submit New IPO Order(提交IPO申购)
    • Withdraw IPO Order(撤销IPO申请)
    • Amend IPO Order(修改IPO申购订单)
    • Get IPO Order Detail(获取IPO订单的详细信息)
    • Buy Limit (持仓打新购买力获取接口)
  • Member Core
    • Update PI Status
    • Change Member Mobile Phone(修改用户登录手机号)
    • Get Member Information by Mobile Phone(登录手机号查询用户信息)
    • Login (New user registration by default for the first login).(OpenId 注册登录接口,首次登录即注册)
    • Get Member Information by Login Email(登录邮箱查询用户信息)
    • Change Member Login Email(修改用户登录邮箱)
    • Logout By Session ID
  • Trade
    • Trade Websocket Notification
    • Historical Trade Detail Inquiry V2(历史成交明细查询V2)
    • Trade Detail Inquiry V3(成交明细查询V3)
    • Withdraw User Orders (批量撤销用户订单)
    • Historical Order Inquiry (历史订单查询)
    • Place Order (委托下单)
    • Modify Order (修改订单)
    • Withdraw Order (撤销订单)
    • Order Details (订单详情)
    • Today's Order Inquiry (当日订单查询)
    • Estimated Maximum Purchase Quantity (预估最大购买数量)
    • Today's Trade Detail Inquiry (当日成交明细查询)
    • Historical Trade Detail Inquiry (历史成交明细查询)
  • Message
    • Global Push Templates(全局推送模板)
    • Device Logout (设备登出解绑)
  • Search
    • Search Stock
  • Reward Center
    • 奖励中心- 发放奖励
    • 奖励中心 - 查询奖励状态
  • OpenAPI
    • Create Access Key
    • GetAccessKey
    • List Access Keys
    • Update Access Key
    • Disable Access Key
    • Enable Access Key
    • Renew Access Token
    • Revoke Access Token
  1. Accounts

Update Account Trade Permission(更新账户权限)

POST
/v1/whaleapi/account/update_account_trade_permission

WhaleUpdateAccountTradePermission#

概述#

Whale 在账户开户成功后通过 (account_no, [changes...]) 入参一次性变更账户的一项或多项交易权限(账户基础权限 / 市场交易 / 交易渠道,本期不含风险声明问卷类),绕过后台工单审批,加快「开户后即开通港美股」类客户体验。
多条 change 之间是「同时生效」语义——整批原子写库,要么全成要么全失败,不存在半完成态。

请求参数#

顶层字段#

字段类型必填说明
account_nostring是证券账号,对应 accounts.origin_id
changesPermissionChange[]是权限变更列表,N ≥ 1

PermissionChange#

字段类型必填说明
permission_typestring是形如 {product}.{market},如 stock.US;合法值见下表
permission_statusstring是只接受 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.OSLOSL 通道
va.HASHashKey 通道

交易渠道 trade.*#

permission_type含义
trade.client网上交易
trade.bo柜台交易
trade.fixFIX 通道
trade.openapiOpen API

本期不支持#

flag.* 整组(flag.options / flag.warrant / flag.shortsell ...)调用即返回「枚举不合法」错误,不会落库。

响应参数#

字段类型说明
failure_indexint32前置校验 fail-fast 时,挂的那条 change 在 changes 数组中的下标(0 起);其他情况不设(零值)

failure_index 在各场景下的取值#

场景failure_index
全部成功不设(零值)
前置校验失败 — 枚举不合法触发条 change 的下标
前置校验失败 — permission_status 不合法触发条 change 的下标
前置校验失败 — 变更前后状态一致触发条 change 的下标
账户级错误 — 账户不存在 / 已注销不设(零值)

WhaleUpdateAccountTradePermission#

Overview#

After a successful account opening, Whale can update one or multiple trade permissions of an account in a single call via (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.
Multiple changes share all-or-nothing semantics — the entire batch is written atomically: either every change succeeds, or none takes effect. There is no half-applied state.

Request Parameters#

Top-level Fields#

FieldTypeRequiredDescription
account_nostringYesSecurities account number, mapped to accounts.origin_id
changesPermissionChange[]YesList of permission changes, N ≥ 1

PermissionChange#

FieldTypeRequiredDescription
permission_typestringYesFormat: {product}.{market}, e.g. stock.US; see the table below for valid values
permission_statusstringYesOnly 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 entire flag.* group is rejected in this iteration.

Market Codes#

CodeMeaning
HKHong Kong stocks
USUS stocks
SHShanghai A-shares
SZShenzhen A-shares
SGSingapore
JPJapan
UKUnited Kingdom
DEGermany
AUAustralia

Account-level Permissions account.*#

permission_typeMeaning
account.tradeAccount-level trading switch
account.exchangeCurrency exchange
account.rolloverPosition transfer
account.withdrawWithdrawal
account.depositDeposit
account.public_fundsPublic mutual funds
account.private_fundsPrivate funds
account.otcOTC market
account.balance_fundsBalance 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_typeMeaning
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_typeMeaning
va.OSLOSL channel
va.HASHashKey channel

Trade Channels trade.*#

permission_typeMeaning
trade.clientOnline trading
trade.boBack-office (counter) trading
trade.fixFIX channel
trade.openapiOpen API

Not Supported in This Iteration#

Any call referencing the flag.* group (flag.options / flag.warrant / flag.shortsell ...) returns an "invalid enum" error and is not persisted.

Response Parameters#

FieldTypeDescription
failure_indexint32When 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#

Scenariofailure_index
All succeedUnset (zero value)
Pre-validation failure — invalid enumIndex of the offending change
Pre-validation failure — invalid permission_statusIndex of the offending change
Pre-validation failure — no actual state changeIndex of the offending change
Account-level error — account not found / deregisteredUnset (zero value)
Write-phase failure — DB error, etc.Unset (zero value)

Request

Authorization
Body Params application/json
account_no
string 
required
证券账号(Account)
changes
array [object {2}] 
required
权限变更项 (Permission change list)
permission_type
string 
required
需要修改的权限类型,如:otc.US; stock.HK (Permission type to update, e.g. otc.US, stock.HK)
permission_status
string 
required
权限目标状态,如:close/open (Permission status, e.g. close / open)
Example
{
  "account_no": "string",
  "changes": [
    {
      "permission_type": "string",
      "permission_status": "string"
    }
  ]
}

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2026-06-15 02:57:10
Previous
Get Account Trade Permission(获取账户交易权限)
Next
Retrieve Account Application Information(获取证券账户开户资料信息)