跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://developers-sandbox.uqpaytech.com/llms.txt

Use this file to discover all available pages before exploring further.

当 Card Issuance API 调用失败时,网关会返回非 2xx 的 HTTP 状态码以及 JSON 错误体。通过本页你可以定位问题原因并恢复调用。

错误响应格式

Card Issuance API 使用两种响应信封。具体返回哪一种取决于处理请求的 handler。
绝大多数卡片与持卡人错误都会返回这种信封。type 决定 HTTP 状态码。
{
  "type": "card_error",
  "code": "card_not_found",
  "message": "card not found or deactivated"
}
Field含义
type高层分类。映射到 HTTP 状态码(见错误类型)。
code机器可读的字符串标识。用于程序化处理。
message人类可读的描述。可以安全写入日志,但不建议原样展示给终端用户。

错误类型

信封 A 把错误码按 type 分组,每个 type 固定映射到一个 HTTP 状态码。
typeHTTP出现场景
invalid_request_error400请求校验失败。
card_error400违反卡资源规则。
cardholder_error400违反持卡人资源规则。
account_error400违反账户/产品/余额规则。
idempotency_error400幂等键重放或不匹配。
unauthorized_error401 / 403API 密钥缺失、无效或没有权限。401 时 codeunauthorized_error,403 时为 forbidden
api_error500内部服务器错误。可以用相同的 Idempotency-Key 安全重试。
信封 B 不带 type 字段;通过 message 分支区分具体情况。

通用错误

以下错误可能出现在任何需要鉴权的 endpoint。

信封 A(字符串 code)

codetypeMessageWhat to do
invalid_request_errorinvalid_request_error(视场景而定——message 中会指出字段路径和校验规则)TODO
unauthorized_errorunauthorized_errorToken expired, IP not allowed, or access token dependencies unavailable通过 Access Token 获取新的访问令牌,确认调用方 IP 在白名单内,然后用新的 x-auth-token 头重试。
forbiddenunauthorized_errorReturned when the API key lacks permission (currently guards GET /cards/{id}/secure)联系你的 UQPAY solutions engineer 为 API 密钥开启敏感卡详情权限,然后重试。
api_errorapi_error(视场景而定——通用的内部服务器错误)TODO
account_not_foundaccount_erroraccount not found or deactivated确认你使用的 client_id / API 密钥归属于一个生效中的 UQPAY 账户。如果账户是近期创建的,请确认入驻流程已完成。
sub_account_not_foundaccount_errorsub-account associated with the on-behalf-of not found or deactivated确认 on-behalf-of 头指向你主账户下一个存在且生效的子账户,或不带该头以主账户身份调用。
user_not_foundaccount_erroruser associated with account not found or deactivated确认绑定到 API 密钥的用户仍在生效。如果该用户近期被禁用,请联系你的 UQPAY solutions engineer。
request_being_processedidempotency_errorrequest is being processed稍后用相同的 Idempotency-Key 重试——原始请求仍在处理中。重试之间不要修改请求体。
invalid_key_formatidempotency_errorinvalid idempotency key format提供一个非空、长度不超过 255 个字符的 Idempotency-Key 头(推荐使用 UUID v4)。
key_mismatch_accountidempotency_errorkey does not belong to accountIdempotency-Key 之前被其他账户使用过——请为当前账户生成一个新的 key。
key_mismatch_apiidempotency_errorapi associated with key is not the originalIdempotency-Key 只能在首次使用时的同一 endpoint + method 上重用。换 endpoint 请生成新的 key。

信封 B(旧版扁平 400)

codeMessageWhat to do
400Request parameters invalid对照 API Reference 中该 endpoint 的 schema,检查每个必填字段是否存在且类型正确。
400Params JSON error请求体 JSON 解析失败——检查是否有尾随逗号、未转义的引号,或缺少 Content-Type: application/json 头。
400Account does not exist.确认 API 密钥归属于一个生效中的账户,且解析到的账户未被停用。
400An internal error occurred, please try again短暂回退后用相同的 Idempotency-Key 重试。如果错误持续,联系你的 UQPAY solutions engineer 并附上请求时间戳。
400Login expired通过 Access Token 获取新的访问令牌,并用新的 x-auth-token 重试。
429Request is too frequent按指数退避重试。敏感卡和 PAN Token 类 endpoint 按卡限流——轮询间隔请不要短于几秒。

资源错误

卡片错误

Create Card · List Cards · Update Card · Retrieve Card · Update Card Status · Retrieve Sensitive Card Details · Create PAN Token · Card Recharge · Card Withdraw · Retrieve Card Order · Activate Card · Reset Card PIN · Assign Card
信封 A 的 type:card_error,以及创建卡片时可能出现的 account_errorproduct_not_foundaccount_balance_error)。 信封 A
codeMessageTypical endpointsWhat to do
card_not_foundcard not found or deactivated任何接收 {card_id} 的 endpoint确认 card_id 存在于你的账户下且未注销。使用 List CardsRetrieve Card 核对。
operation_not_authorizedrequested card operation type is not authorizedCreate Card你的账户没有发行该卡类型的权限——联系你的 UQPAY solutions engineer 在账户上开启。
risk_control_not_allowedrisk control setting is not allowedCreate Card移除或调整超出卡产品允许范围的 risk_controls 条目。支持的配置见 Supported BINs for risk control configurations 指南。
currency_not_allowedcard currency is not allowedCreate Cardcurrency 设置为所选卡产品支持的币种之一。找你的 UQPAY solutions engineer 确认产品配置。
limit_out_of_rangecard limit is either less than minimum card limit or greater than maximum card limitCreate Cardspending_controls.spending_limit 设置在该产品配置的最小值与最大值之间。上下限按卡产品设定——联系你的 UQPAY solutions engineer 确认。
cardholder_quota_exceededcard quota of cardholder exceeds limitCreate Card该持卡人已达到允许的最大活动卡数量。先通过 Update Card Status 注销一张已有的卡,再发行新卡,或换一个持卡人。
account_quota_exceededcard quota of account exceeds limitCreate Card账户级别的卡数量上限已达到。通过 Update Card Status 注销未使用的卡,或联系你的 UQPAY solutions engineer 提高配额。
insufficient_sub_bininsufficient available cards for sub-binCreate Card你账户下该卡产品对应的子 BIN 池已无可用卡号。这是库存问题,不是请求问题——请将你的账户 ID 以及目标卡产品 / BIN 提供给 UQPAY OPS,由 OPS 补充库存。在库存补齐之前,相同请求重试也会一直失败。
card_expired_errorcard has expiredReset Card PIN卡已过期——不再允许重置 PIN 码。如有需要,请补发一张新卡。
status_not_supportedcard status or activation status not supported by requestReset Card PIN · Create PAN Token · Retrieve Sensitive Card Details执行该操作要求卡处于可用的激活状态。用 Retrieve Card 查看 status,先激活或解除锁定。
virtual_card_pin_errorvirtual cards do not allow pin settingsReset Card PIN虚拟卡没有 PIN 码——该 endpoint 仅适用于实体卡。
auto_cancel_trigger cannot be emptycode 字符串即 message——不单独返回 messageCreate Card当卡产品要求时(通常是一次性卡),需要提供 auto_cancel_trigger
invalid auto_cancel_triggercode 字符串即 message)Create Card使用 Create Card 文档中列出的合法 auto_cancel_trigger 取值之一。
expiry_at cannot be emptycode 字符串即 message)Create Card当卡产品要求显式指定过期日期时,需要提供 expiry_at
invalid expiry_atcode 字符串即 message)Create Cardexpiry_at 必须是 ISO 8601 格式的未来时间戳,且在产品允许的最长有效期内。
product_not_foundproduct not found or inactiveCreate Card确认 card_product_id 指向一个在你的账户上启用的产品。通过 UQPAY 控制台或联系 solutions engineer 核对。
account_balance_errorinsufficient balance or currency balance unavailableCreate Card在重试之前,为卡币种对应的发卡账户余额充值。参见 Fund your issuing balance 指南。
信封 B
codeMessageTypical endpointsWhat to do
400Card does not exists任何接收 {card_id} 的 endpoint确认 card_id 存在于你的账户下。使用 List Cards 核对。
400card bin not configCreate Card · Assign Card你账户下尚未配置该 BIN,因此无法在该 BIN 上创建或分配卡片。请将你的账户 ID 以及目标 BIN 提供给 UQPAY OPS,由 OPS 配置后即可使用。
400card number not existAssign Cardcard_number 不在你账户当前的可用卡池中。请核对:(1) 卡号是 UQPAY 为该账户提供的;(2) 卡号长度正确——不要带空格、不要带前后多余字符、不要少位;(3) 该卡片尚未被分配给其他持卡人。
400Create card errorCreate Card用相同的 Idempotency-Key 重试。如果持续失败,对照 Create Card 的 schema 检查请求体,并联系你的 UQPAY solutions engineer。
400Update card errorUpdate Card · Activate Card重试请求。如果仍然失败,通过 Retrieve Card 确认卡处于可更新状态,且要修改的字段在该产品下允许修改。
400Card retrieve errorRetrieve Card · Retrieve Sensitive Card Details短暂回退后重试。如果卡是近期创建的,请等几秒钟让数据同步。
400Card status is invalidUpdate Card Statusstatus 设为卡当前状态允许的取值之一(见 Card lifecycle 指南)。例如,已注销的卡无法再切回 active 状态。
400The card is failed.Retrieve Card卡在发卡方侧制卡失败——既无法查询也无法使用。请补发一张新卡。
400The card is not active.Update Card · Card Recharge · Card Withdraw在更新、充值或提现之前,先通过 Activate Card 激活卡片。
400Update reason is too longUpdate Card Status缩短 reason 字段的内容。该字段以有限长度的列存储——请控制在几百个字符以内。
400The card has expiredUpdate Card · Update Card Status · Activate Card卡已超过 expiry_at,无法再修改或激活。请补发一张新卡。
400Invalid expiry dateCard Recharge · Card Withdraw卡已过期——充值和提现被阻断。如持卡人仍需用卡,请补发新卡。
400Card holder not exists or is illegalCreate Card · Retrieve Card通过 List Cardholders 确认 cardholder_id 存在于你的账户下且处于生效状态。
400Cardholder not found or deactivatedList Cards确认 cardholder_id 过滤条件指向一个在你账户下、处于生效状态的持卡人。
400Invalid card type.Create Card根据卡产品支持的形态,将 card_type 设置为 VIRTUALPHYSICAL
400Card currency is not supportCreate Card使用所选卡产品允许的 currency。可向你的 UQPAY solutions engineer 确认支持的币种。
400Card limit is illegalCreate Cardspending_controls.spending_limit 设置为以最小货币单位表示的正整数,且在产品允许的区间内。
400Update card limit is less than the amount of used cardUpdate Card新限额必须不低于卡当前已使用的金额。通过 Retrieve Card 查看 available_balance / used_amount,并据此提高限额。
400Failed Update. Card Limit should be greater than 0Update Cardspending_controls.spending_limit 设置为大于 0 的值。
400Failed Update. Card Limit should be greater than Per transactionUpdate Card总的 spending_limit 必须大于或等于单笔限额——请提高消费限额或降低单笔上限。
400Failed Update. Your transaction limit should be greater than 0Update Card将单笔限额设置为大于 0 的值。
400The single card not support changing card limitsUpdate Card一次性卡在创建时已固定限额——创建后不可更改。
400This operation cannot be performed on One-Time Card.Update Card · Card Recharge · Card Withdraw一次性卡不支持更新、充值或提现。如需追加资金,请发行一张新卡。
400Card recharge is errorCard Recharge用相同的 Idempotency-Key 重试。如果持续失败,确认卡的状态、币种以及你的发卡账户余额。
400Card withdraw not supportCard Withdraw该卡产品不支持提现。改用 Update Card Status 注销卡片以收回余额。
400Card available limit insufficientCard Withdraw提现金额超过卡的可用余额。通过 Retrieve Card 查看当前余额,并降低 amount
400Recharge amount is invalidCard Rechargeamount 必须是以卡币种最小单位(如分)表示的正整数。确认精度与卡币种一致。
400Withdraw amount is invalidCard Withdrawamount 必须是以卡币种最小单位表示的正整数,且不超过当前卡余额。
400The card product currently does not support creationCreate Card该卡产品未开放新卡创建。联系你的 UQPAY solutions engineer 启用发卡能力。
400The card currently does not support withdrawCard Withdraw该卡产品禁用了提现。通过 Update Card Status 注销卡片以回收余额。
400The card currently does not support rechargeCard Recharge该卡产品禁用了充值(例如一次性卡)。如需追加资金,请发行新卡。
400The card currently does not support cancelUpdate Card Status卡当前状态不能转到已注销(例如已注销或待处理)。请先查询卡查看其状态。
400The card has been activated.Activate Card卡已处于激活状态——无需再次激活。用 Retrieve Card 确认状态。
400Invalid activation code.Activate Card确认 activation_code 与实体卡卡封上的激活码一致。激活码每次尝试只能使用一次。
400Card order is not existsRetrieve Card Order确认 order_id 正确,且来自此前某次创建卡的响应。
400Card product is errorCreate Card · Activate Cardcard_product_id 配置有误。联系你的 UQPAY solutions engineer 确认该产品已在你的账户上启用。
400Not found card productsCreate Card · Update Card · Card Recharge · Card Withdraw你的账户下没有匹配的可用卡产品——联系你的 UQPAY solutions engineer 启用该产品。
400Product not openedCard Recharge该卡产品未开放充值。联系你的 UQPAY solutions engineer。
400Account card quota exceeded.Create Card · Assign Card账户级别的活动卡上限已达到。通过 Update Card Status 注销未使用的卡,或向你的 UQPAY solutions engineer 申请提高配额。
400Cardholder card quota exceeded.Create Card · Assign Card该持卡人已达到最大活动卡数量。注销其中一张卡,或改用其他持卡人。
400Account balance not existsCreate Card · Card Recharge · Card Withdraw你的账户不持有卡币种对应的余额。请先为发卡账户余额充值——参见 Fund your issuing balance
400Insufficient balanceCreate Card · Card Recharge · Card Withdraw在重试之前,为卡币种对应的发卡账户余额充值。
400Spending controls is errorUpdate Cardspending_controls 载荷校验失败——对照 Update Card 的 schema 检查 spending_limitper_transaction_limit 以及任何白/黑名单字段。
400Metadata is invalidUpdate Cardmetadata 必须是扁平的 string → string 映射。移除嵌套对象,并确保键和值在长度限制内。
400risk control setting is not allowedUpdate Cardrisk_controls 组合在此卡产品下不被允许。支持的配置见 Supported BINs for risk control configurations
400Exceed restrict max authorization amountCreate Card请求的限额超过了产品允许的最大授权金额。降低 spending_limit,或请你的 UQPAY solutions engineer 提高产品上限。
400Restrict config errorUpdate Card本次更新违反了卡产品的限制配置——请核对你正在设置的类别、币种或 MCC 白名单。
400Not found product restrictUpdate Card · Card Recharge · Card Withdraw平台上缺少该卡产品的限制配置。联系你的 UQPAY solutions engineer。
400Convert data errorCreate Card · Update Card内部数据转换失败——用相同的 Idempotency-Key 重试。如果持续失败,请把请求 ID 报给你的 UQPAY solutions engineer。
400Content type is not supported, please upload the correct formatCreate Card使用 Content-Type: application/json 发送请求。
400no pin payment amount failed.Update Card · Activate Card你提供的 no_pin_payment_amount 校验失败。确认取值、精度和币种与卡产品配置一致。
400Negative no pin payment amount.Activate Cardno_pin_payment_amount 必须是非负整数。
400Invalid no pin payment amount precision.Activate Card精度需与卡币种的最小单位一致(例如 USD 为 2 位小数,JPY 为 0 位)。以最小单位的整数发送。
400invalid no pin payment amount for the current currency.Update Card · Activate Card数值超过了卡币种的允许上限。降低 no_pin_payment_amount,或检查产品配置。
400The no_pin_payment_amount restrict configuration cannot be foundUpdate Card · Activate Card该卡产品不支持免密金额上限——请从请求中移除该字段。
429Request is too frequentCreate PAN Token · Retrieve Sensitive Card Details按指数退避重试。这些 endpoint 按卡限流;不要在循环中紧密轮询。

持卡人错误

Create Cardholder · List Cardholders · Update Cardholder · Retrieve Cardholder · Create Card(一次性发卡路径)
type:cardholder_error 信封 A
codeMessageTypical endpointsWhat to do
cardholder_not_foundcardholder not found or deactivated任何接收 {cardholder_id} 的 endpoint · Create Card通过 List Cardholders 确认 cardholder_id 存在于你的账户下且处于生效状态。
cardholder_already_existscardholder already existsCreate Card系统中已存在具有相同身份信息的持卡人——请复用该持卡人的 cardholder_id,不要新建。
email_duplicatedemail already used by another cardholder under accountCreate Cardholder · Create Card更换 email,或复用已有的持卡人记录——通过 List Cardholders 查询。
phone_number_duplicatedphone number used by another cardholder under accountCreate Cardholder · Create Card更换手机号,或复用已有的持卡人记录——通过 List Cardholders 查询。
invalid_phone_numberinvalid phone number or country codeCreate Cardholder · Update Cardholder · Create Cardphone.country_code 以纯数字的 ISO 国家电话代码填写,phone.number 以 E.164 国内格式的纯数字填写。
invalid_first_nameinvalid first name, only letters and spaces allowed, no leading or trailing spacesCreate Cardholder · Create Cardfirst_name 仅允许 ASCII 字母和空格。去除首尾空格,并移除标点或数字。
invalid_last_nameinvalid last name, only letters and spaces allowed, no leading or trailing spacesCreate Cardholder · Create Cardlast_name 仅允许 ASCII 字母和空格。去除首尾空格,并移除标点或数字。
invalid_date_of_birthcardholder under 18 or invalid date of birth formatCreate Cardholder · Update Cardholder持卡人必须年满 18 岁。date_of_birthYYYY-MM-DD 格式发送。
missing_date_of_birthmissing legal date of birth for document uploadCreate Cardholder · Update Cardholder · Create Card上传身份证件时必须同时提供 date_of_birth——证件核验需要该字段。
invalid_delivery_addressinvalid delivery addressCreate Cardholder · Update Cardholder · Create Card完整填写寄送地址的所有必填子字段:countrystatecitypostal_codeline1。使用 ISO 国家代码。
missing_country_codecountry_code is required for SUMSUB_REDIRECT KYC verificationCreate Cardholder · Update Cardholder · Create Cardkyc_methodSUMSUB_REDIRECT 时,需要提供持卡人的居住地 country_code(ISO 3166-1 alpha-2)。
document_duplicateddocument already successfully reviewedUpdate Cardholder该身份证件已在持卡人上通过审核——不要重复上传。
file_type_not_supportedunsupported document file typeCreate Cardholder · Update Cardholder · Create Card以 JPEG、PNG 或 PDF 格式上传证件。
invalid_file_contentinvalid base64 encoded document contentCreate Cardholder · Update Cardholder · Create Card确认文件字节为标准 Base64 编码(不带 data-URL 前缀、不含换行)后再发送。
document_size_exceededdocument size exceeds 2MB limitCreate Cardholder · Update Cardholder · Create Card压缩或重新扫描证件,确保解码后文件小于 2 MB。
document_review_requiredcardholder’s document requires reviewCreate Card该持卡人的证件仍在人工审核中。等待 cardholder.kyc_status Webhook,或轮询 Retrieve Cardholder 直到 KYC 通过。
identity_file_missingrequired identity file is missingCreate Cardholder · Update Cardholder · Create Cardidentity_documents 中上传所需的身份证件(例如身份证的正反两面)。
invalid_identity_typeinvalid identity type, must be ID_CARD or PASSPORTCreate Cardholder · Update Cardholder · Create Cardidentity_type 设置为 ID_CARDPASSPORT
invalid_kyc_methodinvalid KYC verification method, must be THIRD_PARTY or SUMSUB_REDIRECTCreate Cardholder · Update Cardholder · Create Cardkyc_method 设置为 THIRD_PARTYSUMSUB_REDIRECT
kyc_proof_requiredkyc_proof is required when method is THIRD_PARTYCreate Cardholder · Update Cardholder · Create Cardkyc_methodTHIRD_PARTY 时,提供 kyc_proof 载荷以描述你方 KYC 服务商的核验结果。
reference_id_duplicatedreference_id already used by another cardholderCreate Cardholder · Update Cardholder · Create Card提供唯一的 reference_id——该账户下已有其他持卡人使用了你发送的值。
reference_id_too_shortreference_id must be at least 10 characters longCreate Cardholder · Update Cardholder · Create Cardreference_id 长度至少为 10 个字符。
cardholder_kyc_pendingcardholder KYC is under review, cannot proceedCreate Card等待 KYC 完成。轮询 Retrieve Cardholder 或监听 cardholder.kyc_status Webhook,然后再重试。
cardholder_kyc_failedcardholder KYC has been rejectedCreate Card让持卡人重新提交身份证件,或新建一个持卡人记录。如果拒绝原因不明,联系你的 UQPAY solutions engineer。
kyc_insufficientcardholder information does not meet this product’s requirements (response includes missing_fields)Create Card通过 Update Cardholder 补齐响应中 missing_fields 列出的字段,然后重试。
supplement_fields_incompletesupplemented cardholder fields are incomplete (response includes missing_fields)Create Card在重试时,把响应 missing_fields 里的每个字段填入 cardholder_required_fields
cardholder_cannot_update_during_reviewcannot update KYC fields while review is pendingUpdate Cardholder等待 KYC 审核结束,再编辑身份或地址字段。非 KYC 字段(如 metadata)仍可更新。
bin_required_fields_not_configuredrequired_fields not configured for this card BIN, cannot proceed with card creationCreate Card该卡 BIN 的 required_fields 配置在平台上缺失。联系你的 UQPAY solutions engineer。
cardholder_missing_infoeither cardholder_id or complete cardholder_required_fields must be providedCreate Card要么提供已存在的 cardholder_id,要么在 cardholder_required_fields 中提供完整的一次性发卡载荷。
cardholder_incomplete_fieldscardholder_required_fields is incomplete for one-time card issuance (response includes missing_fields)Create Card把响应 missing_fields 中的每个字段补充到 cardholder_required_fields,再重试。

余额错误

Retrieve Issuing Balance · List Issuing Balances · List Issuing Balances Transactions
type:account_error 信封 A
codeMessageTypical endpointsWhat to do
account_balance_errorinsufficient balance or currency balance unavailableRetrieve Issuing Balance · List Issuing Balances · List Issuing Balances Transactions确认你的账户持有请求 currency 对应的余额。调用 List Issuing Balances 查看所有可用币种余额。

交易错误

List Cards Transactions · Retrieve Cards Transaction · Simulate Authorization · Simulate Reversal
信封 A 的 type:invalid_request_error(交易不存在 / 不属于当前关联账户)。 信封 A
codeMessageTypical endpointsWhat to do
invalid_request_errortransaction[<id>] not found under the connected accountRetrieve Cards Transaction确认 transaction_id 存在于你的账户下。使用 List Cards Transactions 查找可用的 ID。
信封 B
codeMessageTypical endpointsWhat to do
400Card authorize transaction is errorSimulate Authorization重试模拟器调用。如果持续失败,确认目标卡处于激活状态,且金额/币种与该卡匹配。此 endpoint 仅沙盒可用。
400Card reversal transaction is errorSimulate Reversal确认要冲正的 transaction_id 存在,且指向此前某次模拟过的授权。此 endpoint 仅沙盒可用。
400Invalid channel codeSimulate Authorization · Simulate Reversalchannel 设置为支持的沙盒渠道值。可向你的 UQPAY solutions engineer 获取允许列表。
400MCC is errorSimulate Authorization提供该卡消费限额允许的 4 位数字 mcc 代码。
400Account status errorSimulate Authorization · Simulate Reversal账户当前状态无法模拟授权。通过 UQPAY 控制台确认账户处于生效状态。
400Restrict config errorSimulate Authorization · Simulate Reversal模拟交易违反了卡的消费限额(MCC、币种、国家或限额)。调整模拟器请求或卡的 spending_controls