Failure Codes Reference
When a payment fails, Uplef sends a payment.failed webhook with a failureCode and failureReason. These codes follow a unified 5-digit format regardless of which underlying payment processor handled the transaction.
Code Categories
| Prefix | Category | Meaning |
|---|---|---|
10xxx | Approved | Payment succeeded (you'll see this in payment.success, not payment.failed) |
20xxx | Soft decline | Temporary issue — customer can usually retry with the same card |
30xxx | Hard decline | Permanent issue with the card — do not retry |
40xxx | Risk | Blocked by risk engine or compliance |
A 20xxx code means "try again." A 30xxx code means "this card cannot be used — block it permanently or ask for a different card." Auto-retrying a hard decline can result in chargebacks or scheme fees.
Soft Declines (20xxx)
These represent temporary issues. The customer may retry with the same card after addressing the issue (e.g., add funds, retry CVV, complete 3DS).
| Code | Message |
|---|---|
20001 | Refer to card issuer |
20002 | Refer to card issuer — special condition |
20003 | Invalid merchant |
20005 | Declined by issuer |
20006 | Gateway error |
20009 | Transaction pending |
20012 | Invalid transaction |
20013 | Invalid amount |
20014 | Invalid card number |
20017 | Customer cancelled |
20019 | Re-enter transaction |
20020 | Acquirer unavailable |
20025 | Card record not found |
20030 | Format error |
20039 | No credit account |
20040 | Function not supported |
20051 | Insufficient funds |
20052 | No cheque account |
20053 | No savings account |
20054 | Card expired |
20055 | Incorrect PIN or security code |
20056 | Unknown card |
20057 | Transaction not permitted on this card |
20058 | Transaction not permitted on this terminal |
20059 | Suspected fraud — declined |
20061 | Withdrawal limit exceeded |
20062 | Restricted card |
20063 | Security violation |
20064 | Amount exceeds pre-authorized total |
20065 | Withdrawal frequency exceeded |
20068 | Issuer response timed out |
20070 | Contact card issuer |
20071 | PIN not changed |
20072 | Card not yet activated |
20075 | PIN attempts exceeded |
20078 | Card blocked — first use |
20079 | Card lifecycle issue |
20082 | No security model |
20083 | No accounts available |
20091 | Issuer unavailable |
20092 | Routing failed |
20093 | Transaction prohibited by law |
20094 | Duplicate transaction |
20096 | System malfunction |
20099 | Other — declined |
3D Secure (3DS)
| Code | Message |
|---|---|
20150 | 3D Secure not enrolled |
20151 | 3D Secure authentication failed |
20152 | 3D Secure session timed out |
20153 | 3D Secure system error |
20154 | 3D Secure authentication required |
20159 | 3D Secure ACS malfunction |
Special codes
| Code | Message |
|---|---|
200N7 | CVV check failed |
200N3 | Cashback service unavailable |
200N4 | Cashback amount exceeded |
200P1 | Over daily limit |
200P9 | Limit exceeded — try a smaller amount |
200R1 | Issuer stop payment |
200R3 | Issuer revoked authorization |
2005C | Card not supported by issuer |
2009G | Blocked by cardholder |
Issuer policy / lifecycle
| Code | Message |
|---|---|
20179 | Card lifecycle — issuer declined |
20182 | Issuer policy decline |
20183 | Issuer security decline |
20184 | Issuer lifecycle decline |
Hard Declines (30xxx)
Do not retry these cards. Block them in your system to avoid further declines or chargebacks.
| Code | Message |
|---|---|
30004 | Card flagged for pickup |
30007 | Card flagged for pickup — special |
30015 | Invalid card issuer |
30033 | Card expired — flagged for pickup |
30034 | Suspected fraud — flagged for pickup |
30035 | Contact acquirer — pickup |
30036 | Restricted card — pickup |
30037 | Security flag — pickup |
30038 | PIN attempts exceeded — pickup |
30041 | Lost card — do not retry |
30043 | Stolen card — do not retry |
30044 | Transaction rejected — compliance (AMLD5) |
Risk Responses (40xxx)
These come from Uplef's or the gateway's risk engine, not the cardholder's bank.
| Code | Message |
|---|---|
40101 | Blocked by risk engine |
40102 | Country not supported |
40104 | CVV missing or invalid |
40111 | Address verification failed |
43201 | Card on decline list |
Recommended Handling
function handlePaymentFailed(data) {
const code = data.failureCode;
const family = code.substring(0, 2);
if (family === '20') {
// Soft decline — customer can retry
showRetryPrompt(data.failureReason);
} else if (family === '30') {
// Hard decline — block this card permanently
blockCard(data.gatewayPaymentId);
showUseDifferentCardPrompt();
} else if (family === '40') {
// Risk block — review manually
flagForReview(data.transactionId);
}
// Code-specific actions
switch (code) {
case '20051':
// Insufficient funds — suggest different card
break;
case '20151':
// 3DS failed — suggest retry with proper OTP entry
break;
case '20054':
case '30033':
// Expired card
promptUpdateCard();
break;
}
}
Need More Detail?
If you need the underlying gateway's raw response code for a specific transaction (e.g., for reconciling with the gateway's dashboard), contact Uplef support with the transactionId. We preserve the raw gateway response internally.