Skip to content

Error Handling

When you encounter an error while calling the PayKKa API,there are two possible cases:

  1. Non-200 HTTP Code is returned

This is a standard PayKKa response. We recommend checking the request based on the returned ret_code and ret_msg.

{
    "ret_code": "010000",
    "ret_msg": "Invalid request"
}

{
    "ret_code": "1004",
    "ret_msg": "Merchant does not support this payment method"
}
  1. 200 HTTP Code is returned,but the response body contains additional business error details

For example,in a transaction request,although the request itself was successful,a business error is returned with the parameters error_code and error_description.
We recommend handling business errors appropriately to ensure a smooth experience for your customers.

Note: The business parameters may vary for different APIs.

{
    "ret_code": "000000",
    "ret_msg": "Success",
    "data": {
        "error_code": "2099",
        "error_description": "Invalid Card",
        "merchant_id": "18356675194960",
        "trans_id": "T4329476032",
        "order_id": "GW206194332333335",
        "status": "FAILURE",
        "amount": 322,
        "currency": "HKD"
    }
}

Response Format

Parameter Name DescriptionType Required
ret_codeResponse error codeString
ret_msgResponse error messageString
dataResponse business data,may be empty if the business failsObject

Error Enums (ret_code)

CodeDescription
000000Request successful
999999System exception
010000Invalid request,parameter error

Transaction error codes see Transaction Error Codes for more details.