Overview
This page provides comprehensive information about transaction response codes, AVS (Address Verification System) codes, and CVV (Card Verification Value) response codes returned by the payment gateway.Understanding response codes is essential for proper error handling and transaction management.
Transaction Response Format
All transaction responses are returned in query string format:Response Code
Theresponse variable indicates the overall transaction result:
| Code | Status | Description | Action |
|---|---|---|---|
1 | Approved | Transaction successful | Complete order |
2 | Declined | Transaction declined | Request alternative payment |
3 | Error | Processing error occurred | Review error details, retry if appropriate |
Response Text
Theresponsetext variable provides a human-readable description:
- Approved (response=1)
- Declined (response=2)
- Error (response=3)
Common approval messages:
| Response Text | Meaning |
|---|---|
SUCCESS | Standard approval |
APPROVED | Transaction approved |
HONOR WITH ID | Approved, ID required |
PARTIAL APPROVAL | Partially approved (amount_authorized < requested) |
AVS Response Codes
Address Verification System (AVS) compares billing address with issuer records:Standard AVS Codes
| Code | Description | Recommendation |
|---|---|---|
X | Exact match - Address and 9-digit ZIP | ✅ Accept |
Y | Exact match - Address and 5-digit ZIP | ✅ Accept |
A | Address match only | ⚠️ Review |
W | 9-digit ZIP match only | ⚠️ Review |
Z | 5-digit ZIP match only | ⚠️ Review |
N | No match | ⛔ Decline/Review |
U | Address unavailable | ⚠️ Review |
R | Retry - System unavailable | 🔄 Retry |
E | AVS error | ⚠️ Review |
S | Service not supported | - N/A |
G | Global non-verifiable | - N/A |
International AVS Codes
| Code | Description | Recommendation |
|---|---|---|
B | Street match, postal code not verified | ⚠️ Review |
C | Street and postal code not verified | ⚠️ Review |
D | Street and postal code match (international) | ✅ Accept |
I | Address information not verified | ⚠️ Review |
M | Street and postal code match (international) | ✅ Accept |
P | Postal code match, street not verified | ⚠️ Review |
CVV Response Codes
Card Verification Value (CVV) response codes:| Code | Description | Recommendation |
|---|---|---|
M | CVV match | ✅ Accept |
N | CVV does not match | ⛔ Decline |
P | Not processed | ⚠️ Review |
S | CVV should be on card but was not indicated | ⚠️ Review |
U | Issuer not certified or not provided | ⚠️ Review |
X | No response from card association | ⚠️ Review |
Handling Response Codes
Decision Flow
1
Check Response Code
First, check the
response variable2
Verify AVS
For approved transactions, check AVS
3
Verify CVV
Check CVV response
4
Take Action
Process accordingly based on all checks
Implementation Example
Partial Approvals
Some transactions may be partially approved:amount_authorized- Approved amount (less than requested)partial_payment_balance- Remaining balance
EMV Response Codes
For EMV chip transactions:| Code | Description |
|---|---|
00 | Approved |
01 | Refer to card issuer |
03 | Invalid merchant |
04 | Pick up card |
05 | Do not honor |
12 | Invalid transaction |
13 | Invalid amount |
14 | Invalid card number |
51 | Insufficient funds |
54 | Expired card |
55 | Incorrect PIN |
57 | Transaction not permitted |
58 | Transaction not permitted to terminal |
61 | Exceeds withdrawal amount limit |
62 | Restricted card |
63 | Security violation |
65 | Exceeds withdrawal frequency limit |
ACH Return Codes
Common ACH return codes:| Code | Description | Type |
|---|---|---|
R01 | Insufficient Funds | NSF |
R02 | Account Closed | Account |
R03 | No Account/Unable to Locate | Account |
R04 | Invalid Account Number | Account |
R05 | Unauthorized Debit to Consumer Account | Authorization |
R06 | Returned per ODFI Request | Authorization |
R07 | Authorization Revoked | Authorization |
R08 | Payment Stopped | Stop Payment |
R09 | Uncollected Funds | NSF |
R10 | Customer Advises Not Authorized | Authorization |
R11 | Check Truncation Entry Return | Entry |
R12 | Account Sold to Another DFI | Account |
R13 | Invalid ACH Routing Number | Routing |
R14 | Representative Payee Deceased | Account |
R15 | Beneficiary Deceased | Account |
R16 | Account Frozen | Account |
R20 | Non-Transaction Account | Account |
R29 | Corporate Customer Advises Not Authorized | Authorization |
Chargeback Reason Codes
Visa Reason Codes
| Code | Description | Category |
|---|---|---|
10.1 | EMV Liability Shift Counterfeit Fraud | Fraud |
10.2 | EMV Liability Shift Non-Counterfeit Fraud | Fraud |
10.3 | Other Fraud - Card Present Environment | Fraud |
10.4 | Other Fraud - Card Absent Environment | Fraud |
10.5 | Visa Fraud Monitoring Program | Fraud |
11.1 | Card Recovery Bulletin | Authorization |
11.2 | Declined Authorization | Authorization |
11.3 | No Authorization | Authorization |
12.1 | Late Presentment | Processing |
12.2 | Incorrect Transaction Code | Processing |
12.3 | Incorrect Currency | Processing |
12.4 | Incorrect Account Number | Processing |
12.5 | Incorrect Amount | Processing |
13.1 | Merchandise Not Received | Consumer Dispute |
13.2 | Cancelled Recurring | Consumer Dispute |
13.3 | Not as Described | Consumer Dispute |
Mastercard Reason Codes
| Code | Description | Category |
|---|---|---|
4837 | No Cardholder Authorization | Fraud |
4840 | Fraudulent Processing of Transaction | Fraud |
4841 | Cancelled Recurring Transaction | Consumer Dispute |
4842 | Late Presentment | Processing |
4853 | Cardholder Dispute | Consumer Dispute |
4854 | Cardholder Dispute (US Region Only) | Consumer Dispute |
4855 | Non-Receipt of Merchandise | Consumer Dispute |
4859 | Services Not Rendered | Consumer Dispute |
4860 | Credit Not Processed | Consumer Dispute |
Testing Response Codes
Test Card Numbers
| Card Number | AVS Response | CVV Response | Result |
|---|---|---|---|
4111111111111111 | X | M | Approved |
4000000000000002 | N | N | Declined (AVS/CVV fail) |
4000000000000010 | Y | M | Approved |
4000000000000028 | - | - | Declined (Insufficient Funds) |
4000000000000036 | - | - | Declined (Do Not Honor) |
4000000000000044 | - | - | Declined (Expired Card) |
Test Amounts
Use specific amounts to trigger responses:| Amount | Response |
|---|---|
x.00 | Approved |
x.01 | Declined |
x.02 | Error |
x.05 | Approved with AVS=N |
x.10 | Partial approval ($50.00) |
Best Practices
Log All Responses
Store complete response data for troubleshooting and compliance
Display User-Friendly Messages
Translate technical codes to customer-friendly language
Implement Fraud Rules
Configure AVS/CVV rules based on your risk profile
Handle Retries Gracefully
Implement appropriate retry logic for specific errors

