Skip to content

OpenAPI order placement rejected with 602315 (Mainland China regulatory) even from a US egress, while the desktop App places orders normally #1150

Description

@ELH982

OpenAPI order placement rejected with 602315 (Mainland China regulatory) even from a US egress, while the desktop App places orders normally

English

Environment

  • SDK / CLI: Longbridge OpenAPI CLI longbridge v0.24.0
  • OS: macOS
  • Account: live account (not paper), with valid market-data and trading permissions
  • Network: the request was confirmed to egress from a US IP (verified via curl to ip-api)

Problem

When placing an order via longbridge order buy <symbol> 1 --order-type MO, the server consistently returns:

API error (code 602315): Due to Mainland China regulatory requirements,
you are currently located in Mainland China and cannot perform this action.
trace_id: <redacted — can provide privately>

Key contradiction: the same account can place orders normally in the Longbridge desktop/mobile App — only the OpenAPI / CLI channel is blocked by 602315.

What I've already ruled out

Attempt Result
Switched to the .com global endpoint (LONGBRIDGE_API_URL=https://openapi.longbridge.com) Still 602315
Deleted ~/.longbridge/openapi/region-cache (was cn, which forces requests back to .cn); verbose confirmed it truly connected to .com Still 602315
Forced the request through a US egress (verified US exit IP) Still 602315
Set TZ=America/New_York to change the reported timezone Still 602315
Read-only endpoints (assets / max-qty / positions / quote / option quote) All work fine, no restriction

In short: all read-only endpoints work normally; only order buy/sell is blocked, and changing the endpoint, egress IP, and timezone all had no effect.

Questions

  1. What is the determining criterion for 602315? Is it not based on the request IP, but rather on the account's KYC registered country of residence / a device or identity fingerprint?
  2. Why can the same account place orders in the App but not via OpenAPI? Are the App and OpenAPI two independent compliance-check channels?
  3. If this live account needs to place orders programmatically via OpenAPI, is there a regional whitelist / enablement process / compliant channel available?
  4. Could the 6023xx trading error-code range be documented officially? It's currently missing from the public Error Codes page.

中文

环境

  • SDK / CLI:Longbridge OpenAPI CLI longbridge v0.24.0
  • 系统:macOS
  • 账户:真实账户(非模拟盘),行情与交易权限均正常
  • 网络:下单请求已确认从美国 IP 出口(通过 curl 访问 ip-api 验证)

现象

调用 longbridge order buy <symbol> 1 --order-type MO 下单时,服务端始终返回:

API error (code 602315): Due to Mainland China regulatory requirements,
you are currently located in Mainland China and cannot perform this action.
trace_id: <已隐去,可私下提供>

关键矛盾点:同一账户在 Longbridge 桌面/手机 App 上可以正常下单,只有 OpenAPI / CLI 这条通道 被 602315 拦截。

已排查并排除的因素

尝试的手段 结果
切换到 .com 全球接口(LONGBRIDGE_API_URL=https://openapi.longbridge.com 仍 602315
删除 ~/.longbridge/openapi/region-cache(原值 cn,会把请求强锁回 .cn),verbose 确认已真正连上 .com 仍 602315
强制请求从美国 IP 出口(已验证出口为美国) 仍 602315
设置 TZ=America/New_York 修改上报时区 仍 602315
只读接口(assets / max-qty / positions / quote / option quote 全部正常,不受限制

即:行情、账户查询、期权报价等只读接口完全正常,唯独 order buy/sell 下单被拦;且换接口、换出口 IP、改时区均无效。

疑问

  1. 602315 的判定依据是什么?是否不基于请求 IP,而是账户 KYC 注册居住地 / 设备或身份指纹?
  2. 为什么同一账户 App 能下单、OpenAPI 不能?App 与 OpenAPI 是否是两套独立的合规判定通道?
  3. 该真实账户如需通过 OpenAPI 自动化下单,是否存在地域白名单 / 开通方式 / 合规通道?
  4. 6023xx 段交易类错误码能否在官方文档中公开说明?目前《Error Codes》页未收录。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions