通用错误码
| 错误码 | 说明 | 适用 API | 处理方式 |
|---|---|---|---|
| 400001 | 请求参数非法 | 通用 | 检查请求参数是否有效 |
| 400002 | Signature verification failed | General | Check the signature algorithm, signature string, and signing key. See 认证与安全 |
| 400003 | 请求时间戳已过期 | 通用 | 检查时间戳请求头 |
| 400007 | 不支持的 Content-类型 | 通用 | 检查 Content-类型 是否符合 API 要求 |
| 400020 | nonce 非法 | 通用 | 检查 X-GatePay-Nonce 是否为空或格式错误 |
| 400201 | 商户订单号重复 | 创建订单相关 API | 检查是否重复提交了相同商户订单号 |
| 400202 | 订单不存在 | 查询类 API | 检查订单号是否正确 |
| 400204 | 订单状态非法 | 订单操作类 API | 检查订单是否已过期、取消或关闭 |
| 400603 | Order timed out | 支付 API | Confirm whether the 订单 has expired |
| 400621 | Incorrect payment amount | 支付 API | Check the requested amount |
| 400622 | 因汇率波动导致兑换失败 | 报价 / 兑换类 API | 如业务流程允许,可重试 |
| 400624 | Invalid 回调 URL | Order-creation APIs | Check whether the 回调 URL is valid. See 通知与回调 |
批量出款错误码
For detailed 出款 error handling, see 出款.| 错误码 | 说明 | 适用 API | 处理方式 |
|---|---|---|---|
| 550233 | Insufficient balance | Batch 出款 | Check available balance |
| 550234 | Memo too long | Batch 出款 | Check memo length |
| 550235 | Amount precision exceeds the allowed range | Batch 出款 | Check amount precision |
| 550238 | Too many sub-订单s | Batch 出款 | Check the number of sub-订单s |
| 550239 | amount is missing | Batch 出款 | Provide the amount field |
| 550240 | currency is missing | Batch 出款 | Provide the currency field |
| 550241 | address is missing | Batch 出款 | Provide the address field |
| 550242 | chain is missing | Batch 出款 | Provide the chain field |
| 550245 | batch_id already exists | Batch 出款 | Use a new batch_id or handle as idempotent |
| 550249 | Invalid batch_id or withdraw_订单_id | Batch 出款 | Check field format |
资金流水查询 错误码
| 错误码 | 说明 | 适用 API | 处理方式 |
|---|---|---|---|
| 5504060 | Invalid 订单类型 parameter (1=商户 订单 number, 2=GatePay 订单 number, 3=资金 账本 number) | Funds 账本 query | Correct the 订单类型 parameter |
| 5504061 | Query size exceeds the limit (≤ 500) | Funds 账本 query | Reduce the number of records requested per call |
QR Payment 错误码
| 错误码 | 说明 | 适用 API | 处理方式 |
|---|---|---|---|
| 400000 | Invalid request format | QR payment | Check request data format |
| 400002 | Signature verification failed | QR payment | Check whether the 商户 signature is correct. See 认证与安全 |
| 400003 | 请求 timestamp expired | QR payment | Check the timestamp header |
| 400007 | Unsupported media type | QR payment | Check the API Content-类型 |
| 400603 | Order timed out | QR payment | Confirm whether the 订单 has expired |
| 400621 | Incorrect payment amount | QR payment | Check the requested amount |
| 400620 | Duplicate payment 订单 | QR payment | Check whether the 商户 订单 number was submitted repeatedly |
| 500008 | 商户 not found | QR payment | Check whether the 商户 ID is correct |
| 500100 | Payment QR code has expired | QR payment | Create a new 订单 to generate a new QR code |
| 500101 | Duplicate QR payment | QR payment | Verify the 订单 status |
Web Payment 错误码
| 错误码 | 说明 | 适用 API | 处理方式 |
|---|---|---|---|
| 300000 | System error | Web payment | Retry with the same parameters |
| 300001 | System error | Web payment | Retry with the same parameters |
| 400000 | Unknown error | Web payment | Record the request, 重试, or contact support |
| 400001 | Invalid request parameter format | Web payment | Check the request parameters and data format |
| 400002 | Signature verification failed | Web payment | Check whether the 商户 signature is correct. See 认证与安全 |
最佳实践
回调 and Query Fallback Strategy
Use a “回调s first, query as fallback” confirmation model for reliable 订单 status management: Recommended approach:- Rely on 回调s as the primary 通知 mechanism (see 通知与回调 for integration details)
- Implement signature verification before processing any 回调 (see 认证与安全)
- Use 幂等性 to handle duplicate 回调s safely
- Store 通知s durably before processing
- Implement state-machine control for 回调 processing
- 5 seconds
- 10 seconds
- 30 seconds
- 1 minute
- 3 minutes
- 5 minutes
Re资金 Confirmation
Re资金 are 异步 operations. A successful re资金 API response indicates only that the request has been accepted; it does not confirm the re资金 was actually processed. 必填 practice:- Confirm final re资金 results through the re资金 query API or re资金 回调 (see 支付 for re资金 回调 details)
- Use the “回调s first, query as fallback” pattern to verify re资金 completion
- Never consider a re资金 complete based solely on the API response
Security 最佳实践s
Authentication and Signature Verification- Always verify 回调 signatures before processing (see 认证与安全)
- Never return
SUCCESSin a 回调 response if signature verification fails - Check the request timestamp to prevent replay attacks
- Do not expose server-side signing keys or credentials in client 应用s
- Store 商户 secrets securely using environment variables or secure vaults
- Rotate signing keys periodically and maintain separate keys for test and production environments
- Validate all request parameters before processing
- Check Content-类型 headers and ensure they match API requirements
- Use HTTPS with TLS 1.2+ for all API communications

