Skip to content

錯誤碼 ​

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 響應都可能帶,見持卡人。
json
{
  "code": 0,
  "message": "成功",
  "data": { "card_id": "card_12345", "status": 2 }
}
json
{
  "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 狀態碼與業務碼 ​

場景HTTPcodeerror_key 示例
成功(含冪等回放)2000—
業務 / 參數校驗不通過(ID 格式錯、金額、卡狀態、餘額不足、缺少 Idempotency-Key …)20040000openapi_invalid_card_id、insufficient_balance、card_is_closing
請求體無法解析(不是 JSON,或欄位的 JSON 型別不對)20040001validation_failed
鑑權失敗(簽名 / 時間戳 / nonce / AppID / 憑證或賬號被停用)40140100openapi_invalid_credentials
鑑權透過但被限制(敏感資訊二次驗證、非啟用卡取敏感資訊、管理員封禁、解凍被平台凍結的卡)40340300email_code_required、invalid_pin、openapi_sensitive_card_only_active、card_sensitive_access_banned、unauthorized_unfreeze_admin
卡不存在 / 不屬於當前賬號(持卡人介面上也包括持卡人、持卡人影像與卡頭)40440400card_not_found、cardholder_not_found、cardholder_file_not_found、cardholder_header_not_found
Idempotency-Key 被重複使用但請求體不同,或同 key 的請求仍在處理中40940900openapi_idempotency_key_conflict、openapi_idempotency_key_in_progress
限流(依 (AppID, 用戶端 IP) 計數的應用層限流、敏感資訊驗證鎖定 / 發碼冷卻,或 API 前面的閘道)42942900too_many_requests(並帶 Retry-After 響應頭)
介面內部已處理的服務端異常20050000openapi_recharge_failed、openapi_internal_error
服務端未捕獲的崩潰50050000internal_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 字典 ​

「中文說明」/ en-US 兩欄是對每個 key 的說明,實際 message 文案可能略有不同。不要依 message 比對。

通用 ​

error_key中文說明en-USHTTPcode
validation_failed請求體無法解析(不是合法 JSON,或欄位型別不對)Request body could not be parsed (invalid JSON, or a field with the wrong JSON type)20040001
too_many_requests請求過於頻繁,依 Retry-After 等待(見限流)Too many requests — honor Retry-After42942900
internal_error服務端未捕獲的異常(message 固定為 Internal Server Error)Unhandled server crash (message is always Internal Server Error)50050000

鑑權與憑證 ​

error_key中文說明en-USHTTPcode
openapi_invalid_credentials無效的 OpenAPI 憑證(所有鑑權失敗統一返回,見 401 錯誤處理)Invalid OpenAPI credentials40140100

ID 校驗 ​

error_key中文說明en-USHTTPcode
openapi_invalid_header_idheader_id 不合法:缺字首、格式錯誤,或卡頭不存在 / 不可用Invalid header_id: missing prefix, malformed, or the header does not exist / is not available20040000
openapi_invalid_package_idpackage_id 缺失或格式不正確(應為 pkg_ 加數字,例如 pkg_123)Invalid package_id: missing or malformed (expected pkg_ followed by digits, e.g. pkg_123)20040000
openapi_invalid_card_idcard_id 缺失或格式不正確(應為 card_ 加數字,例如 card_123)Invalid card_id: missing or malformed (expected card_ followed by digits, e.g. card_123)20040000
openapi_invalid_cardholder_idcardholder_id 缺失或格式不正確(應為 chd_ 加數字)Invalid cardholder_id: missing or malformed (expected chd_ followed by digits)20040000
openapi_invalid_cardholder_file_id持卡人影像 ID 格式不正確(應為 chf_ 加數字),data.field 指明欄位A cardholder file ID is malformed (expected chf_ followed by digits); data.field names the field20040000

格式正確、但不存在或屬於其他賬號的 card_id,在所有卡介面上都返回 HTTP 404 / 40400 card_not_found。見 ID 與字首。

冪等 ​

error_key中文說明en-USHTTPcode
openapi_idempotency_key_required缺少 Idempotency-Key 請求頭Missing Idempotency-Key header20040000
openapi_idempotency_key_too_longIdempotency-Key 超長(最大 128 字元)Idempotency-Key too long (max 128 chars)20040000
openapi_idempotency_key_invalid_charsIdempotency-Key 含非法字元(僅允許可見 ASCII,不含空格)Idempotency-Key contains invalid characters20040000
openapi_idempotency_key_conflict同一 Idempotency-Key 但請求體不同Same Idempotency-Key with a different request body40940900
openapi_idempotency_key_in_progress同 Idempotency-Key 的請求仍在處理中,請稍後重試A request with the same Idempotency-Key is still being processed40940900

業務規則 ​

由 /card/apply、/card_configs/list、/card/first_deposit/preview 及各卡介面返回。

error_key中文說明en-USHTTPcode
openapi_card_type_not_supported暫不支援該卡型別,僅虛擬卡Not supported (virtual cards only)20040000
account_manager_bind_required該卡頭需繫結客戶經理後才能開通Account-manager-controlled header; bind an account manager first20040000
account_manager_unavailable繫結的客戶經理已失效,請聯絡客服Your account manager is no longer active; contact support20040000
account_manager_open_disabled您的客戶經理尚未對該賬號開放此卡頭 / 套餐Header / package not opened for your account by your account manager20040000
card_not_found卡片不存在 / 不屬於當前賬號Card not found, or not owned by your account40440400
insufficient_balance錢包餘額不足(不凍結任何資金)Insufficient wallet balance (nothing is frozen)20040000
kyc_required賬號需先完成平台實名認證(KYC)The account must complete platform identity verification (KYC) first20040000
card_open_risk_blocked歷史拒付率 / 授權異常率過高,風控暫停開卡,請聯絡客服Card opening blocked by risk control; contact support20040000
card_open_risk_card_quota_exceeded風控限制目前最多只能持有 1 張卡Risk control limits the account to 1 card for now20040000
card_deposit_insufficient_balance押金餘額不足Insufficient balance for the card security deposit20040000
card_deposit_config_invalid該卡的押金配置不完整(平台配置問題)Security-deposit configuration incomplete (platform configuration)20040000
card_deposit_asset_not_found押金幣種不存在或已下架(平台配置問題)Security-deposit currency does not exist or was removed (platform configuration)20040000
card_deposit_already_exists該卡已存在押金記錄A deposit record already exists for this card20040000
virtual_g_name_invalid(G 卡)持卡人姓名不滿足 ASCII 字母 / 單空格 / ≤40 字元規則(G card) cardholder name fails the rule20040000
virtual_g_required_fields_missing(G 卡)開卡資料不完整(G card) apply payload incomplete20040000
virtual_a_required_fields_missing(A 卡)first_name / last_name 缺失或為空白,或開卡資料不完整(A card) name missing/blank or apply payload incomplete20040000
virtual_s921_required_fields_missing(S921 卡)開卡配置不完整(卡頭配置不完整或幣種非 USD),請聯絡客服(S921 card) the card configuration is incomplete (header not fully configured or currency not USD) — contact support20040000
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 support20040000

本頁早期版本列出的 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中文說明en-USHTTPcode
invalid_first_deposit_amountfirst_deposit_amount 必須是非負整數first_deposit_amount must be a non-negative integer20040000
first_recharge_below_base首充低於配置底額First deposit below the config base20040000
first_recharge_below_min首充低於套餐首充最低金額(min_first_deposit)First deposit below the package minimum (min_first_deposit)20040000
first_recharge_exceeds_max超額超過最大充值Excess exceeds max recharge20040000
first_recharge_limit_exceeded超額超過充值限額Excess exceeds the recharge limit20040000
first_recharge_asset_mismatch開卡費資產與充值資產不一致Open-fee asset differs from recharge asset20040000
first_recharge_excess_too_small超額扣費取整後過小Excess too small after fee + rounding20040000

充值 ​

由 /card/recharge 返回。該請求同樣會經過上面的 ID 校驗、冪等與通用檢查。

error_key中文說明en-USHTTPcode
amount_requiredamount 為必填amount is required20040000
card_not_found卡片不存在 / 不屬於當前賬號Card not found, or not owned by your account40440400
invalid_recharge_amountamount 不是合法金額amount is not a valid amount20040000
recharge_amount_too_small低於套餐最小充值金額(message 含最小值)Below the package minimum (the message includes the minimum)20040000
recharge_amount_too_large高於套餐最大充值金額(message 含最大值)Above the package maximum (the message includes the maximum)20040000
recharge_limit_exceeded超出賬號充值限額Account recharge limit exceeded20040000
recharge_amount_below_fee充值金額不足以支付手續費(未凍結)The amount does not cover the recharge fee (nothing frozen)20040000
insufficient_balance錢包餘額不足(不凍結資金、不建立訂單)Wallet cannot cover the amount (nothing is frozen, no order)20040000
card_is_closing卡片正在註銷中(status=4)The card is being closed (status=4)20040000
card_not_active卡片未啟用(開卡中 / 已凍結 / 已註銷 / 開卡失敗,或已被提供方標記註銷)The card is not active (pending / frozen / closed / failed, or flagged as closed by the provider)20040000
card_number_not_ready卡號尚未下發(VIRTUAL-S921 開卡後短時間內,通常幾秒、最長約 90 秒),請稍後重試,不凍結資金Card number not issued yet (VIRTUAL-S921 right after opening); retry later, nothing frozen20040000
card_recharge_disabled賬號已被禁止充值Recharge is disabled for your account20040000
user_not_active賬號未處於正常狀態The account is not active20040000
recharge_disabled該卡型別 / 卡頭 / 套餐的充值已關閉Recharge is switched off for this card type / header / package20040000
card_type_not_support_recharge該卡型別不支援充值This card type does not support recharge20040000
recharge_not_supported該套餐未配置充值資產The package has no recharge asset20040000
card_type_mismatch套餐與卡型別不匹配(平台資料問題)Package / card type mismatch (platform data)20040000
account_currency_not_configured卡內賬戶幣種未配置(平台配置問題)Card account currency not configured (platform configuration)20040000
same_currency_not_allowed充值幣種與卡內幣種相同(平台配置問題)Recharge asset equals the card currency (platform configuration)20040000
unsupported_card_provider暫不支援該卡提供商(平台配置問題)Card provider not supported (platform configuration)20040000
exchange_rate_not_available匯率暫不可用,請稍後重試Exchange rate temporarily unavailable — retry later20040000
card_status_not_rechargeable提供方因卡狀態拒絕充值(已註銷 / 註銷中 / 凍結 / 未啟用),資金已退回錢包The provider refused because of the card's status; funds already returned to the wallet20040000
recharge_rejected提供方同步拒絕充值(如低於提供方最低金額),資金已退回錢包The provider refused the recharge synchronously; funds already returned to the wallet20040000
openapi_recharge_failed服務端異常,不保證已建單;重試前先查 /card/transactions/listUnexpected server error — an order is not guaranteed; check the transactions before retrying20050000

結果未知不是錯誤

如果呼叫提供方逾時或結果不明,訂單已經建立、資金已經凍結。自 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中文說明en-USHTTPcode
email_code_required請輸入郵箱驗證碼Please enter email verification code40340300
sms_code_required請輸入簡訊驗證碼Please enter SMS verification code40340300
pin_required請輸入 PIN 碼Please enter PIN40340300
2fa_code_required請輸入 2FA 驗證碼Please enter 2FA code40340300
invalid_email_code郵箱驗證碼錯誤Invalid email verification code40340300
invalid_sms_code簡訊驗證碼錯誤Invalid SMS verification code40340300
invalid_pinPIN 碼錯誤Invalid PIN40340300
invalid_2fa_code2FA 驗證碼錯誤Invalid 2FA code40340300
email_not_verified郵箱未驗證Email not verified40340300
phone_not_verified手機號未驗證Phone not verified40340300
no_usable_auth_method無可用的認證方式No usable authentication method40340300
card_sensitive_access_banned透過 API 獲取敏感卡片資訊的許可權已被管理員關閉Sensitive card info access via API has been disabled by the administrator40340300
openapi_sensitive_card_only_active僅啟用狀態的卡片可獲取敏感資訊Sensitive card info is only available for active cards.40340300
too_many_requests請求過於頻繁(驗證鎖定 / 發碼冷卻,遵循 Retry-After)Too many requests (verification locked / send cooldown; honor Retry-After)42942900
sms_country_not_supported該國家/地區的手機號碼暫時不在支援範圍內(不傳送驗證碼,冷卻已釋放)Phone numbers from this country or region are not supported at the moment (no code sent, cooldown released)20040000
send_code_failed驗證碼傳送失敗(冷卻已釋放,可立即重試)Failed to send verification code (cooldown released, retry allowed)20050000

openapi_sensitive_card_info_disabled(403)不再返回:未開通免驗證特權的憑證現在會落入使用者二次驗證路徑,而不是被直接拒絕。

卡列表過濾 ​

由 /cards/list 返回。

error_key中文說明en-USHTTPcode
openapi_conflicting_card_filtersusable_only 與 statuses 不能同時傳usable_only and statuses cannot be used together20040000
openapi_invalid_status_valuestatuses 含非法狀態值(僅允許 1-6)statuses contains an invalid value (only 1-6 allowed)20040000
invalid_min_balance最小餘額必須是合法非負數字(如 0 或 10.5)min_balance must be a valid non-negative number20040000
invalid_max_balance最大餘額必須是合法非負數字max_balance must be a valid non-negative number20040000
min_balance_exceeds_max_balance最小餘額不能大於最大餘額min_balance must not exceed max_balance20040000
invalid_date_formatstart_date / end_date 必須為 YYYY-MM-DDstart_date / end_date must be YYYY-MM-DD20040000

交易明細過濾 ​

由 /transactions/list 與 /card/transactions/list 返回。

error_key中文說明en-USHTTPcode
openapi_invalid_card_idcard_id 缺失(/card/transactions/list 必填)或格式不正確card_id missing (required on /card/transactions/list) or malformed20040000
card_not_foundcard_id 對應的卡不存在或不屬於當前賬號The card_id does not exist or is not yours40440400
invalid_date_format交易時間格式必須為 YYYY-MM-DD HH:MM:SS(message 文案寫的是 YYYY-MM-DD,此處必須帶時分秒)transaction_time_from/to must be YYYY-MM-DD HH:MM:SS20040000
invalid_params參數無效:金額格式錯誤,或 type_category 不在允許取值內Invalid parameters — bad amount format, or an invalid type_category20040000

凍結 / 解凍 ​

由 /card/freeze 與 /card/unfreeze 返回。兩個介面同樣可能返回 openapi_invalid_card_id(格式錯誤)、card_not_found(404)與 openapi_card_type_not_supported。

error_key中文說明en-USHTTPcode
card_already_frozen(凍結)卡片已被凍結,可視為已處於目標狀態(freeze) Card is already frozen20040000
card_status_cannot_freeze(凍結)當前卡狀態不可凍結(開卡中 / 註銷中 / 已註銷 / 開卡失敗)(freeze) Current card status does not allow freezing20040000
card_not_frozen(解凍)卡片未被凍結(unfreeze) Card is not frozen20040000
card_type_mismatch卡型別與配置不匹配Card type does not match20040000
operation_not_supported該操作不支援Operation not supported for this card type20040000
recharge_unfreeze_disabled該卡不允許透過充值自動解凍Recharge-based unfreeze is not available20040000
unauthorized_unfreeze_admin(解凍)該卡片被管理員凍結,使用者無法自行解凍(unfreeze) Frozen by admin — cannot self-unfreeze40340300
unauthorized_unfreeze_risk(解凍)該卡片被風控凍結(unfreeze) Frozen by risk control — cannot self-unfreeze40340300
unauthorized_unfreeze_system(解凍)該卡片被系統凍結(unfreeze) Frozen by system — cannot self-unfreeze40340300
openapi_freeze_card_failed / openapi_unfreeze_card_failed服務端異常Unexpected server error20050000

v1.5 之前,凍結一張已凍結的卡返回 card_status_cannot_freeze;現在返回 card_already_frozen。凍結 / 解凍成功時還會推送 card.status_changed webhook。

銷卡 ​

由 /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中文說明en-USHTTPcode
card_is_closing卡片正在註銷中Card is being closed20040000
card_already_closed卡片已註銷Card is already closed20040000
card_frozen_cannot_close卡片已凍結,無法註銷Card is frozen and cannot be cancelled20040000
card_status_cannot_close當前卡狀態不可註銷Current card status does not allow cancellation20040000
close_not_accepted_by_upstream銷卡未被上游受理,卡片已恢復為可用狀態,請稍後重試Closure not accepted by the provider; card restored to active — retry later20040000
card_upstream_closed_pending_reconcile該卡已被上游直接註銷,正在等待人工對帳退款Card already closed by the provider; awaiting manual refund reconciliation20040000
card_config_not_found卡配置不存在Card configuration not found20040000
openapi_close_card_failed銷卡失敗Failed to close card20050000

持卡人姓名 / 帳單地址 ​

由 /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_keyzh-CNen-USHTTPcode
card_holder_info_not_editable僅啟用狀態(status=2)的卡片可修改持卡人姓名和帳單地址The cardholder name and billing address can only be changed while the card is active (status=2)20040000
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)20040000
card_holder_name_required持卡人姓名缺失或只有空白Cardholder name missing or blank20040000
card_holder_name_length_exceeded持卡人姓名超過 100 個字元(message 含上限)Cardholder name longer than 100 characters (the message includes the limit)20040000
card_holder_name_invalid_characters持卡人姓名含換行、定位字元等控制字元Cardholder name contains control characters such as line breaks or tabs20040000
invalid_country_codecountry / country_code 不是兩位字母的 ISO 3166-1 alpha-2 程式碼country / country_code is not a two-letter ISO 3166-1 alpha-2 code20040000
billing_address_field_required帳單地址必填欄位缺失或只有空白(message 含欄位名)A required billing-address field is missing or blank (the message names the field)20040000
billing_address_field_length_exceeded帳單地址欄位超長(message 含欄位名與上限)A billing-address field is too long (the message names the field and the limit)20040000
billing_address_field_invalid_characters帳單地址欄位含控制字元(message 含欄位名)A billing-address field contains control characters (the message names the field)20040000
billing_address_country_pool_empty(生成)該國家暫無可用地址,請換一個國家(generate) No address available for this country — choose another20040000
openapi_update_card_holder_name_failed / openapi_generate_billing_address_failed / openapi_update_billing_address_failed服務端異常,可直接重試Unexpected server error — safe to retry20050000

持卡人 ​

由持卡人介面(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中文說明en-USHTTPcode
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)20040000
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)20040000
cardholder_birth_date_invalid出生日期格式須為 YYYY-MM-DDDate of birth must be YYYY-MM-DD20040000
cardholder_gender_invalid性別只能是 1 或 2Gender must be 1 or 220040000
cardholder_country_code_invalid國家或地區代碼須為兩位大寫字母(ISO 3166-1 alpha-2)Country code must be two upper-case letters (ISO 3166-1 alpha-2)20040000
cardholder_email_invalid郵箱格式無效Invalid email20040000
cardholder_area_code_invalid手機區號須為 + 加 1–4 位數字Area code must be + followed by 1–4 digits20040000
cardholder_mobile_number_invalid手機號須為 4–30 位數字Mobile number must be 4–30 digits20040000
cardholder_ssn_invalid社會安全號碼須為 9 位數字SSN must be 9 digits20040000
cardholder_id_type_invalid證件類型只能是 ID_CARD / PASSPORT / HK_HKID / DLN / RESIDENCE_PERMITID type must be ID_CARD / PASSPORT / HK_HKID / DLN / RESIDENCE_PERMIT20040000
cardholder_id_number_invalid證件號碼最多 64 位,只能包含字母、數字和連字號ID number: up to 64 letters, digits or hyphens20040000
cardholder_date_invalid日期格式須為 YYYY-MM-DDDate must be YYYY-MM-DD20040000
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)20040000
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)20040000
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)20040000
cardholder_poa_info_required上傳或替換地址證明時,須在同一請求中填寫出具日期和出具國家A new proof of address needs its issue date and issuing country in the same request20040000
cardholder_poa_issue_date_in_future地址證明出具日期不能晚於今天Proof-of-address issue date cannot be after today20040000
cardholder_external_id_invalidexternal_id 最多 128 位,只能包含字母、數字及 - _ .external_id: up to 128 letters, digits or - _ .20040000
cardholder_name_immutable持卡人登記後不能修改姓名The name cannot change after registration20040000

持卡人狀態

error_key中文說明en-USHTTPcode
cardholder_not_found持卡人不存在(或不是透過 OpenAPI 登記的)Cardholder not found on your account (or not registered through OpenAPI)40440400
cardholder_not_registered持卡人尚未完成登記(草稿),修正後呼叫 updateRegistration not completed (draft) — fix and update20040000
cardholder_identity_public_figureAI 審核:持卡人身分不能用於開卡,本次登記 / 修改未儲存AI check: this cardholder identity cannot be used to open cards — the create / update was not saved20040000
cardholder_id_number_mismatchAI 審核:證件號碼與證件影像上的不一致,本次登記 / 修改未儲存AI check: the ID number does not match the identity document image — the create / update was not saved20040000
cardholder_name_mismatchAI 審核:姓名與證件影像上的不一致,本次登記 / 修改未儲存AI check: the name does not match the identity document image — the create / update was not saved20040000
cardholder_birth_date_mismatchAI 審核:出生日期與證件影像上的不一致AI check: the date of birth does not match the identity document image20040000
cardholder_gender_mismatchAI 審核:性別與證件影像上的不一致AI check: the gender does not match the identity document image20040000
cardholder_nationality_mismatchAI 審核:國籍與證件影像上的不一致AI check: the nationality does not match the identity document image20040000
cardholder_id_type_mismatchAI 審核:identity.type 與上傳的證件不一致AI check: identity.type does not match the uploaded document20040000
cardholder_id_issue_country_mismatchAI 審核:簽發國家 / 地區與證件影像上的不一致AI check: the issuing country / region does not match the identity document image20040000
cardholder_id_issue_date_mismatchAI 審核:簽發日期與證件影像上的不一致AI check: the issue date does not match the identity document image20040000
cardholder_id_expiry_date_mismatchAI 審核:到期日期與證件影像上的不一致AI check: the expiry date does not match the identity document image20040000
cardholder_manual_review_pending持卡人在平台人工審核中,審核通過後才能開卡The cardholder is under platform manual review — cards can be opened after approval20040000
cardholder_manual_review_rejected持卡人未通過平台人工審核,不能用於開卡The cardholder did not pass platform manual review and cannot be used to open cards20040000
cardholder_under_review審核中,僅可修改 emailUnder review — only email can be changed20040000
cardholder_busy該持卡人(或本帳號的另一個登記請求)正在處理中,請稍後用新的 Idempotency-Key 重試Another operation on this cardholder (or another create on your account) is in progress — retry shortly with a new Idempotency-Key20040000
cardholder_only_draft_deletable只有草稿可以刪除Only drafts can be deleted20040000
cardholder_legacy_card_invalidlegacy_card_id 不在可沿用持卡人的舊卡之列legacy_card_id is not one of your legacy card candidates20040000
cardholder_already_registered此人已在本帳號登記為另一位持卡人This person is already registered as another cardholder on your account20040000
cardholder_source_mismatch該 external_id 屬於透過其他渠道登記的持卡人The external_id belongs to a cardholder registered through another channel20040000

影像

error_key中文說明en-USHTTPcode
cardholder_file_purpose_invalidpurpose 缺失或無效purpose missing or invalid20040000
cardholder_file_empty未上傳檔案或檔案為空No file, or the file is empty20040000
cardholder_file_too_large檔案超過 2 MBFile larger than 2 MB20040000
cardholder_file_type_unsupported只支援 JPG / PNG / PDFOnly JPG / PNG / PDF20040000
cardholder_file_rejected影像無效(格式不支援或內容損壞),請重新上傳File invalid (unsupported format or damaged) — upload another20040000
cardholder_upload_busy上傳繁忙,請稍後重試Too many uploads — retry later20040000
cardholder_file_not_identity_documentAI 審核:上傳的不是證件AI check: the file is not an identity document20040000
cardholder_file_no_person_holding_documentAI 審核:手持證件照裡沒有本人手持證件AI check: the hand-held photo does not show the person holding the document20040000
cardholder_file_specimenAI 審核:樣本或範本證件AI check: specimen or template document20040000
cardholder_file_unreadableAI 審核:證件看不清(模糊、過暗、反光或被遮擋)AI check: the document is not readable (blurry, dark, glare or covered)20040000
cardholder_file_public_figureAI 審核:證件上的身分不能用於開卡AI check: the identity on this document cannot be used to open cards20040000
cardholder_file_editedAI 審核:證件照疑似經過修圖或竄改AI check: the document photo appears to have been edited or altered20040000
cardholder_file_data_inconsistentAI 審核:證件資料前後不一致(如機讀區與印刷資料不符)AI check: the data on the document is inconsistent (e.g. the MRZ does not match the printed details)20040000
cardholder_file_screen_captureAI 審核:截圖或翻拍螢幕的照片AI check: a screenshot or a photo of a screen20040000
cardholder_file_digital_copyAI 審核:不是拍攝證件原件得到的圖片(網上下載、電子版或合成圖)AI check: not a photo of the original document (downloaded, electronic or composited image)20040000
cardholder_file_side_mismatchAI 審核:證件面與上傳位置不符AI check: the side does not match the upload slot20040000
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-Key20040000
cardholder_file_pdf_too_many_pages證件 PDF 頁數超過上限(data.max_pages)The identity document PDF has too many pages (data.max_pages)20040000
cardholder_file_pdf_not_accepted證件照不接受 PDF —— 請上傳 JPG / PNG 相片PDF is not accepted for identity documents — upload a JPG / PNG photo20040000
cardholder_file_pdf_unreadable無法識別 PDF 的頁數(加密或損壞)The PDF's pages cannot be counted (encrypted or damaged)20040000
cardholder_file_not_found影像不存在或不屬於本帳號(data.field 指明位置)File not found on your account (data.field names the slot)40440400
cardholder_file_purpose_mismatch影像用途與所填位置不符The file was uploaded for a different slot20040000
cardholder_file_expired未被引用的影像已過期,請重新上傳The unreferenced file has expired — upload again20040000
cardholder_file_in_use影像已被其他持卡人使用,請重新上傳The file is used by another cardholder — upload again20040000

審核與身份驗證

error_key中文說明en-USHTTPcode
cardholder_headers_required請至少提供一個卡頭Give at least one header20040000
cardholder_headers_too_many每次最多 20 個卡頭At most 20 headers per call20040000
cardholder_header_not_found卡頭不存在Card header not found40440400
cardholder_header_unsupported該卡頭不使用持卡人The header does not use cardholders20040000
cardholder_header_bin_missing該卡頭暫不可用於持卡人,請聯絡我們The header is temporarily unavailable for cardholders — contact us20040000
cardholder_header_bin_unavailable該卡頭關聯的發卡方卡段已停用或不存在(發卡方拒絕),請換其他卡頭或聯絡我們The header's issuer card BIN has been disabled or does not exist — choose another header or contact us20040000
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 cardholder20040000
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)20040000
cardholder_kyc_level_not_required該卡頭不需要身份驗證The header does not require identity verification20040000
cardholder_kyc_not_allowed該卡頭要求的身份驗證已被拒絕且重試次數已用完The verification this header requires was rejected and no retries are left20040000
cardholder_kyc_not_in_progress該持卡人沒有進行中的身份驗證No verification is in progress for this cardholder20040000
cardholder_kyc_cancel_linked關聯已有驗證發起的身份驗證不能取消,結果會自動推送A verification started by linking an existing verification cannot be cancelled — the result is pushed automatically20040000
cardholder_kyc_already_verified該卡頭要求的身份驗證已通過,請直接提交審核The verification this header requires has already passed — submit for review directly20040000
cardholder_kyc_in_review持卡人另一項身份驗證正在審核中,請在其結束後再發起Another verification of this cardholder is under review — start again after it concludes20040000
cardholder_kyc_link_in_progress關聯已有驗證的結果還在處理,請等待結果,不要另行發起A linked verification is still being processed — wait for the result instead of starting a new one20040000
cardholder_requirement_unavailable該卡頭的持卡人要求暫時不可用,請稍後重試The header's cardholder requirements are temporarily unavailable — retry later20050000
cardholder_conflict手機號或證件號碼已被其他持卡人使用The mobile number or ID number is already used by another cardholder20040000
cardholder_provider_invalid_params資料在登記 / 審核時未通過校驗,請檢查The data was rejected during registration / review — check it20040000
cardholder_provider_status_not_allowed持卡人目前狀態不允許此操作The cardholder's current status does not allow this operation20040000
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 update20050000
cardholder_service_not_configured持卡人服務未開通,請聯絡我們Cardholder service not enabled — contact us20050000
openapi_cardholder_failed持卡人介面服務端異常Unexpected server error on a cardholder endpoint20050000

開卡(/card/apply)

error_key中文說明en-USHTTPcode
cardholder_required該卡頭須使用已審核通過的持卡人(cardholder_id)The header requires an approved cardholder (cardholder_id)20040000
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)20040000
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/init20040000
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 frozen20040000
cardholder_card_limit_reached該持卡人在此卡頭的開卡數已達上限The cardholder has reached the card limit on this header20040000
cardholder_kyc_not_configured該卡頭要求身份驗證但尚未設定,請聯絡我們The header requires identity verification but it is not configured — contact us20040000
bank_card_apply_cardholder_requirements_unmet持卡人不符合該卡的開卡要求(凍結資金已退回)The cardholder does not meet this card's requirements (frozen funds returned)20040000
bank_card_apply_cardholder_disabled該持卡人目前不能用於開卡(凍結資金已退回),請聯絡我們The cardholder cannot open cards at the moment (frozen funds returned) — contact us20040000

服務端異常 ​

error_key中文說明en-USHTTPcode
openapi_internal_errorOpenAPI 內部錯誤(如冪等儲存暫不可用)OpenAPI internal error20050000
openapi_list_card_headers_failed查詢卡頭列表失敗Failed to list card headers20050000
openapi_list_card_configs_failed查詢卡配置列表失敗Failed to list card configs20050000
openapi_apply_card_failed申請虛擬卡失敗Failed to apply virtual card20050000
openapi_first_deposit_preview_failed首充預覽失敗Failed to preview first deposit20050000
openapi_recharge_failed充值失敗Failed to recharge20050000
openapi_get_card_info_failed獲取卡片資訊失敗Failed to get card info20050000
openapi_list_cards_failed查詢卡列表失敗Failed to list cards20050000
openapi_webhook_service_unavailableWebhook 服務不可用Webhook service unavailable20050000
openapi_list_webhook_events_failed查詢 Webhook 事件歷史失敗Failed to list webhook events20050000
openapi_list_transactions_failed查詢交易明細失敗Failed to list transactions20050000
openapi_freeze_card_failed凍結卡片失敗Failed to freeze card20050000
openapi_unfreeze_card_failed解凍卡片失敗Failed to unfreeze card20050000
openapi_close_card_failed銷卡失敗Failed to close card20050000
openapi_update_card_holder_name_failed修改持卡人姓名失敗Failed to update the cardholder name20050000
openapi_generate_billing_address_failed生成帳單地址失敗Failed to generate a billing address20050000
openapi_update_billing_address_failed儲存帳單地址失敗Failed to save the billing address20050000
openapi_cardholder_failed持卡人請求處理失敗Failed to process the cardholder request20050000
send_code_failed驗證碼傳送失敗Failed to send verification code20050000
internal_error服務端未捕獲的異常Unhandled server crash50050000

程式處理建議 ​

python
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 權重。

http
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 不受語言影響,永遠穩定。

採用 MIT 等價條款釋出