Return Codes
The return-code engine (pkg/returncodes) maps a normalized ACH return code or Usio card decline code to an action plan — invalidate the bank account or card, blocklist the user, send an Iterable event — and dispatches it. ACH returns reach it asynchronously through site-payments-blocklist-handler; card declines reach it synchronously inside POST /payments. The per-code tables at the bottom of this page are generated from the Go tables by make docs.host.
Normalization
payment_method |
Scheme | Raw code resolution |
|---|---|---|
|
ACH (NACHA |
Usio: |
|
Card (Usio decline codes) |
|
|
None |
No instrument-level handling. |
A code in neither table resolves to Known = false: no instrument action, no comms, one warning log.
Source: pkg/returncodes/engine.go, pkg/returncodes/jpm_mapping.go
Action Plan
Resolve is pure: a target (user ID, raw code and info, payment method, IsFloat, failed account or card ID, optional email) becomes an ActionPlan mirroring the matched code’s Config.
| Field | Meaning |
|---|---|
|
Remove the bank account record and write a |
|
Mark the debit card |
|
Also set |
|
ACH codes that must never be re-presented: |
|
The per-code Iterable event. |
Comms identify the user by email: Target.Email when the caller supplied one (the email field on a payment request), otherwise a User Service lookup made only when comms are about to send. No email resolved → comms skipped, instrument actions still run.
Source: pkg/returncodes/codes.go (Config), pkg/returncodes/engine.go
ACH Dispatch (Handle)
Called by the blocklist-handler for every SUBSCRIPTION_RETURNED / FLOAT_DEBIT_RETURNED event (Blocklist). For an invalidate-bank code:
-
Remove the bank account record (
bankaccount.Service.Remove) — Bank Accounts. -
Write
BLOCKEDkeyed on the user, with the payment’s confirmation ID astrigger_id. -
Send the Iterable event (float payments only).
Each action is attempted independently; failures are logged and joined, and never fail the originating payment. The user’s Plaid item is not touched.
Card Dispatch (HandleCardDecline)
Called by POST /payments after a pinless decline that carries a Usio confirmation ID; a pre-network rejection or system error never reaches it — Failed payments.
-
InvalidateCard→is_valid = false,invalid_dateset, card saved. -
Suspendwith the flag on →suspended_onset; the physical card cannot be added again — Suspended cards. -
Send the Iterable event (float payments only).
Metrics
| Metric | Fires | Tags |
|---|---|---|
|
Once per handled card decline |
|
|
Card-invalidation save |
|
|
Card-suspension save |
|
|
Every blocklist write |
|
|
Per-code comms attempt |
|
Unknown codes tag code:unknown.
Code Tables
| Column | Meaning |
|---|---|
Bank action |
|
Card action |
|
Comms |
Whether the Iterable event sends for a float payment. |
Iterable event |
Event name; populated for logging even when Comms is |
Re-presentment |
|
ACH return codes
| Code | Meaning | Bank action | Comms | Iterable event | Re-presentment |
|---|---|---|---|---|---|
|
Insufficient Funds |
keep |
yes |
|
allowed |
|
Account Closed |
invalidate + blocklist |
yes |
|
allowed |
|
No Account/Unable to Locate Account |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid Account Number Structure |
invalidate + blocklist |
yes |
|
allowed |
|
Unauthorized Corporate Entry |
invalidate + blocklist |
yes |
|
allowed |
|
Returned per ODFI Request |
keep |
yes |
|
allowed |
|
Authorization Revoked by Customer |
invalidate + blocklist |
yes |
|
prohibited |
|
Payment Stopped |
invalidate + blocklist |
yes |
|
prohibited |
|
Uncollected Funds |
keep |
yes |
|
allowed |
|
Customer Advises Not Authorized |
invalidate + blocklist |
yes |
|
prohibited |
|
Entry Not In Accordance with Terms |
invalidate + blocklist |
yes |
|
allowed |
|
Account Sold to Another DFI |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid ACH Routing Number |
invalidate + blocklist |
yes |
|
allowed |
|
Representative Payee Deceased |
invalidate + blocklist |
yes |
|
allowed |
|
Beneficiary or Account Holder Deceased |
invalidate + blocklist |
yes |
|
allowed |
|
Account Frozen/Funds Returned |
invalidate + blocklist |
yes |
|
allowed |
|
File Record Edit Criteria |
invalidate + blocklist |
yes |
|
allowed |
|
Improper Effective Entry Date |
invalidate + blocklist |
yes |
|
allowed |
|
Amount Field Error |
keep |
yes |
|
allowed |
|
Non-Transaction Account |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid Company Identification |
keep |
yes |
|
allowed |
|
Invalid Foreign Receiving DFI Identification |
keep |
yes |
|
allowed |
|
Credit Entry Refused by Receiver |
invalidate + blocklist |
yes |
|
allowed |
|
Duplicate Entry |
keep |
yes |
|
allowed |
|
Addenda Error |
keep |
yes |
|
allowed |
|
Mandatory Field Error |
keep |
yes |
|
allowed |
|
Trace Number Error |
keep |
yes |
|
allowed |
|
Routing Number Check Digit Error |
invalidate + blocklist |
yes |
|
allowed |
|
Corporate Customer Advises Not Authorized |
invalidate + blocklist |
yes |
|
allowed |
|
RDFI Not Participant in Check Truncation Program |
invalidate + blocklist |
yes |
|
allowed |
|
Permissible Return Entry (CCD and CTX only) |
invalidate + blocklist |
yes |
|
allowed |
|
RDFI Non-Settlement |
invalidate + blocklist |
yes |
|
allowed |
|
Return of XCK Entry |
invalidate + blocklist |
yes |
|
allowed |
|
Limited Participation DFI |
invalidate + blocklist |
yes |
|
allowed |
|
Improper Debit |
invalidate + blocklist |
yes |
|
allowed |
|
Improper Credit |
invalidate + blocklist |
yes |
|
allowed |
|
Source Document Presented for Payment |
keep |
yes |
|
allowed |
|
Stop Payment on Source Document |
invalidate + blocklist |
yes |
|
allowed |
|
Improper Source Document |
invalidate + blocklist |
yes |
|
allowed |
|
Return of ENR |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid Transaction Code |
invalidate + blocklist |
yes |
|
allowed |
|
Routing Number Check Digit Error (ENR) |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid DFI Account Number |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid Individual ID Number (ENR) |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid Individual / Company Name |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid Representative Payee Indicator |
invalidate + blocklist |
yes |
|
allowed |
|
Duplicate Enrollment |
keep |
yes |
|
allowed |
|
State Law Affecting RCK Acceptance |
invalidate + blocklist |
yes |
|
allowed |
|
Ineligible / Improper Item Related to RCK |
invalidate + blocklist |
yes |
|
allowed |
|
Stop Payment on Item Related to RCK |
invalidate + blocklist |
yes |
|
allowed |
|
Item and RCK Entry Presented for Payment |
keep |
yes |
|
allowed |
|
Misrouted Return |
invalidate + blocklist |
yes |
|
allowed |
|
Erroneous / Reversing Debit |
keep |
yes |
|
allowed |
|
Duplicate Return |
keep |
yes |
|
allowed |
|
Untimely Return |
keep |
yes |
|
allowed |
|
Field Error |
invalidate + blocklist |
yes |
|
allowed |
|
Permissible Return Not Accepted / Not Requested by ODFI |
invalidate + blocklist |
yes |
|
allowed |
|
Misrouted Dishonored Return |
invalidate + blocklist |
yes |
|
allowed |
|
Untimely Dishonored Return |
invalidate + blocklist |
yes |
|
allowed |
|
Timely Original Return |
keep |
yes |
|
allowed |
|
Corrected Return |
keep |
yes |
|
allowed |
|
Return Not Duplicate |
keep |
yes |
|
allowed |
|
No Errors Found |
keep |
yes |
|
allowed |
|
Non-Acceptance of R62 Dishonored Return |
invalidate + blocklist |
yes |
|
allowed |
|
IAT Coding Error |
invalidate + blocklist |
yes |
|
allowed |
|
Non-Participant in IAT Program |
invalidate + blocklist |
yes |
|
allowed |
|
Invalid Foreign RDFI Identification |
invalidate + blocklist |
yes |
|
allowed |
|
Foreign RDFI Unable to Settle |
invalidate + blocklist |
yes |
|
allowed |
|
Not Processed by Gateway |
invalidate + blocklist |
yes |
|
allowed |
|
Incorrectly Coded Outbound International Payment |
invalidate + blocklist |
yes |
|
allowed |
Card decline codes
Network override rows (Visa 62) follow the main table.
| Code | Meaning | Card action | Comms | Iterable event |
|---|---|---|---|---|
|
Approved / Completed Successfully |
keep |
no |
— |
|
Refer to Card Issuer |
keep |
yes |
|
|
Refer to Card Issuer (Special Conditions) |
keep |
yes |
|
|
Invalid Merchant |
keep |
yes |
|
|
Pick-Up (No Fraud Indicated) |
invalidate + suspend |
yes |
|
|
Do Not Honor |
keep |
yes |
|
|
General Error / 6P |
keep |
yes |
|
|
Pick-Up Card (Fraud / Special Conditions) |
invalidate + suspend |
yes |
|
|
Honor with Identification (Approval Variant) |
invalidate |
no |
|
|
Request in Progress |
keep |
yes |
|
|
Approved for Partial Amount |
keep |
no |
|
|
Approved (VIP) |
keep |
no |
— |
|
Invalid Transaction |
invalidate |
yes |
|
|
Invalid Amount |
keep |
yes |
|
|
Invalid Card Number (No Such Number) |
invalidate + suspend |
yes |
|
|
No Such Issuer |
invalidate + suspend |
yes |
|
|
Manual PAN Tries Exceeded |
invalidate |
yes |
|
|
Re-Enter Transaction |
keep |
yes |
|
|
Invalid Response |
keep |
yes |
|
|
Reversal Unsuccessful |
keep |
yes |
|
|
File Temporarily Unavailable |
keep |
yes |
|
|
Message Format Error |
keep |
yes |
|
|
Bank Not Supported by Switch |
invalidate |
yes |
|
|
Pick Up Card — Expired |
invalidate + suspend |
yes |
|
|
Suspected Fraud, Pick Up |
invalidate + suspend |
yes |
|
|
Allowable PIN Tries Exceeded |
invalidate |
yes |
|
|
No Credit Account |
invalidate + suspend |
yes |
|
|
Requested Function Not Supported |
invalidate |
yes |
|
|
Lost Card, Pick Up |
invalidate + suspend |
yes |
|
|
Stolen Card, Pick Up |
invalidate + suspend |
yes |
|
|
No Investment Account |
keep |
yes |
|
|
Account Closed |
invalidate + suspend |
yes |
|
|
Remote Function Unknown |
keep |
yes |
|
|
Insufficient Funds |
keep |
yes |
|
|
No Checking Account |
invalidate + suspend |
yes |
|
|
No Savings Account |
invalidate |
yes |
|
|
Expired Card |
invalidate |
yes |
|
|
Incorrect PIN |
invalidate |
yes |
|
|
Cannot Process / No Card Record |
keep |
yes |
|
|
Transaction Not Permitted to Cardholder |
invalidate + suspend |
yes |
|
|
Transaction Not Permitted to Terminal (May Also Be Chargeback) |
invalidate |
yes |
|
|
Suspected Fraud |
invalidate |
yes |
|
|
Exceeds Withdrawal Amount Limit |
keep |
yes |
|
|
Restricted Card |
invalidate |
yes |
|
|
Security Violation |
invalidate + suspend |
yes |
|
|
Exceeds Withdrawal Frequency Limit |
keep |
yes |
|
|
Hard Capture, Pick-Up |
invalidate + suspend |
yes |
|
|
Allowable PIN Tries Exceeded |
keep |
yes |
|
|
Unable to Locate / Late Reversal |
keep |
yes |
|
|
Inconsistent Data / Reversal or Repeat |
keep |
yes |
|
|
Customer Not Eligible for POS (Star SM) |
keep |
yes |
|
|
Already Reversed at Switch / No 'From' Account |
invalidate |
yes |
|
|
Invalid Date |
invalidate |
yes |
|
|
Cryptographic Error |
invalidate |
yes |
|
|
Cashback Limit Exceeded / Invalid CVV |
invalidate |
yes |
|
|
Fraud, Card-Absent Environment |
invalidate + suspend |
yes |
|
|
Cannot Verify PIN |
invalidate |
yes |
|
|
Card Record Not Available |
keep |
yes |
|
|
CVV Verification Failed (No Pickup) |
keep |
yes |
|
|
Issuer or Switch is Inoperative |
invalidate |
yes |
|
|
Financial Institution Cannot Be Found for Routing |
invalidate |
yes |
|
|
Violation / Cannot Complete / Illegal Transaction |
invalidate |
yes |
|
|
System Malfunction |
keep |
yes |
|
|
Duplicate Transaction |
keep |
yes |
|
|
Preferred Debit Routing Denial |
invalidate |
yes |
|
|
Do Not Honor (Extended) |
keep |
yes |
|
|
Expired Card (Extended) |
invalidate |
yes |
|
|
Refer to Card Issuer (Extended) |
keep |
yes |
|
|
Refer to Card Issuer’s Special Condition (Extended) |
keep |
yes |
|
|
No Account of Type Requested |
invalidate |
yes |
|
|
Insufficient Funds (Extended) |
keep |
yes |
|
|
Transaction Not Permitted to Cardholder (Extended) |
invalidate + suspend |
yes |
|
|
Exceeds Withdrawal Frequency Limit (Extended) |
keep |
yes |
|
|
Stolen Card |
invalidate + suspend |
yes |
|
|
Transaction Destination Cannot Be Found for Routing |
keep |
yes |
|
|
Blocked (9G) |
invalidate |
yes |
|
|
P2PE Encryption Required |
invalidate |
yes |
|
|
Verification Error |
keep |
yes |
|
|
Verification Error (Alternate) |
keep |
yes |
|
|
No Available Gateway Nodes |
keep |
yes |
|
|
Unknown / Not Documented |
keep |
yes |
|
|
Cashback Service Not Available |
keep |
yes |
|
|
Exceeds Issuer Withdrawal Limit |
keep |
yes |
|
|
Error in Addition / CVV Mismatch |
invalidate |
yes |
|
|
Invalid Credit Card Number (USIO-Specific) |
invalidate + suspend |
yes |
|
|
Stop Payment Order |
invalidate + suspend |
yes |
|
|
Credit Not Received (Recurring Charge Stopped) |
invalidate + suspend |
yes |
|
|
Revocation of All Authorizations |
invalidate + suspend |
yes |
|
|
Unknown Backend Processing Error |
keep |
yes |
|
|
Expiration Date Mismatch |
invalidate |
yes |
|
|
Inactive Card |
invalidate |
yes |
|
|
MasterCard MoneySend Decline — Card Declined |
invalidate |
yes |
|
|
MasterCard MoneySend Decline — Unsupported Card |
invalidate |
yes |
|
|
MasterCard MoneySend Error — Unknown Reason |
invalidate |
yes |
|
| Code | Meaning | Card action | Comms | Iterable event |
|---|---|---|---|---|
|
Restricted Card |
keep |
yes |
|
JPM ISO code mapping
Fallback used only when return_info carries no Rxx prefix. The map holds ISO codes that resolve to a single R-code; AG01 and NARR are not mapped.
| JPM ISO code | Usio code | Meaning |
|---|---|---|
|
|
Invalid Account Number Structure |
|
|
Account Closed |
|
|
Account Frozen/Funds Returned |
|
|
Authorization Revoked by Customer |
|
|
Insufficient Funds |
|
|
Duplicate Entry |
|
|
Uncollected Funds |
|
|
No Account/Unable to Locate Account |
|
|
Payment Stopped |
|
|
File Record Edit Criteria |
|
|
Beneficiary or Account Holder Deceased |
Source: pkg/returncodes/codes.go, pkg/returncodes/jpm_mapping.go — regenerate with make docs.host