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"
}
  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
206001Invalid API version
206002Signature not found
206003Signature error
206004Signature expired
206005Merchant does not exist
206006Merchant public key not configured
206007Merchant status disabled
206008Member status disabled
206011The session does not exist
206017PCI compliance insufficient
206020Card information decryption failed
206021Card encryption information expired,please retry payment
206022Card not supported,please use another card
206024the order doesn't exist
210001Payment method not supported
210002shopperReference cannot be empty
210003shipping cannot be empty
210004MIT cannot be empty
210005MIT must be true
210006MIT must be false
210009Recurring payment agreement does not exist
210010Recurring payment agreement not activated
210011returnUrl cannot be empty
210012browser cannot be empty
210013IP address cannot be empty
210014token or card information cannot be empty
210015Phone or email cannot be empty
210016tokenUsage cannot be empty
210017Card information cannot be empty
210018Card expiry year cannot be empty
210019Card expiry month cannot be empty
210020CVV cannot be empty
210021Payment information error
210022Card Token not recognized
210023Card Token not activated
210024Card Token not supported
210025Card not supported,please use another card
210026Invalid bank card
210027Merchant does not exist
210028Merchant disabled
210029Merchant not allowed to transact
210030Merchant not allowed to refund
210031Merchant currency not supported
210032Merchant payment type not supported
210033Merchant payment method not supported
210037Refund currency differs from original transaction
210038Transaction not allowed to refund
210039Transaction completed,duplicate submission not allowed
210040Refund completed,duplicate submission not allowed
210042Channel error
210043Order number and transaction ID cannot both be empty
210044Order does not exist
210045Invalid expiry time
210047Refund amount cannot exceed refundable amount
210048Multiple submissions inconsistent
210049Checkout completed,duplicate submission not allowed
210050Current order status not allowed to modify
210051Invalid order parameters
210052Checkout does not exist
210054Payment order processing,please do not repeat payment
210055No available route
210056Area code cannot be empty when phone is not empty
210057Billing country cannot be empty
210058Transaction not allowed to close
210059First name and last name cannot be empty
210060Address cannot be empty
210061City cannot be empty
210062Transaction not allowed to capture
210063Transaction not allowed to void
210064Capture failed
210065Void failed
210066Capture amount cannot exceed capturable amount
210067Capture currency differs from original transaction
210068tokenAuthentication cannot be empty