错误码
Brand OpenAPI 的所有响应(无论成功还是失败)都使用同一个 JSON 信封:
| 字段 | 何时出现 | 含义 |
|---|---|---|
code | 总是 | 业务码。0 表示成功。错误使用 5 位业务码(40000、40100、50000 …),不是 HTTP 状态码。 |
message | 总是 | 人类可读文案,按 Accept-Language 本地化(见多语言)。仅用于展示和日志,不要据此做分支判断。 |
error_key | 每个错误响应都有;成功响应没有 | 稳定的机器可读 key(如 card_is_closing),程序判断用这个,不随语言变化。 |
data | 成功时;部分错误 | 业务数据(列表接口在这里放分页对象)。错误时不出现,但带结构化详情的持卡人错误除外(如 {"field": "last_name"})—— 40000、40400 与 50000 响应都可能带,见持卡人。 |
{
"code": 0,
"message": "成功",
"data": { "card_id": "card_12345", "status": 2 }
}{
"code": 40000,
"message": "卡片正在注销中",
"error_key": "card_is_closing"
}先看 code,不要只看 HTTP 状态码
大部分业务错误(参数校验失败、余额不足、卡状态不符、接口内部已处理的服务端异常)都以 HTTP 200 返回。HTTP 200 本身不代表成功:读取 data 之前务必先判断 code == 0。
/api/v1/openapi/* 下返回的每一个错误都带 error_key:业务错误、鉴权失败(401)、访问受限(403)、卡不存在(404)、幂等冲突(409)、限流(429)、内部错误,甚至服务端未捕获的崩溃(500)。
HTTP 状态码与业务码
| 场景 | HTTP | code | error_key 示例 |
|---|---|---|---|
| 成功(含幂等回放) | 200 | 0 | — |
业务 / 参数校验不通过(ID 格式错、金额、卡状态、余额不足、缺少 Idempotency-Key …) | 200 | 40000 | openapi_invalid_card_id、insufficient_balance、card_is_closing |
| 请求体无法解析(不是 JSON,或字段的 JSON 类型不对) | 200 | 40001 | validation_failed |
| 鉴权失败(签名 / 时间戳 / nonce / AppID / 凭证或账号被停用) | 401 | 40100 | openapi_invalid_credentials |
| 鉴权通过但被限制(敏感信息二次验证、非激活卡取敏感信息、管理员封禁、解冻被平台冻结的卡) | 403 | 40300 | email_code_required、invalid_pin、openapi_sensitive_card_only_active、card_sensitive_access_banned、unauthorized_unfreeze_admin |
| 卡不存在 / 不属于当前账号(持卡人接口上还包括持卡人、持卡人影像与卡头) | 404 | 40400 | card_not_found、cardholder_not_found、cardholder_file_not_found、cardholder_header_not_found |
Idempotency-Key 被复用但请求体不同,或同 key 的请求仍在处理中 | 409 | 40900 | openapi_idempotency_key_conflict、openapi_idempotency_key_in_progress |
限流(按 (AppID, 客户端 IP) 计数的应用层限流、敏感信息验证锁定 / 发码冷却,或 API 前面的网关) | 429 | 42900 | too_many_requests(并带 Retry-After 响应头) |
| 接口内部已处理的服务端异常 | 200 | 50000 | openapi_recharge_failed、openapi_internal_error |
| 服务端未捕获的崩溃 | 500 | 50000 | internal_error(message 固定为 Internal Server Error,不做本地化) |
如何解读 code:
code | 含义 | 处理方式 |
|---|---|---|
0 | 成功 | 读取 data。 |
40000 / 40001 | 请求或当前状态不满足规则 | 按 error_key 分支;修正参数或等待状态变化。原样重试只会得到同样的错误。 |
40100 | 鉴权失败 | 见 401 错误处理。 |
40300 | 鉴权通过,但本次请求不被允许 | 按 error_key 分支(补交 / 更正二次验证,或停止)。 |
40400 | 卡(或持卡人 / 影像 / 卡头)不存在或不属于你 | 停止;核对你保存的 ID。 |
40900 | 幂等冲突 | …_in_progress:稍后用同一个 key 重试;…_conflict:不要重试,见幂等键。 |
42900 | 被限流 | 等待 Retry-After 秒后重试。 |
50000 | 服务端异常 | 稍后重试。写接口在换用新的 Idempotency-Key 之前,先确认实际结果(见充值)。 |
没有信封的响应
代理 / 负载均衡的错误页、请求不存在的路径、或使用了非 POST 方法时,响应可能不是上面的 JSON 信封。此时按 HTTP 状态码兜底:例如任何 HTTP 429 都按限流处理,任何 5xx 都按临时服务端错误处理。
完整 error_key 字典
zh-CN / en-US 两列是对每个 key 的说明,实际 message 文案可能略有不同。不要按 message 匹配。
通用
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
validation_failed | 请求体无法解析(不是合法 JSON,或字段类型不对) | Request body could not be parsed (invalid JSON, or a field with the wrong JSON type) | 200 | 40001 |
too_many_requests | 请求过于频繁,按 Retry-After 等待(见限流) | Too many requests — honor Retry-After | 429 | 42900 |
internal_error | 服务端未捕获的异常(message 固定为 Internal Server Error) | Unhandled server crash (message is always Internal Server Error) | 500 | 50000 |
鉴权与凭证
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
openapi_invalid_credentials | 无效的 OpenAPI 凭证(所有鉴权失败统一返回,见 401 错误处理) | Invalid OpenAPI credentials | 401 | 40100 |
ID 校验
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
openapi_invalid_header_id | header_id 不合法:缺前缀、格式错误,或卡头不存在 / 不可用 | Invalid header_id: missing prefix, malformed, or the header does not exist / is not available | 200 | 40000 |
openapi_invalid_package_id | package_id 缺失或格式不正确(应为 pkg_ 加数字,如 pkg_123) | Invalid package_id: missing or malformed (expected pkg_ followed by digits, e.g. pkg_123) | 200 | 40000 |
openapi_invalid_card_id | card_id 缺失或格式不正确(应为 card_ 加数字,如 card_123) | Invalid card_id: missing or malformed (expected card_ followed by digits, e.g. card_123) | 200 | 40000 |
openapi_invalid_cardholder_id | cardholder_id 缺失或格式不正确(应为 chd_ 加数字) | Invalid cardholder_id: missing or malformed (expected chd_ followed by digits) | 200 | 40000 |
openapi_invalid_cardholder_file_id | 持卡人影像 ID 格式不正确(应为 chf_ 加数字),data.field 指明字段 | A cardholder file ID is malformed (expected chf_ followed by digits); data.field names the field | 200 | 40000 |
格式正确、但不存在或属于其他账号的 card_id,在所有卡接口上都返回 HTTP 404 / 40400 card_not_found。见 ID 与前缀。
幂等
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
openapi_idempotency_key_required | 缺少 Idempotency-Key 请求头 | Missing Idempotency-Key header | 200 | 40000 |
openapi_idempotency_key_too_long | Idempotency-Key 超长(最大 128 字符) | Idempotency-Key too long (max 128 chars) | 200 | 40000 |
openapi_idempotency_key_invalid_chars | Idempotency-Key 含非法字符(仅允许可见 ASCII,不含空格) | Idempotency-Key contains invalid characters | 200 | 40000 |
openapi_idempotency_key_conflict | 同一 Idempotency-Key 但请求体不同 | Same Idempotency-Key with a different request body | 409 | 40900 |
openapi_idempotency_key_in_progress | 同 Idempotency-Key 的请求仍在处理中,请稍后重试 | A request with the same Idempotency-Key is still being processed | 409 | 40900 |
业务规则
由 /card/apply、/card_configs/list、/card/first_deposit/preview 及各卡接口返回。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
openapi_card_type_not_supported | 暂不支持该卡类型,仅虚拟卡 | Not supported (virtual cards only) | 200 | 40000 |
account_manager_bind_required | 该卡头需绑定客户经理后才能开通 | Account-manager-controlled header; bind an account manager first | 200 | 40000 |
account_manager_unavailable | 绑定的客户经理已失效,请联系客服 | Your account manager is no longer active; contact support | 200 | 40000 |
account_manager_open_disabled | 您的客户经理尚未对该账号开放此卡头 / 套餐 | Header / package not opened for your account by your account manager | 200 | 40000 |
card_not_found | 卡片不存在 / 不属于当前账号 | Card not found, or not owned by your account | 404 | 40400 |
insufficient_balance | 钱包余额不足(不冻结任何资金) | Insufficient wallet balance (nothing is frozen) | 200 | 40000 |
kyc_required | 账号需先完成平台实名认证(KYC) | The account must complete platform identity verification (KYC) first | 200 | 40000 |
card_open_risk_blocked | 历史拒付率 / 授权异常率过高,风控暂停开卡,请联系客服 | Card opening blocked by risk control; contact support | 200 | 40000 |
card_open_risk_card_quota_exceeded | 风控限制当前最多只能持有 1 张卡 | Risk control limits the account to 1 card for now | 200 | 40000 |
card_deposit_insufficient_balance | 押金余额不足 | Insufficient balance for the card security deposit | 200 | 40000 |
card_deposit_config_invalid | 该卡的押金配置不完整(平台配置问题) | Security-deposit configuration incomplete (platform configuration) | 200 | 40000 |
card_deposit_asset_not_found | 押金币种不存在或已下架(平台配置问题) | Security-deposit currency does not exist or was removed (platform configuration) | 200 | 40000 |
card_deposit_already_exists | 该卡已存在押金记录 | A deposit record already exists for this card | 200 | 40000 |
virtual_g_name_invalid | (G 卡)持卡人姓名不满足 ASCII 字母 / 单空格 / ≤40 字符规则 | (G card) cardholder name fails the rule | 200 | 40000 |
virtual_g_required_fields_missing | (G 卡)开卡资料不完整 | (G card) apply payload incomplete | 200 | 40000 |
virtual_a_required_fields_missing | (A 卡)first_name / last_name 缺失或为空白,或开卡资料不完整 | (A card) name missing/blank or apply payload incomplete | 200 | 40000 |
virtual_s921_required_fields_missing | (S921 卡)开卡配置不完整(卡头配置不完整或币种非 USD),请联系客服 | (S921 card) the card configuration is incomplete (header not fully configured or currency not USD) — contact support | 200 | 40000 |
virtual_s921_unified_webhook_not_subscribed | (S921 卡)平台侧该卡型的事件订阅不完整,暂不能开卡,冻结金额已退回钱包,请联系客服 | (S921 card) the platform-side event subscription for this card type is incomplete, so the card cannot be opened yet; frozen funds refunded — contact support | 200 | 40000 |
本页早期版本列出的
kyc_not_approved从不返回:账号未满足实名要求时,一律返回kyc_required。
首充(自定义金额)
当自定义 first_deposit_amount 不可受理时,由 /card/apply 作为 error_key 返回(HTTP 200 / 40000),由 /card/first_deposit/preview 作为成功响应(code: 0)中的 invalid_reason 返回。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
invalid_first_deposit_amount | first_deposit_amount 必须是非负整数 | first_deposit_amount must be a non-negative integer | 200 | 40000 |
first_recharge_below_base | 首充低于配置底额 | First deposit below the config base | 200 | 40000 |
first_recharge_below_min | 首充低于套餐首充最低金额(min_first_deposit) | First deposit below the package minimum (min_first_deposit) | 200 | 40000 |
first_recharge_exceeds_max | 超额超过最大充值 | Excess exceeds max recharge | 200 | 40000 |
first_recharge_limit_exceeded | 超额超过充值限额 | Excess exceeds the recharge limit | 200 | 40000 |
first_recharge_asset_mismatch | 开卡费资产与充值资产不一致 | Open-fee asset differs from recharge asset | 200 | 40000 |
first_recharge_excess_too_small | 超额扣费取整后过小 | Excess too small after fee + rounding | 200 | 40000 |
充值
由 /card/recharge 返回。该请求同样会经过上面的 ID 校验、幂等与通用检查。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
amount_required | amount 为必填 | amount is required | 200 | 40000 |
card_not_found | 卡片不存在 / 不属于当前账号 | Card not found, or not owned by your account | 404 | 40400 |
invalid_recharge_amount | amount 不是合法金额 | amount is not a valid amount | 200 | 40000 |
recharge_amount_too_small | 低于套餐最小充值金额(message 含最小值) | Below the package minimum (the message includes the minimum) | 200 | 40000 |
recharge_amount_too_large | 高于套餐最大充值金额(message 含最大值) | Above the package maximum (the message includes the maximum) | 200 | 40000 |
recharge_limit_exceeded | 超出账号充值限额 | Account recharge limit exceeded | 200 | 40000 |
recharge_amount_below_fee | 充值金额不足以支付手续费(未冻结) | The amount does not cover the recharge fee (nothing frozen) | 200 | 40000 |
insufficient_balance | 钱包余额不足(不冻结资金、不创建订单) | Wallet cannot cover the amount (nothing is frozen, no order) | 200 | 40000 |
card_is_closing | 卡片正在注销中(status=4) | The card is being closed (status=4) | 200 | 40000 |
card_not_active | 卡片未激活(开卡中 / 已冻结 / 已注销 / 开卡失败,或已被提供方标记注销) | The card is not active (pending / frozen / closed / failed, or flagged as closed by the provider) | 200 | 40000 |
card_number_not_ready | 卡号尚未下发(VIRTUAL-S921 开卡后短时间内,通常几秒、最长约 90 秒),请稍后重试,不冻结资金 | Card number not issued yet (VIRTUAL-S921 right after opening); retry later, nothing frozen | 200 | 40000 |
card_recharge_disabled | 账号已被禁止充值 | Recharge is disabled for your account | 200 | 40000 |
user_not_active | 账号未处于正常状态 | The account is not active | 200 | 40000 |
recharge_disabled | 该卡类型 / 卡头 / 套餐的充值已关闭 | Recharge is switched off for this card type / header / package | 200 | 40000 |
card_type_not_support_recharge | 该卡类型不支持充值 | This card type does not support recharge | 200 | 40000 |
recharge_not_supported | 该套餐未配置充值资产 | The package has no recharge asset | 200 | 40000 |
card_type_mismatch | 套餐与卡类型不匹配(平台数据问题) | Package / card type mismatch (platform data) | 200 | 40000 |
account_currency_not_configured | 卡内账户币种未配置(平台配置问题) | Card account currency not configured (platform configuration) | 200 | 40000 |
same_currency_not_allowed | 充值币种与卡内币种相同(平台配置问题) | Recharge asset equals the card currency (platform configuration) | 200 | 40000 |
unsupported_card_provider | 暂不支持该卡提供商(平台配置问题) | Card provider not supported (platform configuration) | 200 | 40000 |
exchange_rate_not_available | 汇率暂不可用,请稍后重试 | Exchange rate temporarily unavailable — retry later | 200 | 40000 |
card_status_not_rechargeable | 提供方因卡状态拒绝充值(已注销 / 注销中 / 冻结 / 未激活),资金已退回钱包 | The provider refused because of the card's status; funds already returned to the wallet | 200 | 40000 |
recharge_rejected | 提供方同步拒绝充值(如低于提供方最低金额),资金已退回钱包 | The provider refused the recharge synchronously; funds already returned to the wallet | 200 | 40000 |
openapi_recharge_failed | 服务端异常,不保证已建单;重试前先查 /card/transactions/list | Unexpected server error — an order is not guaranteed; check the transactions before retrying | 200 | 50000 |
结果未知不是错误
如果调用提供方超时或结果不明,订单已经创建、资金已经冻结。自 v1.5 起,接口此时返回正常的成功信封,status: 1(处理中);最终结果通过 card.recharged / card.recharge_failed webhook 通知。这种情况下不要换新的 Idempotency-Key 重发。
业务错误同样会被回放 24 小时
HTTP 200 的错误(40000 / 50000)会像成功响应一样存进该 Idempotency-Key:24 小时内用同一个 key + 同一个 body 重发,拿到的是同一个错误。排除原因后(为钱包充值、等待 card_number_not_ready 恢复 …),请使用新的 key。见幂等键。
敏感卡片信息
下列错误码由 /openapi/card/info(with_sensitive=true 前提不满足时)与 /openapi/card/sensitive/send_code 返回。敏感字段要求卡处于 status=2 (active),并通过用户二次验证或凭证免验证特权二者之一。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
email_code_required | 请输入邮箱验证码 | Please enter email verification code | 403 | 40300 |
sms_code_required | 请输入短信验证码 | Please enter SMS verification code | 403 | 40300 |
pin_required | 请输入 PIN 码 | Please enter PIN | 403 | 40300 |
2fa_code_required | 请输入 2FA 验证码 | Please enter 2FA code | 403 | 40300 |
invalid_email_code | 邮箱验证码错误 | Invalid email verification code | 403 | 40300 |
invalid_sms_code | 短信验证码错误 | Invalid SMS verification code | 403 | 40300 |
invalid_pin | PIN 码错误 | Invalid PIN | 403 | 40300 |
invalid_2fa_code | 2FA 验证码错误 | Invalid 2FA code | 403 | 40300 |
email_not_verified | 邮箱未验证 | Email not verified | 403 | 40300 |
phone_not_verified | 手机号未验证 | Phone not verified | 403 | 40300 |
no_usable_auth_method | 无可用的认证方式 | No usable authentication method | 403 | 40300 |
card_sensitive_access_banned | 通过 API 获取敏感卡片信息的权限已被管理员关闭 | Sensitive card info access via API has been disabled by the administrator | 403 | 40300 |
openapi_sensitive_card_only_active | 仅激活状态的卡片可获取敏感信息 | Sensitive card info is only available for active cards. | 403 | 40300 |
too_many_requests | 请求过于频繁(验证锁定 / 发码冷却,遵循 Retry-After) | Too many requests (verification locked / send cooldown; honor Retry-After) | 429 | 42900 |
sms_country_not_supported | 该国家/地区的手机号暂时不在支持范围内(不发码,冷却已释放) | Phone numbers from this country or region are not supported at the moment (no code sent, cooldown released) | 200 | 40000 |
send_code_failed | 验证码发送失败(冷却已释放,可立即重试) | Failed to send verification code (cooldown released, retry allowed) | 200 | 50000 |
openapi_sensitive_card_info_disabled(403)不再返回:未开通免验证特权的凭证现在会落入用户二次验证路径,而不是被直接拒绝。
卡列表过滤
由 /cards/list 返回。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
openapi_conflicting_card_filters | usable_only 与 statuses 不能同时传 | usable_only and statuses cannot be used together | 200 | 40000 |
openapi_invalid_status_value | statuses 含非法状态值(仅允许 1-6) | statuses contains an invalid value (only 1-6 allowed) | 200 | 40000 |
invalid_min_balance | 最小余额必须是合法非负数字(如 0 或 10.5) | min_balance must be a valid non-negative number | 200 | 40000 |
invalid_max_balance | 最大余额必须是合法非负数字 | max_balance must be a valid non-negative number | 200 | 40000 |
min_balance_exceeds_max_balance | 最小余额不能大于最大余额 | min_balance must not exceed max_balance | 200 | 40000 |
invalid_date_format | start_date / end_date 必须为 YYYY-MM-DD | start_date / end_date must be YYYY-MM-DD | 200 | 40000 |
交易明细过滤
由 /transactions/list 与 /card/transactions/list 返回。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
openapi_invalid_card_id | card_id 缺失(/card/transactions/list 必填)或格式不正确 | card_id missing (required on /card/transactions/list) or malformed | 200 | 40000 |
card_not_found | card_id 对应的卡不存在或不属于当前账号 | The card_id does not exist or is not yours | 404 | 40400 |
invalid_date_format | 交易时间格式必须为 YYYY-MM-DD HH:MM:SS(message 文案写的是 YYYY-MM-DD,此处必须带时分秒) | transaction_time_from/to must be YYYY-MM-DD HH:MM:SS | 200 | 40000 |
invalid_params | 参数无效:金额格式错误,或 type_category 不在允许取值内 | Invalid parameters — bad amount format, or an invalid type_category | 200 | 40000 |
冻结 / 解冻
由 /card/freeze 与 /card/unfreeze 返回。两个接口同样可能返回 openapi_invalid_card_id(格式错误)、card_not_found(404)与 openapi_card_type_not_supported。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
card_already_frozen | (冻结)卡片已被冻结,可视为已处于目标状态 | (freeze) Card is already frozen | 200 | 40000 |
card_status_cannot_freeze | (冻结)当前卡状态不可冻结(开卡中 / 注销中 / 已注销 / 开卡失败) | (freeze) Current card status does not allow freezing | 200 | 40000 |
card_not_frozen | (解冻)卡片未被冻结 | (unfreeze) Card is not frozen | 200 | 40000 |
card_type_mismatch | 卡类型与配置不匹配 | Card type does not match | 200 | 40000 |
operation_not_supported | 该操作不支持 | Operation not supported for this card type | 200 | 40000 |
recharge_unfreeze_disabled | 该卡不允许通过充值自动解冻 | Recharge-based unfreeze is not available | 200 | 40000 |
unauthorized_unfreeze_admin | (解冻)该卡片被管理员冻结,用户无法自行解冻 | (unfreeze) Frozen by admin — cannot self-unfreeze | 403 | 40300 |
unauthorized_unfreeze_risk | (解冻)该卡片被风控冻结 | (unfreeze) Frozen by risk control — cannot self-unfreeze | 403 | 40300 |
unauthorized_unfreeze_system | (解冻)该卡片被系统冻结 | (unfreeze) Frozen by system — cannot self-unfreeze | 403 | 40300 |
openapi_freeze_card_failed / openapi_unfreeze_card_failed | 服务端异常 | Unexpected server error | 200 | 50000 |
v1.5 之前,冻结一张已冻结的卡返回
card_status_cannot_freeze;现在返回card_already_frozen。冻结 / 解冻成功时还会推送card.status_changedwebhook。
销卡
由 /card/close 返回(v1.3 —— 端点自 v1.2 起已上线但此前未收录文档)。同样可能返回 openapi_invalid_card_id、card_not_found(404)、openapi_card_type_not_supported、card_type_mismatch 与 operation_not_supported。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
card_is_closing | 卡片正在注销中 | Card is being closed | 200 | 40000 |
card_already_closed | 卡片已注销 | Card is already closed | 200 | 40000 |
card_frozen_cannot_close | 卡片已冻结,无法注销 | Card is frozen and cannot be cancelled | 200 | 40000 |
card_status_cannot_close | 当前卡状态不可注销 | Current card status does not allow cancellation | 200 | 40000 |
close_not_accepted_by_upstream | 销卡未被上游受理,卡片已恢复为可用状态,请稍后重试 | Closure not accepted by the provider; card restored to active — retry later | 200 | 40000 |
card_upstream_closed_pending_reconcile | 该卡已被上游直接注销,正在等待人工对账退款 | Card already closed by the provider; awaiting manual refund reconciliation | 200 | 40000 |
card_config_not_found | 卡配置不存在 | Card configuration not found | 200 | 40000 |
openapi_close_card_failed | 销卡失败 | Failed to close card | 200 | 50000 |
持卡人姓名 / 账单地址
由 /card/holder_name/update、/card/billing_address/generate、/card/billing_address/update 返回(v1.5.1)。同样可能返回 openapi_invalid_card_id、card_not_found(404)与 openapi_card_type_not_supported。字段级错误的 message 带出字段名 / 上限,error_key 不变。
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
card_holder_info_not_editable | 仅激活状态(status=2)的卡片可修改持卡人姓名和账单地址 | The cardholder name and billing address can only be changed while the card is active (status=2) | 200 | 40000 |
billing_address_managed_by_cardholder | 该卡使用持卡人开立,账单地址取自持卡人资料,不能重新生成或修改(v1.6.1) | This card was opened with a cardholder, so its billing address comes from the cardholder profile and cannot be regenerated or changed (v1.6.1) | 200 | 40000 |
card_holder_name_required | 持卡人姓名缺失或只有空白 | Cardholder name missing or blank | 200 | 40000 |
card_holder_name_length_exceeded | 持卡人姓名超过 100 个字符(message 含上限) | Cardholder name longer than 100 characters (the message includes the limit) | 200 | 40000 |
card_holder_name_invalid_characters | 持卡人姓名含换行、制表符等控制字符 | Cardholder name contains control characters such as line breaks or tabs | 200 | 40000 |
invalid_country_code | country / country_code 不是两位字母的 ISO 3166-1 alpha-2 代码 | country / country_code is not a two-letter ISO 3166-1 alpha-2 code | 200 | 40000 |
billing_address_field_required | 账单地址必填字段缺失或只有空白(message 含字段名) | A required billing-address field is missing or blank (the message names the field) | 200 | 40000 |
billing_address_field_length_exceeded | 账单地址字段超长(message 含字段名与上限) | A billing-address field is too long (the message names the field and the limit) | 200 | 40000 |
billing_address_field_invalid_characters | 账单地址字段含控制字符(message 含字段名) | A billing-address field contains control characters (the message names the field) | 200 | 40000 |
billing_address_country_pool_empty | (生成)该国家暂无可用地址,请换一个国家 | (generate) No address available for this country — choose another | 200 | 40000 |
openapi_update_card_holder_name_failed / openapi_generate_billing_address_failed / openapi_update_billing_address_failed | 服务端异常,可直接重试 | Unexpected server error — safe to retry | 200 | 50000 |
持卡人
由持卡人接口(v1.6)以及带 cardholder_id 或(v1.6.6 起)带 billing_address 的 /card/apply 返回(后者返回下面的资料校验类 key,data.field 在 billing_address.* 下)。部分错误带有包含详情的 data 对象 —— field、cardholder_id、header_id、review_status、failure_reason、terminal、issues、missing_fields、retry_after_seconds、max_pages;见错误详情。
资料校验(data.field 指明字段)。v1.6.8 起持卡人 create / update 只做发卡方的平台底线校验(格式与存储上限);字符集、年龄、证件有效期以及卡头需要哪些字段,由 /cardholder/check、/cardholder/submit 与开卡以问题(issues)的形式报告
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
cardholder_field_required | 缺少必填资料(first_name / last_name / birth_date / email / area_code / mobile_number;重试草稿登记时还可能是 identity.number,见修改持卡人) | A required field is missing (first_name / last_name / birth_date / email / area_code / mobile_number; when retrying a draft's registration it can also be identity.number — see Update Cardholder) | 200 | 40000 |
cardholder_field_too_long | 资料超出存储上限(名 / 姓 32;地址 state 20,city / district / line1 / line2 70,postcode 10 个字符) | A field exceeds its storage limit (names 32; address state 20, city / district / line1 / line2 70, postcode 10 characters) | 200 | 40000 |
cardholder_birth_date_invalid | 出生日期格式须为 YYYY-MM-DD | Date of birth must be YYYY-MM-DD | 200 | 40000 |
cardholder_gender_invalid | 性别只能是 1 或 2 | Gender must be 1 or 2 | 200 | 40000 |
cardholder_country_code_invalid | 国家或地区代码须为两位大写字母(ISO 3166-1 alpha-2) | Country code must be two upper-case letters (ISO 3166-1 alpha-2) | 200 | 40000 |
cardholder_email_invalid | 邮箱格式无效 | Invalid email | 200 | 40000 |
cardholder_area_code_invalid | 手机区号须为 + 加 1–4 位数字 | Area code must be + followed by 1–4 digits | 200 | 40000 |
cardholder_mobile_number_invalid | 手机号须为 4–30 位数字 | Mobile number must be 4–30 digits | 200 | 40000 |
cardholder_ssn_invalid | 社会安全号须为 9 位数字 | SSN must be 9 digits | 200 | 40000 |
cardholder_id_type_invalid | 证件类型只能是 ID_CARD / PASSPORT / HK_HKID / DLN / RESIDENCE_PERMIT | ID type must be ID_CARD / PASSPORT / HK_HKID / DLN / RESIDENCE_PERMIT | 200 | 40000 |
cardholder_id_number_invalid | 证件号码最多 64 位,只能包含字母、数字和连字符 | ID number: up to 64 letters, digits or hyphens | 200 | 40000 |
cardholder_date_invalid | 日期格式须为 YYYY-MM-DD | Date must be YYYY-MM-DD | 200 | 40000 |
cardholder_address_incomplete | 地址须包含国家、州 / 省、城市、地址第一行和邮编(仅不用持卡人时 /card/apply 的 billing_address) | An address needs country, state, city, line 1 and postcode (only billing_address on /card/apply without a cardholder) | 200 | 40000 |
cardholder_address_line_invalid | 地址只能包含英文字母、数字、空格及 , . ' / # ( ) - &(仅不用持卡人时 /card/apply 的 billing_address) | Address may only contain English letters, digits, spaces and , . ' / # ( ) - & (only billing_address on /card/apply without a cardholder) | 200 | 40000 |
cardholder_postcode_invalid | 邮编须为 4–10 位字母或数字(仅不用持卡人时 /card/apply 的 billing_address) | Postcode must be 4–10 letters or digits (only billing_address on /card/apply without a cardholder) | 200 | 40000 |
cardholder_poa_info_required | 上传或替换地址证明须同时填写出具日期和出具国家 | A new proof of address needs its issue date and issuing country in the same request | 200 | 40000 |
cardholder_poa_issue_date_in_future | 地址证明出具日期不能晚于今天 | Proof-of-address issue date cannot be after today | 200 | 40000 |
cardholder_external_id_invalid | external_id 最多 128 位,只能包含字母、数字及 - _ . | external_id: up to 128 letters, digits or - _ . | 200 | 40000 |
cardholder_name_immutable | 持卡人登记后不能修改姓名 | The name cannot change after registration | 200 | 40000 |
持卡人状态
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
cardholder_not_found | 持卡人不存在(或不是通过 OpenAPI 登记的) | Cardholder not found on your account (or not registered through OpenAPI) | 404 | 40400 |
cardholder_not_registered | 持卡人尚未完成登记(草稿),修改后调用 update | Registration not completed (draft) — fix and update | 200 | 40000 |
cardholder_identity_public_figure | AI 审核:持卡人身份不能用于开卡,本次登记 / 修改未保存 | AI check: this cardholder identity cannot be used to open cards — the create / update was not saved | 200 | 40000 |
cardholder_id_number_mismatch | AI 审核:证件号码与证件影像上的不一致,本次登记 / 修改未保存 | AI check: the ID number does not match the identity document image — the create / update was not saved | 200 | 40000 |
cardholder_name_mismatch | AI 审核:姓名与证件影像上的不一致,本次登记 / 修改未保存 | AI check: the name does not match the identity document image — the create / update was not saved | 200 | 40000 |
cardholder_birth_date_mismatch | AI 审核:出生日期与证件影像上的不一致 | AI check: the date of birth does not match the identity document image | 200 | 40000 |
cardholder_gender_mismatch | AI 审核:性别与证件影像上的不一致 | AI check: the gender does not match the identity document image | 200 | 40000 |
cardholder_nationality_mismatch | AI 审核:国籍与证件影像上的不一致 | AI check: the nationality does not match the identity document image | 200 | 40000 |
cardholder_id_type_mismatch | AI 审核:identity.type 与上传的证件不一致 | AI check: identity.type does not match the uploaded document | 200 | 40000 |
cardholder_id_issue_country_mismatch | AI 审核:签发国家 / 地区与证件影像上的不一致 | AI check: the issuing country / region does not match the identity document image | 200 | 40000 |
cardholder_id_issue_date_mismatch | AI 审核:签发日期与证件影像上的不一致 | AI check: the issue date does not match the identity document image | 200 | 40000 |
cardholder_id_expiry_date_mismatch | AI 审核:到期日期与证件影像上的不一致 | AI check: the expiry date does not match the identity document image | 200 | 40000 |
cardholder_manual_review_pending | 持卡人在平台人工审核中,审核通过后才能开卡 | The cardholder is under platform manual review — cards can be opened after approval | 200 | 40000 |
cardholder_manual_review_rejected | 持卡人未通过平台人工审核,不能用于开卡 | The cardholder did not pass platform manual review and cannot be used to open cards | 200 | 40000 |
cardholder_under_review | 审核中,仅可修改 email | Under review — only email can be changed | 200 | 40000 |
cardholder_busy | 该持卡人(或本账户的另一个登记请求)正在处理中,请稍后用新的 Idempotency-Key 重试 | Another operation on this cardholder (or another create on your account) is in progress — retry shortly with a new Idempotency-Key | 200 | 40000 |
cardholder_only_draft_deletable | 只有草稿可以删除 | Only drafts can be deleted | 200 | 40000 |
cardholder_legacy_card_invalid | legacy_card_id 不是可复用持卡人的旧卡 | legacy_card_id is not one of your legacy card candidates | 200 | 40000 |
cardholder_already_registered | 该持卡人已在本账户登记为另一位持卡人 | This person is already registered as another cardholder on your account | 200 | 40000 |
cardholder_source_mismatch | 该 external_id 属于通过其他渠道登记的持卡人 | The external_id belongs to a cardholder registered through another channel | 200 | 40000 |
影像
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
cardholder_file_purpose_invalid | purpose 缺失或无效 | purpose missing or invalid | 200 | 40000 |
cardholder_file_empty | 未上传文件或文件为空 | No file, or the file is empty | 200 | 40000 |
cardholder_file_too_large | 文件超过 2 MB | File larger than 2 MB | 200 | 40000 |
cardholder_file_type_unsupported | 只支持 JPG / PNG / PDF | Only JPG / PNG / PDF | 200 | 40000 |
cardholder_file_rejected | 影像无效(格式不支持或内容损坏),请重新上传 | File invalid (unsupported format or damaged) — upload another | 200 | 40000 |
cardholder_upload_busy | 上传繁忙,请稍后重试 | Too many uploads — retry later | 200 | 40000 |
cardholder_file_not_identity_document | AI 审核:上传的不是证件 | AI check: the file is not an identity document | 200 | 40000 |
cardholder_file_no_person_holding_document | AI 审核:手持证件照里没有本人手持证件 | AI check: the hand-held photo does not show the person holding the document | 200 | 40000 |
cardholder_file_specimen | AI 审核:样本或模板证件 | AI check: specimen or template document | 200 | 40000 |
cardholder_file_unreadable | AI 审核:证件看不清(模糊、过暗、反光或被遮挡) | AI check: the document is not readable (blurry, dark, glare or covered) | 200 | 40000 |
cardholder_file_public_figure | AI 审核:证件上的身份不能用于开卡 | AI check: the identity on this document cannot be used to open cards | 200 | 40000 |
cardholder_file_edited | AI 审核:证件照疑似经过修图或篡改 | AI check: the document photo appears to have been edited or altered | 200 | 40000 |
cardholder_file_data_inconsistent | AI 审核:证件信息前后不一致(如机读区与印刷信息不符) | AI check: the data on the document is inconsistent (e.g. the MRZ does not match the printed details) | 200 | 40000 |
cardholder_file_screen_capture | AI 审核:截图或翻拍屏幕的照片 | AI check: a screenshot or a photo of a screen | 200 | 40000 |
cardholder_file_digital_copy | AI 审核:不是拍摄证件原件得到的图片(网上下载、电子版或合成图) | AI check: not a photo of the original document (downloaded, electronic or composited image) | 200 | 40000 |
cardholder_file_side_mismatch | AI 审核:证件面与上传位置不符 | AI check: the side does not match the upload slot | 200 | 40000 |
cardholder_ai_check_too_frequent | 本账户 AI 审核次数超过上限 —— data.retry_after_seconds 秒后用新的 Idempotency-Key 重试 | Too many AI checks for this account — retry after data.retry_after_seconds with a new Idempotency-Key | 200 | 40000 |
cardholder_file_pdf_too_many_pages | 证件 PDF 页数超过上限(data.max_pages) | The identity document PDF has too many pages (data.max_pages) | 200 | 40000 |
cardholder_file_pdf_not_accepted | 证件照不接受 PDF —— 请上传 JPG / PNG 照片 | PDF is not accepted for identity documents — upload a JPG / PNG photo | 200 | 40000 |
cardholder_file_pdf_unreadable | 无法识别 PDF 的页数(加密或损坏) | The PDF's pages cannot be counted (encrypted or damaged) | 200 | 40000 |
cardholder_file_not_found | 影像不存在或不属于本账户(data.field 指明位置) | File not found on your account (data.field names the slot) | 404 | 40400 |
cardholder_file_purpose_mismatch | 影像用途与所填位置不符 | The file was uploaded for a different slot | 200 | 40000 |
cardholder_file_expired | 影像已过期,请重新上传 | The unreferenced file has expired — upload again | 200 | 40000 |
cardholder_file_in_use | 影像已被其他持卡人使用,请重新上传 | The file is used by another cardholder — upload again | 200 | 40000 |
审核与身份认证
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
cardholder_headers_required | 请至少选择一个卡头 | Give at least one header | 200 | 40000 |
cardholder_headers_too_many | 一次最多 20 个卡头 | At most 20 headers per call | 200 | 40000 |
cardholder_header_not_found | 卡头不存在 | Card header not found | 404 | 40400 |
cardholder_header_unsupported | 该卡头不使用持卡人 | The header does not use cardholders | 200 | 40000 |
cardholder_header_bin_missing | 该卡头暂不可用于持卡人,请联系我们 | The header is temporarily unavailable for cardholders — contact us | 200 | 40000 |
cardholder_header_bin_unavailable | 该卡头关联的发卡方卡段已停用或不存在(发卡方拒绝),请换其他卡头或联系我们 | The header's issuer card BIN has been disabled or does not exist — choose another header or contact us | 200 | 40000 |
cardholder_billing_country_unsupported | 该卡不支持此账单国家或地区,请换一个国家 —— 仅由 /cardholder/billing_address/random 在卡头要求持卡人时返回(data.field=country) | This card does not support this billing country or region. Please choose another country — returned only by /cardholder/billing_address/random (data.field=country) when the header requires a cardholder | 200 | 40000 |
cardholder_random_address_unavailable | (/cardholder/billing_address/random)暂时无法生成该国家或地区的地址,请换一个国家或手动填写(data.field=country) | (/cardholder/billing_address/random) Unable to generate an address for this country or region right now. Please choose another country or enter the address manually (data.field=country) | 200 | 40000 |
cardholder_kyc_level_not_required | 该卡头不需要身份认证 | The header does not require identity verification | 200 | 40000 |
cardholder_kyc_not_allowed | 该卡头要求的身份认证已被拒绝且重试次数已用完 | The verification this header requires was rejected and no retries are left | 200 | 40000 |
cardholder_kyc_not_in_progress | 该持卡人没有进行中的身份认证 | No verification is in progress for this cardholder | 200 | 40000 |
cardholder_kyc_cancel_linked | 关联已有认证发起的身份认证不能取消,结果会自动推送 | A verification started by linking an existing verification cannot be cancelled — the result is pushed automatically | 200 | 40000 |
cardholder_kyc_already_verified | 该卡头要求的身份认证已通过,请直接提交审核 | The verification this header requires has already passed — submit for review directly | 200 | 40000 |
cardholder_kyc_in_review | 持卡人另一项身份认证正在审核中,请在其结束后再发起 | Another verification of this cardholder is under review — start again after it concludes | 200 | 40000 |
cardholder_kyc_link_in_progress | 关联已有认证的结果还在处理,请等待结果,不要另行发起 | A linked verification is still being processed — wait for the result instead of starting a new one | 200 | 40000 |
cardholder_requirement_unavailable | 该卡头的持卡人要求暂不可用,请稍后重试 | The header's cardholder requirements are temporarily unavailable — retry later | 200 | 50000 |
cardholder_conflict | 手机号或证件号已被其他持卡人使用 | The mobile number or ID number is already used by another cardholder | 200 | 40000 |
cardholder_provider_invalid_params | 资料未通过校验,请检查后重试 | The data was rejected during registration / review — check it | 200 | 40000 |
cardholder_provider_status_not_allowed | 持卡人当前状态不允许该操作 | The cardholder's current status does not allow this operation | 200 | 40000 |
cardholder_provider_unavailable | 持卡人服务暂不可用,请稍后重试。登记 / 修改草稿时 data.cardholder_id 为已保存的草稿,请对其调用 update 重试 | Cardholder service temporarily unavailable — retry later. On create / update of a draft, data.cardholder_id is the saved draft: retry with update | 200 | 50000 |
cardholder_service_not_configured | 持卡人服务未开通,请联系我们 | Cardholder service not enabled — contact us | 200 | 50000 |
openapi_cardholder_failed | 持卡人接口服务端异常 | Unexpected server error on a cardholder endpoint | 200 | 50000 |
开卡(/card/apply)
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
cardholder_required | 该卡头须使用已审核通过的持卡人(cardholder_id) | The header requires an approved cardholder (cardholder_id) | 200 | 40000 |
cardholder_review_not_approved | 该持卡人在此卡类型尚未审核通过,或已审核资料不覆盖该卡头(data.review_status、data.failure_reason、data.terminal) | Not approved for this card type, or the reviewed information does not cover this header (data.review_status, data.failure_reason, data.terminal) | 200 | 40000 |
cardholder_kyc_level_not_passed | 尚未通过该卡头要求的身份认证(data.header_id)—— 用 /cardholder/kyc/init 发起 | Identity verification required by this header not passed (data.header_id) — start it with /cardholder/kyc/init | 200 | 40000 |
cardholder_requirements_unmet | 发卡方预检发现该卡头不接受的资料或限制(data.header_id、data.issues、data.missing_fields);未冻结资金 | The issuer's precheck found materials or restrictions this header does not accept (data.header_id, data.issues, data.missing_fields); no funds frozen | 200 | 40000 |
cardholder_card_limit_reached | 该持卡人在此卡头的开卡数已达上限 | The cardholder has reached the card limit on this header | 200 | 40000 |
cardholder_kyc_not_configured | 该卡头要求身份认证但尚未配置,请联系我们 | The header requires identity verification but it is not configured — contact us | 200 | 40000 |
bank_card_apply_cardholder_requirements_unmet | 持卡人不满足该卡的开卡要求(冻结资金已退回) | The cardholder does not meet this card's requirements (frozen funds returned) | 200 | 40000 |
bank_card_apply_cardholder_disabled | 该持卡人当前不可用于开卡(冻结资金已退回),请联系我们 | The cardholder cannot open cards at the moment (frozen funds returned) — contact us | 200 | 40000 |
服务端异常
| error_key | zh-CN | en-US | HTTP | code |
|---|---|---|---|---|
openapi_internal_error | OpenAPI 内部错误(如幂等存储暂不可用) | OpenAPI internal error | 200 | 50000 |
openapi_list_card_headers_failed | 查询卡头列表失败 | Failed to list card headers | 200 | 50000 |
openapi_list_card_configs_failed | 查询卡配置列表失败 | Failed to list card configs | 200 | 50000 |
openapi_apply_card_failed | 申请虚拟卡失败 | Failed to apply virtual card | 200 | 50000 |
openapi_first_deposit_preview_failed | 首充预览失败 | Failed to preview first deposit | 200 | 50000 |
openapi_recharge_failed | 充值失败 | Failed to recharge | 200 | 50000 |
openapi_get_card_info_failed | 获取卡片信息失败 | Failed to get card info | 200 | 50000 |
openapi_list_cards_failed | 查询卡列表失败 | Failed to list cards | 200 | 50000 |
openapi_webhook_service_unavailable | Webhook 服务不可用 | Webhook service unavailable | 200 | 50000 |
openapi_list_webhook_events_failed | 查询 Webhook 事件历史失败 | Failed to list webhook events | 200 | 50000 |
openapi_list_transactions_failed | 查询交易明细失败 | Failed to list transactions | 200 | 50000 |
openapi_freeze_card_failed | 冻结卡片失败 | Failed to freeze card | 200 | 50000 |
openapi_unfreeze_card_failed | 解冻卡片失败 | Failed to unfreeze card | 200 | 50000 |
openapi_close_card_failed | 销卡失败 | Failed to close card | 200 | 50000 |
openapi_update_card_holder_name_failed | 修改持卡人姓名失败 | Failed to update the cardholder name | 200 | 50000 |
openapi_generate_billing_address_failed | 生成账单地址失败 | Failed to generate a billing address | 200 | 50000 |
openapi_update_billing_address_failed | 保存账单地址失败 | Failed to save the billing address | 200 | 50000 |
openapi_cardholder_failed | 持卡人请求处理失败 | Failed to process the cardholder request | 200 | 50000 |
send_code_failed | 验证码发送失败 | Failed to send verification code | 200 | 50000 |
internal_error | 服务端未捕获的异常 | Unhandled server crash | 500 | 50000 |
程序处理建议
def handle_response(http_status: int, resp: dict):
code = resp.get("code")
key = resp.get("error_key", "")
# 1. 先判断成功。HTTP 200 本身不代表成功
if code == 0:
return resp["data"]
# 2. 没有信封(代理错误页、路径不存在):按 HTTP 状态码兜底
if code is None:
if http_status == 429:
raise RateLimited()
raise ServerError(f"HTTP {http_status}")
# 3. 带真实 HTTP 状态码的几类
if code == 40100:
# 永远是 openapi_invalid_credentials
raise AuthError("凭证无效,请检查 AppID/Secret/时钟/签名输入")
if code == 40300:
# 鉴权通过,但本次请求受限
if key.endswith("_required"):
raise PermissionError(f"缺少二次验证凭据({key})—— "
"先调用 /openapi/card/sensitive/send_code 再重试")
if key.startswith("invalid_"):
raise PermissionError(f"二次验证未通过: {key}")
raise PermissionError(f"特性受限: {key}") # 如 openapi_sensitive_card_only_active
if code == 40400:
raise NotFound(key) # card_not_found
if code == 40900:
if key == "openapi_idempotency_key_in_progress":
raise RetrySameKeyLater() # 第一次请求仍在处理
raise IdempotencyConflict() # 同 key 不同 body:不要重试
if code == 42900:
raise RateLimited() # 按 Retry-After 响应头等待
# 4. 业务规则(HTTP 200):按 error_key 分支
if key == "insufficient_balance":
raise BalanceError("余额不足")
if key == "kyc_required":
raise KYCError("需先完成实名认证")
if key == "card_number_not_ready":
raise RetryLater() # S921 卡号尚未下发
if key in ("openapi_invalid_card_id", "openapi_invalid_header_id", "openapi_invalid_package_id"):
raise ValueError(f"ID 格式错误: {key}")
# 5. 服务端异常(HTTP 200 或 500)
if code == 50000:
# 写接口:换新的 Idempotency-Key 重试之前,先确认实际结果
raise ServerError(key)
raise ApiError(code, key, resp.get("message"))多语言
message 的语言依次取自请求头 Accept-Language、请求头 X-Language、查询参数 ?lang=(查询参数属于签名中的 RAW_QUERY,见 HMAC 鉴权)。只取第一个语言标签,忽略 q 权重。
Accept-Language: en-US| 取值 | message 语言 |
|---|---|
| 不传 | 英文(en-US) |
en-US / en | 英文 |
zh-CN / zh / zh-Hans | 简体中文 |
zh-HK / zh-TW / zh-Hant / zh-MO | 繁体中文 |
| 平台支持的其他语言 | 对应语言(可能为机器翻译) |
| 不支持的语言 | 英文 |
英文、简体中文、繁体中文由人工维护;某种语言缺少文案时会回退到其他语言。error_key 不受语言影响,永远稳定。