跳转到主要内容
当 Global Acquiring API 调用失败时,网关会返回非 2xx 的 HTTP 状态码,并附带 JSON 错误体。请使用本页识别出错原因以及如何恢复。

错误响应格式

Global Acquiring API 使用两种响应信封,具体返回哪一种取决于处理该请求的 handler。
Global Acquiring API 返回的几乎所有错误都使用此信封。type 字段决定了 HTTP 状态码(参见错误类型)。

错误类型

信封 A 将错误码按 type 分组,每种 type 映射到固定的 HTTP 状态码。 信封 B 不携带 type 字段;请根据 code 是数字(信封 B)还是字符串(信封 A)来区分两种格式。

通用错误

以下错误可能出现在任意已认证的接口上。

信封 A(带类型的错误)

信封 B(旧版幂等处理中)

资源错误

支付错误

Create a PaymentIntent · Retrieve a PaymentIntent · Update a PaymentIntent · Confirm a PaymentIntent · Capture a PaymentIntent · Cancel a PaymentIntent · List all PaymentIntents · Retrieve a PaymentAttempt · List all PaymentAttempts
信封 A 涉及的 type:payment_errorinvalid_request_errorproduct_errornot_found 信封 A

退款错误

Create a refund · Retrieve a refund · List all refunds
信封 A 涉及的 type:refund_errorpayment_errorinvalid_request_errorapi_error 信封 A

客户错误

Create a customer · Get a customer · Update a customer · List customers
type:customer_error 信封 A

出款错误

Create Payout · Retrieve Payout · List all Payouts · Retrieve Balance · List Balances · Create Bank Account · Retrieve Bank Account · Update Bank Account · List all Bank Accounts
信封 A 涉及的 type:payout_erroraccount_errorproduct_errorapi_error 信封 A