Skip to content

Errors ​

Error

json
{
	"code": 409,
	"label": "64",
	"message": "Refund or capture currency does not match the original transaction currency."
}

When an API request fails, NihaoPay will return an error object.

NihaoPay errors follow conventional HTTP status codes. A 2xx code indicates request success; therefore, you will not see any of these codes in the error object. A 4xx code indicates an error in the information provided. These could be anything from a malformed request, an unauthenticated request, or an unknown endpoint. A 5xx code indicates NihaoPay’s internal server error.

There are certain features that are not yet available but are documented in this API Reference. Requesting those features from the API will result in a 501 error.

Feel free to contact our tech support team at tech_support@nihaopay.com if you encounter errors.

Error Object ​

PropertyDescription
code
int
HTTP status code.
label
string
Label of the error generated by NihaoPay. Support team may ask for this to help with integration questions.
message
string
A human readable message as to the cause of the encountered error.

Error List ​

codelabelmessage
20000Success
40201Transaction failed. Please try again.
40202Cardholder input an incorrect card number.
40203Cardholder's issuing bank prevented the transaction.
40206Customer input an expired card number.
40211Customer has insufficient funds available.
40214Cardholder input an incorrect expiration date.
40215Cardholder authentication failed. Please verify cardholder's information.
40221Cardholder authentication failed. Please verify cardholder's information.
40222Card state is incorrect.
40230The amount exceeds transaction limit placed.
40031Transaction reference number must be unique. Please re-submit.
40032This payment channel is restricted. Please contact NihaoPay customer service.
40933Transaction failed. Information submitted in a repeat transaction must match the original attempted transaction exactly.
40236Transaction exceeds the cardholder's credit limit.
42939Too many transactions attempts by cardholder.
40256Cardholder's chosen payment card is not supported in this Gateway.
40257Cardholder has not activated online payments with their issuing bank.
40459Failed. Transaction have refund or chargeback.
40460Transaction has been cleared, please request refund.
40261Transaction not found.
40262Transaction is not within the acceptance time range.
40263The original transaction failed. You cannot refund, cancel, capture, or release an unsuccessful transaction.
40964Refund or capture currency does not match the original transaction currency.
40965Transaction has previously been cancelled.
40966Failed to refund transaction. Transaction has previously been fully refunded.
40267Failed to refund transaction. Refund amount exceeds original transaction amount or remaining transaction balance .
40268Failed to capture transaction. Transaction has previously been released.
40269Failed to capture transaction. Transaction has previously been captured.
40270Failed to capture transaction. Capture amount exceeds authorization amount.
40271Buyer not exist or buyer account info error
40272Transaction amount is exceed the limit
50081Merchant config error
50082Merchant unavailable
50083QRcode has expired
50084Service is not activated for this account
40286Withdrawal amount exceeds account balance
40287Withdrawal amount less than the minimum withdrawal amount
40288Invalid application, it's only available for manually withdrawal merchant
40090The field not valid.
50091Signature error
50092The {0} field is required.
40493The Exchange rate not found.
50096Timeout
50097Inner error
50098Vendor error
50099System error
401301Invalid merchant credentials provided

Last Updated - 01/16/2025