How Hyperswitch decline code mapping decides retry, cascade or stop
Decline code mapping is how Hyperswitch turns raw processor error codes into a retry, cascade or stop decision. Each processor reports a declined payment with its own codes, and those codes do not mean the same thing across acquirers. A code that signals a temporary issue at one processor may signal a permanent refusal at another. If your self-hosted stack has no consistent mapping, the same customer situation can be retried on one processor, passed to a backup on another, and abandoned on a third, which makes approval rates hard to explain and retry volume hard to control.
The risk grows each time you add a processor. A new connector brings a new set of codes, often with sparse or inconsistent documentation, and a mapping that was correct for your existing processors may quietly misclassify its responses. Before you enable retries or cascading for a new connector, review every error code it can return, record the decision Hyperswitch makes for each one, and check that soft declines (such as issuer unavailability) and hard declines (such as a stolen card or closed account) land in the right bucket. Keep that review with the connector configuration so the next person adding a processor starts from the same baseline.
Treat the exact mapping behavior as something to confirm, not assume. Read the current routing and retry documentation in the Hyperswitch docs, then test the mapping for your version in a non-production environment with the codes your processors actually return. Ask your team to confirm which mappings are shipped defaults, which are configurable, and where overrides are stored. Because minor releases change behavior over time, repeat this check after each upgrade, and record the Hyperswitch version next to every mapping decision so you can explain a past retry outcome to your risk or compliance team.
How a processor decline moves through the retry decision
The flow starts when a processor returns a decline response to the Hyperswitch Router. The processor's error code is matched against the mapping table, which assigns it a category, and that category determines whether the payment retries on the same processor, cascades to the next processor in the routing order, or stops and returns the decline to the merchant. Check that every code your processors send has an explicit mapping, and confirm the exact category names and their default behavior in the Hyperswitch docs before relying on them.
Decline code classification decides between retry, cascade and stop.
What retry, cascade and stop each mean in practice
Every declined payment ends in one of three outcomes: retry the same route, cascade to another eligible processor, or stop. The mapping of processor error codes to these outcomes decides which one happens, so the categories need to match how your traffic actually declines.
Retry for transient failures
A retry suits problems that are likely to clear on their own, such as a processor timeout, a temporary network fault or a generic issuer unavailability response. Retrying the same processor after a short delay can recover these payments without changing the route. Check that retries are capped so a struggling processor is not hammered, and that each retry is recorded against the original attempt for reconciliation. The exact category names and their defaults must be confirmed in the Hyperswitch docs for the release you run.
Routing docsCascade for processor or issuer declines
A cascade sends the payment to another eligible processor when the first one declines for a reason that may be specific to that acquirer or issuer routing, such as a processor-side rule or a decline that another acquiring path could approve. Cascading only works if the second processor is configured, eligible for the currency and card type, and allowed by your fallback order. Confirm which codes trigger a cascade rather than a retry, and watch for duplicate-charge risk on any path that is not idempotent.
Stop for hard declines
Hard declines such as invalid card numbers, expired cards, stolen or lost card reports and closed accounts should end the attempt. Retrying or cascading these wastes authorization attempts, can increase issuer scrutiny and may breach card scheme rules on repeated attempts. Map these codes to stop and return a clear message to the customer, prompting a new payment method. Review the stop list with your fraud and risk team before go-live.
Soft declines that need the customer
Some declines, such as insufficient funds or a request for authentication, may succeed later or with a different method, but only with customer involvement. These are not automatic retries. Route them to a customer prompt, a step-up authentication flow or a delayed retry scheduled by your own rules. Decide which of these your checkout supports before you map them, because the mapping alone cannot prompt the customer.
Confirm categories against your release
The exact category names, default mappings and whether a given code can be overridden depend on the Hyperswitch version you run. Read the routing and retry documentation for your release, then compare the defaults with the codes your processors actually return. Record which version you validated against, because mappings can change between minor releases and an upgrade may shift behavior.
Hyperswitch releasesMapping choices and when each fits
This table compares the three ways a team can handle decline code classification in Hyperswitch: keep the default classification, override codes per connector, or add a formal review step for each new processor. Read each row for the conditions that favor it and the trade-off you accept, then choose a combination that matches your processor mix and in-house capacity.
| Option | When it fits | Main trade-off | What to confirm first |
|---|---|---|---|
| Use the default classification | You run one or two processors with similar decline behavior and want the fewest moving parts | Consistent logic, but processor-specific codes may be treated as generic retry or stop outcomes | Which codes the default treats as retryable, cascadable or terminal in your release |
| Override individual codes per connector | A processor uses a code that means something different from its peers, or a known code is retried too often or not at all | Better accuracy for that processor, but every override is one more rule to test, document and keep in step with upgrades | Processor documentation for each code you plan to change and a sample of logged decline responses |
| Formal review for each new processor | You add processors regularly, operate in a regulated setting, or need evidence of how retry decisions were set | Slower onboarding and a standing owner, in exchange for a traceable record of every mapping decision | Who signs off, which test transactions are required and where mapping decisions are recorded |
| Hybrid: defaults plus a small override set | Most traffic runs through a few well-understood processors and a handful of codes drive most declines | Keeps the review load small, but the team must check that overrides still match the default after each upgrade | How many codes account for most of your declines in logs |
| Retry aggressively on uncertain codes | Your approval rate matters more than issuer-facing retry volume and your processors tolerate repeat attempts | Can recover more payments, but repeated attempts on hard declines may hurt processor standing and cost | Processor guidance on repeat attempts and any limits in your contracts |
| Stop on uncertain codes | Retries carry fraud or cost risk, or a processor has not confirmed how it uses codes | Fewer recovered payments, but less exposure to repeated attempts on declines that should not be retried | Which declines your fraud and risk teams want to see stopped |
How to review decline mappings when adding a processor
This sequence gives the team a repeatable way to decide, for every decline code a new processor can return, whether Hyperswitch should retry, cascade to another processor or stop. The output is a reviewed mapping, tested in a non-production environment and confirmed in a monitored rollout.
Collect the processor's documented error codes
Gather the new processor's full list of documented decline and error codes, including the meaning, whether the code is a soft or hard decline and any guidance on retrying. Use the processor's developer documentation and the written agreement with the processor, and include codes from its webhook payloads as well as synchronous responses. Check that the list is dated and matches the API version you will integrate. The step is done when every code has a source reference and a plain-language meaning, and any code without documentation is flagged for a question to the processor.
Compare codes with the existing mapping
Export the current decline code mapping from your Hyperswitch configuration and line it up against the new processor's list. Mark codes that already exist with the same meaning, codes that exist under a different processor's wording, and codes with no match. Pay particular attention to codes that look similar across processors but mean different things, such as a generic issuer decline versus a processor-side rejection. The step is done when each new code is labeled as matched, ambiguous or unmapped, and the ambiguous list has a named reviewer.
Decide retry, cascade or stop for each code
For each code, the payments, risk and operations owners agree on one action: retry the same processor, cascade to the next eligible processor in your routing order, or stop and return the decline to the customer. Base the decision on the code's meaning and your own risk tolerance rather than on a single example. Record the reason beside each decision so future reviewers can see why it was set. The step is done when every code has one action, a reason and a sign-off from the owners.
Configure overrides for exceptions
Where a processor's code does not fit the defaults, add an explicit override in the Hyperswitch configuration rather than editing shared defaults. Keep each override scoped to the processor it belongs to so that existing processors keep their behavior. Store the configuration change in version control or your change system so it can be reviewed and reverted. The step is done when the configuration is deployed to a non-production environment and a diff against the previous version shows only the intended changes.
Test each mapping in sandbox or staging
Run test transactions in the Hyperswitch sandbox or in your own staging deployment that trigger each decline code the processor's test environment can produce. Confirm that the payment is retried, cascaded or stopped exactly as the decision record says, and that the customer-facing response and the stored attempt status are correct. Where the processor cannot produce a code in testing, mark it as untested rather than assuming the behavior. The step is done when every code has a recorded test result or an explicit untested flag accepted by the owners.
Confirm routing and retry behavior in a monitored rollout
Enable the new processor for a limited share of live traffic under monitoring, watching decline distribution by code, retry counts, cascade events and final outcomes. Compare these against the expected actions in the decision record and check for codes that appear in production but were never tested. Keep a documented rollback path so the processor can be disabled or its mapping reverted quickly. The step is done when the monitored results match the decision record, the owners accept the rollout scope and any new codes seen in production are added to the mapping review.
Why a wrong decline mapping costs approval rate and fees
A wrong decline mapping costs money in two directions at once. Retrying a hard decline (one the issuer or network will not approve on any attempt, such as a card reported lost or stolen) burns processor attempts, adds per-attempt fees where your processor charges them, and can add to the scheme signals that flag your merchant account for poor behavior. Stopping a recoverable decline does the opposite: a payment that would have cleared on a second attempt, after a short wait or with a different processor, is lost as a failed sale. Both errors look small on any single transaction, which is why they often survive for months unless someone measures them. The mapping decides which side of that line each processor code falls on, so an error in the table is an error applied to every payment that carries that code.
The reporting question is therefore not only overall approval rate. Break approvals and declines down by processor and by the raw error code the processor returned, then compare the outcome of every retry or cascade against the original decline. For each mapped code, track how often a retry succeeded, how many attempts were spent to reach that result, and what each attempt cost. Watch for codes that are retried often but almost never succeed, since those are candidates for stopping. Also watch for codes that are stopped but whose customers return with a new attempt and then pay, since those are candidates for retrying. Use the Control Center payment and processor views to pull these splits, and confirm with your processor which fields in their response and reports carry the raw code, because the mapping can only be reviewed against codes you can see.
When you add a processor, review its code set before you copy the existing mapping across. Each acquirer uses its own vocabulary, and a code that means a temporary issuer problem at one processor may mean a permanent refusal at another. Ask each processor for its documented response code list, mark which codes it says are retryable, and test the mapping against a sample of real declines from the new connector before turning it on for live traffic. Plan a monitoring window after go-live and set a rule for who signs off changes to the mapping, since a single edit affects every payment that returns that code. Record each change with the date, the reason and the before and after retry counts, so that later reviews can show whether a change helped. Confirm the exact retry settings and the mapping storage format in the current Hyperswitch documentation for your version before you rely on them.
Security and operational considerations for retry logic
Decline code mappings decide which payments are retried, cascaded or stopped, so they touch card data, customer experience and processor relationships at once. The controls below cover what flows through logs and retries, who can change mappings, how changes are reviewed and how retry volume is watched.
Card data in logs and retries
Retry logic handles payment records that may carry card-adjacent data, and each retry attempt creates another record. Confirm which fields reach application logs, observability tooling and the scheduler queue, and that raw processor responses are masked before they are stored. Ask whether a retry payload ever contains full card data or only tokens. Your answer determines how much of the logging path falls inside your PCI DSS scope.
Vault models docsWho can edit mappings
A mapping that marks a decline code as retryable can multiply authorization attempts across processors, so edit rights should be narrow. Define which roles can change decline classifications, and confirm how Control Center roles are assigned, since roles are managed in Hyperswitch rather than inherited from your identity provider. Separate the people who onboard processors from the people who approve retry behavior where your team size allows it.
SSO and roles docsChange review and version control
Keep mapping definitions in a versioned repository so every change has an author, a reviewer and a diff. Treat a mapping change like a code change, with a test run against sample processor responses before it reaches production. Record which Hyperswitch release and configuration version each mapping was tested against, so a later upgrade can be checked against the same cases.
Monitoring for unexpected retry volume
A misclassified decline code can cause a sudden rise in retries, which raises processor fees, slows checkout and can trigger processor risk reviews. Set alerts on retry count per payment, retry rate per processor and retries following each decline code. Compare these against the baseline from before any mapping change. Confirm with your platform team which dashboards and alert routes are available in your deployment.
Audit trail for configuration
Log who changed a mapping, when, and what the previous value was, and keep those logs separate from payment data so they can be reviewed without exposing cards. Retain them long enough for your internal reviews and any assessor request. Confirm with your QSA how the retention period and log access fit your evidence requirements.
PCI DSS scope depends on vault model
How far retry logic reaches into PCI DSS scope depends on the vault model you choose. With the in-house model, the Hyperswitch docs state that the merchant is fully responsible for PCI DSS certification and data handling. With an external or SaaS vault, the scope of the retry path may differ. Confirm the final boundary with your QSA before go-live.
External vault docsQuestions teams ask before changing decline mappings
Can our own team change Hyperswitch decline code mappings without a partner?
Yes, a team with payments engineering and access to the Hyperswitch configuration can make mapping changes itself, provided it has the processor documentation and a safe place to test. The harder part is not the edit but deciding whether a processor code should stop, retry or cascade, which depends on how that processor actually behaves after a decline. Teams that already run retries and monitor decline reasons usually handle a single processor in-house. Teams without that experience, or with many processors and custom codes, often bring in a partner to review the classification and test it.
What makes the effort of a decline mapping project grow?
Effort grows with four things: the number of processors being mapped, how many custom or undocumented codes each one returns, how many payment methods and geographies you accept, and how deep the testing has to go. Each processor adds its own code list and its own quirks about soft and hard declines. Custom codes need evidence from real transactions before they can be classified. Testing depth ranges from a sandbox check of the main codes to replaying historical decline data against new rules. Ask the provider to break the scope down by these four drivers.
What do we need to provide before work starts on decline mappings?
You need three inputs: the processor's current error code documentation, a sample of recent decline transactions with their raw codes and outcomes, and a test environment connected to the processors you want to validate. Processor documentation is often incomplete, so ask your acquirer account team for the full code list and their guidance on retry rules. Transaction data should cover enough history to show each code's real outcomes. Without a non-production environment that can reproduce declines, classification changes can only be checked on paper.
How long does a decline mapping project take?
Duration depends on scope, not on a fixed template. A single processor with a well-documented code list and a small test plan is a much shorter job than a multi-processor setup with custom codes, replayed transaction data and staged rollout. Your timeline also depends on how quickly processor teams answer questions and how long your change control takes. Ask for a timeline tied to named processors, a defined number of test cycles, and the rollout steps, rather than one overall number.
What is the cost of changing decline mappings, and what recurs?
The one-time cost covers the review of current mappings, classification of each code, test design and execution, and the change record. A recurring cost appears whenever a processor changes its codes, when you add a processor, or when retry performance needs review. Internal costs also matter: engineer time, processor coordination and the risk of a bad classification affecting approval rates. Ask any provider to separate one-time work from ongoing review and to state what triggers a re-review.
What should a quote for decline mapping work include?
A useful quote lists the processors and payment methods in scope, the code inventory it will classify, the testing approach including whether historical data is replayed, and the deliverables such as the mapping table, test evidence and change steps. It should name who provides processor documentation and transaction data, the test environment, the rollout and rollback approach, and what happens if processor documentation is missing. Confirm how acceptance is decided and what support follows handover. DeployOpen agrees scope, deliverables and timelines in writing before work starts, so a quote should trace back to that written scope.
How do we confirm a new decline mapping does not hurt approval rates?
Confirm it with a controlled comparison and a clear list of guardrails before rollout. Define the approval and retry metrics you watch, run the change against a limited share of traffic, and compare results with the current mapping. Check that retries do not repeat hard declines and that cascades do not push payments to processors that should not receive them. Verify the mapping against the processor's own documentation and your transaction data, and keep a rollback path ready. Confirm the exact routing and retry options available in your Hyperswitch version with your team before you rely on them.
When an outside team is worth bringing in
An outside team earns its place when the work is wide and uneven rather than deep. Decline code mapping gets hard quickly once a stack connects many processors, because each acquirer returns its own codes, its own meanings for similar refusals and its own rules about which retries are allowed. A partner can take the inventory of every connector your Hyperswitch deployment uses, collect the raw codes from each, and draft a mapping that your team reviews line by line. The useful question to ask is how many distinct processor codes you will classify, and whether your own staff have time to read the processor documentation for each one and keep it current.
A migration with live retry traffic is the case where mistakes cost the most. When you move onto a self-hosted Hyperswitch stack, the retry behavior for in-flight and recurring payments can change at the same moment the mapping changes, so a wrong classification can retry a hard decline or stop a recoverable one without any visible error. An outside team can run the old and new classifications side by side against historical decline data, stage the cutover, and define what to watch in the first days. Confirm with your own engineers which decline data you can export, how long it is retained, and whether it contains card data that must stay out of the review environment.
Assessment readiness is the third reason. A written mapping, its review history and the test results that show each class of decline behaves as intended are the evidence that compliance and risk reviewers ask for, and they are easier to produce if the review process was designed with them in mind from the start. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports or attestations, and independent auditors make that judgment. When you ask for a quote, ask the partner which artifacts it will hand over, who keeps the mapping under change control after the engagement, and how the review steps repeat when a new processor is added to the stack.
How DeployOpen scopes and delivers decline mapping work
DeployOpen plans, implements, customizes, tests, documents and supports self-hosted open-source platforms inside your own infrastructure, and decline code mapping is handled the same way. We start from your processors, your current retry behavior and your written requirements, then build and verify the mapping in your environment so your team can review and run it.
How we scope
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- The written scope lists the processors whose error codes need mapping and the retry, cascade and stop outcomes each code must reach.
- Ask for the scope to name which processors are already connected and which are planned for addition in the same engagement.
How we build
- We build the mapping for each processor's error codes inside your self-hosted Hyperswitch deployment, not in a shared service.
- Test cases cover each mapped code with expected retry, cascade or stop behavior, so reviewers can check every classification.
- Security testing covers how the mapping handles card-related errors, so sensitive data is not exposed in retry logs or dashboards.
How we hand over
- You receive the mapping table, the test cases and the review checklist used when adding a new processor.
- Documentation explains the classification logic, who approves changes and how to record each decision for later audit.
- Your team walks through the handover so operators can review mappings and add processors without outside help.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, which can cover mapping changes after a processor update.
- Each Hyperswitch upgrade is checked against the mapping tests, since new releases can change how errors reach the router.
- Support requests are handled against the written scope, so changes to processors or retry rules are priced from a new written scope.

