Skip to main content

Exception Codes

TOPPAY TeamAbout 1 min

Overview

The following are example business exception codes returned by gateway or business APIs. Field names may differ depending on the API: code, bizCode, errorCode, etc. Always refer to the specific API response for the exact field name. Implement branching logic based on the code value. 9999 indicates business success. All other non-success codes should be handled according to the scenario by retrying the request if appropriate, or correcting the request parameters before resubmission.

Relationship to HTTP status

The business code is usually carried in the JSON body; the HTTP status may still be 200. Always rely on the business code inside the response body.

Exception Code Reference

General

CodeMessageDescriptionSuggested action
0000unknown exceptionUnknown errorLog full request/response, retry; contact support if persistent
9999SUCCESSSuccessContinue normal success flow

Validation & business (0001–0010)

CodeMessageDescriptionSuggested action
0001Parameter exception!Invalid or missing parametersVerify required fields, types, length, and format against API docs
0002signature verification failed!Signature invalidCheck private key, signing string rules, and ensure sign is excluded from the string to sign; see Signature
0003mch no channel available!No channel available for merchantCheck amount/limits compliance; confirm channel activation and routing with ops / dashboard
0004request duplicate!Duplicate requestUse idempotency keys or merchant order number to deduplicate; avoid rapid resubmits
0005order abnormality!Order state inconsistentQuery order status before any retry; do not retry blindly
0006the order does not exist!Order not foundVerify order number and environment (sandbox vs production)
0007Order payment method has been selected!Payment method already chosenDo not change channel again; continue or cancel and create a new order
0008Order status abnormal!Order status not allowed for this operationQuery order; only call APIs valid for the current status
0009There is no payment method available for the order!No payment method for this orderCheck merchant/order supports the method and region configuration
0010the bank does not exist!Bank code invalidValidate bank code against the documented bank list

Other & risk (1000–1003)

CodeMessageDescriptionSuggested action
1000other exception!Other errorLog context; retry or contact support
1001ip whitelist exception!IP not allowedAdd the egress IP to the merchant allowlist or contact support
1002Insufficient balance!Insufficient balanceTop up or reduce transaction amount
1003amount exceptionAmount invalidCheck currency rules, min/max limits, decimal places, and amount unit

Sample response (illustrative)

{
  "code": "0002",
  "message": "signature verification failed!",
  "data": null
}

Field names may differ per API—follow the endpoint documentation.