Error Codes
Error Code System
DaxPay has two API tiers with slightly different response structures:
Payment API (/unipay/*) — DaxResult:
{
"code": 0,
"msg": "success",
"data": { }
}Management API (/mch/*) — Result:
{
"code": 0,
"message": "success",
"data": { }
}| Field | Type | Payment API | Management API | Description |
|---|---|---|---|---|
code | int | ✓ | ✓ | Status code. 0 = success, non-0 = failure |
msg | string | ✓ | — | Message (DaxResult field name) |
message | string | — | ✓ | Translated message per Accept-Language (Result field name) |
data | object|null | ✓ | ✓ | Business data, usually null on failure |
sign | string | ✓ | — | RSA response signature (Payment API only) |
resTime | string | ✓ | — | Response time UTC (Payment API only) |
reqId | string | ✓ | — | Request ID echo (Payment API only) |
- Success:
{"code": 0, "msg": "success", ...} - Failure:
{"code": 10506, "msg": "No matching channel found for routing", "data": null}
Error messages support 10 languages (zh-CN / en-US / zh-TW / zh-HK / ja-JP / ko-KR / id-ID / vi-VN / th-TH / ms-MY), selected by the Accept-Language header. code is a numeric category code, independent from the message text — the same text may be thrown with different codes.
HTTP Status Codes
| HTTP Status | Description |
|---|---|
| 200 | Request received, check response body code for result |
| 400 | Invalid request format |
| 401 | Unauthorized (Accesstoken missing or invalid) |
| 403 | Forbidden (insufficient permissions) |
| 404 | Endpoint not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Error Code Dictionary
CommonCode
| Code | Constant | Description |
|---|---|---|
0 | SUCCESS_CODE | Success |
1 | FAIL_CODE | Failure (generic fallback) |
CommonErrorCode (10000-19999)
| Code | Constant | Description |
|---|---|---|
10401 | AUTHENTICATION_FAIL | Authentication failed (token expired / invalid) |
10404 | SOURCES_NOT_EXIST | Resource not found |
10405 | DATA_NOT_EXIST | Data not found |
10408 | NONCE_MISSING | Nonce missing |
10409 | NONCE_INVALID | Nonce invalid or expired |
10410 | TIMESTAMP_EXPIRED | Request timestamp out of allowed range |
10415 | UN_SUPPORTED_OPERATE | Unsupported operation |
10500 | SYSTEM_ERROR | System error |
10505 | PARSE_PARAMETERS_ERROR | Parameter parsing failed |
10506 | VALIDATE_PARAMETERS_ERROR | Parameter validation failed |
10507 | REPETITIVE_OPERATION_ERROR | Duplicate operation |
10512 | DANGER_SQL | Dangerous SQL detected |
PayErrorCode (20000-29999)
| Code | Constant | Description |
|---|---|---|
20000 | UNCLASSIFIED_ERROR | Unclassified payment error |
20011 | CHANNEL_NOT_EXIST | Payment channel not found |
20012 | METHOD_NOT_EXIST | Payment method not found |
20013 | STATUS_NOT_EXIST | Payment status not found |
20021 | CHANNEL_NOT_ENABLE | Payment channel not enabled |
20022 | METHOD_NOT_ENABLE | Payment method not enabled |
20023 | CONFIG_NOT_ENABLE | Configuration not enabled |
20024 | CONFIG_ERROR | Configuration error |
20025 | CONFIG_NOT_EXIST | Configuration not found |
20030 | UNSUPPORTED_ABILITY | Unsupported payment capability |
20041 | TRADE_NOT_EXIST | Trade not found |
20042 | TRADE_CLOSED | Trade closed |
20043 | TRADE_PROCESSING | Trade processing, do not repeat |
20044 | TRADE_STATUS_ERROR | Trade status error |
20045 | TRADE_FAIL | Trade failed |
20052 | VERIFY_SIGN_FAILED | Signature verification failed |
20060 | AMOUNT_EXCEED_LIMIT | Amount exceeds limit |
20080 | OPERATION_FAIL | Operation failed |
20081 | OPERATION_PROCESSING | Operation processing, do not repeat |
20082 | OPERATION_UNSUPPORTED | Unsupported operation |
20091 | DATA_ERROR | Data error |
Unknown System Error (out-of-range code)
30000 is outside the 20000-29999 range
SYSTEM_UNKNOWN_ERROR is defined in PayErrorCode but its value 30000 exceeds the class's 20000-29999 segment — it stands alone as the "unknown exception" code. Encountering it means an unexpected system-level error occurred; contact the platform to investigate.
| Code | Constant | Description |
|---|---|---|
30000 | SYSTEM_UNKNOWN_ERROR | Unknown system error, unhandled |
IamErrorCode (21000-21999)
| Code | Constant | Description |
|---|---|---|
21014 | USER_EMAIL_ALREADY_EXISTED | Email already exists |
21015 | USER_PHONE_ALREADY_EXISTED | Phone already exists |
21020 | USER_INFO_NOT_EXISTS | User not found |
21025 | ROLE_ALREADY_EXISTED | Role already exists |
21026 | ROLE_NOT_EXISTED | Role not found |
21027 | ROLE_ALREADY_USED | Role in use |
21029 | PERMISSION_NOT_EXIST | No access permission |
22016 | USER_PASSWORD_INVALID | Invalid password |
Exception Mechanism
Business exceptions are thrown via BizInfoException with both a numeric code and a messageKey:
throw new BizInfoException(PayErrorCode.TRADE_STATUS_ERROR, "pay.order.status.invalid");
throw new BizInfoException("pay.route.error.noMatch");- code determines the response
codefield - messageKey determines the translated
msg/messagetext