Hyperswitch payment routing rules

A build guide for designing routing across processors in self-hosted Hyperswitch, choosing between rule-based, volume-based, auth-rate and least cost strategies, and testing changes before live traffic.

On this page

How Hyperswitch payment routing rules decide where each payment goes

A team that self-hosts Hyperswitch has to decide which processor handles each payment, and what happens when that processor declines the payment or is not eligible to take it. Routing is a live money decision. Each choice affects authorization rates, processing cost, and how much customer experience depends on a single connector. A static mapping that sends every card payment to one processor is easy to reason about, but it cannot react when a processor degrades, when a currency or card type is outside its coverage, or when a cheaper path exists. Routing logic has to be designed as a set of rules that are evaluated on every payment, in the order you define, and the outcome of each rule has to be understood before it reaches production traffic.

Hyperswitch documents six routing strategies, and each suits a different goal. Rule-based routing sends payments to processors based on conditions you write, such as currency, amount or payment method, and is the most predictable option for compliance-driven or contractual splits. Volume-based routing distributes payments across processors by share, which helps when you need to keep each contract near a negotiated volume. Auth-rate routing favors the processor with the better recent approval performance. Multi-objective routing re-ranks processors by auth rate with processor cost factored in. Least cost routing for debit networks chooses the lowest-cost eligible path for debit transactions. Default fallback routing applies when no rule matches or a processor is ineligible. Confirm the exact configuration fields and evaluation order for your release in the Hyperswitch intelligent routing documentation before you commit to a design.

Which Hyperswitch components and settings carry routing

Routing in Hyperswitch is not one setting. It is a chain of components: connectors that must be configured first, a core server that evaluates rules and retries, a Control Center where teams manage the configuration, and the Router, Scheduler, PostgreSQL and Redis services that keep decisions and state available. Check each link in this chain before changing a routing strategy.

Rust core app server

The core app server handles routing decisions, retries, vaulting and observability. It evaluates the routing strategy for each payment and decides which processor receives it, and when a processor fails, whether to retry through the next one. Before you design rules, confirm which routing and retry behaviors the core server applies by default and which ones your configuration must set explicitly. Test a payment through each path in a non-production environment and record which processor the server selected.

Architecture docs

Control Center routing configuration

The Control Center is the open source merchant dashboard where routing configuration is created, edited and activated. Each change is a change to live decision logic, so the dashboard's permissions matter as much as the rules themselves. Confirm which roles can create, edit and activate routing configurations, and whether the version you run records who changed what. Keep the dashboard's version aligned with the core server's compatibility matrix.

Control Center repository

Processor connectors as prerequisites

A processor can only be routed to after its connector is configured with valid credentials, the correct merchant identifiers and the payment methods you intend to send. A rule that points at a connector with incomplete setup will fail at runtime, often in a way that looks like a processor problem. Verify each connector end to end with test transactions, confirm which payment methods and currencies it supports, and document the credential owner so routing changes never depend on a connector no one can fix.

Router and Scheduler services

Router serves payment API requests, so every routing decision happens in its request path. Scheduler, which runs as Producer and Consumer, handles deferred work such as retries and recurring tasks. A misconfigured Scheduler can delay the work that routing depends on, and a Router outage stops decisions altogether. Confirm how many replicas of each run in your environment and which service picks up scheduled retries, so you know where a routing failure would surface.

PostgreSQL and Redis state

Routing configuration and payment state live in PostgreSQL, which runs with a primary and a replica in the documented setup. Redis supports caching and the Scheduler queue. A routing change that reads stale cached configuration, or a database failover that interrupts writes, can send traffic somewhere unexpected. Ask how configuration changes propagate to running Router replicas, how long caches persist, and how a replica lag or Redis outage is detected and alerted on.

Architecture docs

Intelligent routing options

The routing strategies available in your version, including rule-based, volume-based, auth-rate, multi-objective, least cost for debit networks and default fallback, each depend on different inputs and settings. Options change between releases, so the current documentation is the authority, not a summary written earlier. Read the intelligent routing guide for your installed version, list each option you plan to use, and confirm the data each one needs before you enable it.

Intelligent routing docs

Which routing strategy fits which goal

This table compares the six routing strategies Hyperswitch documents, covering when each fits, what it demands to run well, and how it trades authorization performance against processor cost. Read each row as a starting point, then confirm the data and monitoring each strategy needs against your own processor contracts and traffic.

StrategyWhen it fitsOperational cost and riskAuthorization versus cost trade-off
Rule-basedFixed business logic such as routing by currency, country, card brand, amount band or merchant categoryRules are simple to audit, but every new processor, market or rule change needs review and a retest. Misordered rules can send traffic to the wrong processor without warning.Predictable and easy to explain, but it does not optimize for approval rates or cost unless you encode that logic yourself
Volume-basedYou need to split traffic across processors by share, for example to keep a secondary processor warm or meet a committed volumeRequires agreed split percentages and monitoring of actual volume per processor. Shifts in share can change approval rates and fees in ways finance teams notice late.Serves contractual or relationship goals, not authorization quality; a fixed split can keep a weaker processor in the flow
Auth-rateApproval rate is the main concern and you have enough transaction history per processor, segment and card typeDepends on reliable approval and decline data per processor. Needs dashboards to catch sudden drops, and a rollback path if a processor outage skews the ranking.Favors approvals, which usually means higher total fees if the best approver is also the most expensive
Multi-objective (auth rate re-ranked by processor cost)You want approval performance but need to keep processor cost in view on each transactionNeeds both approval statistics and accurate per-processor cost tables, which must be kept current as contracts change. Errors in cost data distort the ranking silently.The balance point most teams evaluate first, but its result is only as good as the cost inputs and the approval sample behind them
Least cost routing for debit networksDebit transactions where network choice affects fees and you can route across eligible debit networksRequires correct network eligibility, BIN data and processor support for each network. Confirm coverage and any regional limits in the Hyperswitch docs and with your processors before go-live.Lowers cost per transaction, but may reduce approval rates if the cheapest network declines more often for some cards
Default fallback routingNo rule applies, or the selected processor is ineligible or unavailable for a transactionMust be defined for every currency, method and region you accept. A fallback that is never tested is often discovered during an outage. Monitor how often it fires.A safety net rather than an optimization; a broad fallback can quietly absorb traffic that a rule was meant to send elsewhere

How to build a routing configuration step by step

This sequence moves a Hyperswitch routing setup from verified connectors in a non-live environment to documented, tested changes that reach payment traffic only after each route has been checked.

  1. Verify connectors and credentials in a non-live environment

    Your payments engineers connect each processor in a sandbox or non-production deployment of Hyperswitch, using test credentials supplied by each processor. Confirm that every connector authorizes, captures, refunds and returns clear error responses for declines before anything else is configured. The step is done when each connector has passed a set of test transactions and the results are recorded per processor. Confirm with each processor which test cards and sandbox features it provides, since these differ by vendor.

  2. Define goals and eligible processors per payment type

    Product, finance and payments leads agree what routing should optimize for, such as approval rate, cost or resilience, and list which processors are allowed for each payment method, currency and merchant or country segment. Record the processors that are not eligible for a given segment so that no rule can send a transaction to a route the business has not approved. The output is a written matrix of payment type, currency and eligible processors that the routing configuration must match exactly. Review the matrix against each processor's contract before it is accepted.

  3. Write rule-based conditions for known segments

    Payments engineers build rule-based routing in the Control Center for segments that have clear, fixed logic, such as a currency that only one processor supports or a merchant that must stay with a specific acquirer. Keep each rule narrow, name it clearly and avoid overlapping conditions that make the outcome depend on rule order. The check is a set of test transactions for each rule, confirming in the routing decision log that the expected processor was selected and that no ineligible processor appeared.

  4. Set the default fallback order

    Engineers define the ordered list of processors Hyperswitch uses when no rule applies or when the first choice is ineligible or unavailable. Use only processors approved in the eligibility matrix, and make sure the order reflects the business priorities agreed earlier. The step is complete when test transactions that match no rule are routed in the intended order, and when a deliberately disabled test connector causes the next processor in the list to be selected. Confirm the fallback behavior in the routing logs, not only in the dashboard.

  5. Enable auth-rate or volume-based routing after baseline data exists

    Only after the rule-based and fallback configuration has run long enough to produce reliable data should the team enable auth-rate or volume-based strategies. Payments analysts review approval rates and processor volumes per segment from the existing transaction history, then set thresholds or weights that the strategy will use. Enable the strategy for a limited share of traffic first, if your deployment supports it, and compare results with the baseline. Confirm the expected behavior with the Hyperswitch intelligent routing documentation and your own test data before widening the rollout.

  6. Add least cost routing for debit where applicable

    For debit transactions in markets where the card scheme and processor cost data are available, your team can add least cost routing so that the lowest-cost eligible network or processor is preferred. Finance and payments engineers confirm the cost inputs they will use, the markets in scope and the debit flows that the logic must not affect. The check is a test transaction per debit network and processor pair, with the routing decision log showing the lowest-cost eligible option selected and the fallback still working when that option is unavailable.

  7. Test changes safely before live traffic

    Before any routing change reaches production, the team replays a representative set of test transactions against the new configuration in a non-live environment and compares the selected processor with the expected result for every rule, fallback and strategy. Reviewers check the routing decision log for unexpected selections, and a rollback path is confirmed by restoring the previous configuration in the test environment. The step is done when all test results are signed off by payments and risk owners.

  8. Document each change and monitor the routing log

    Each approved change is recorded with its purpose, the rules and fallback order affected, the test evidence, the approver and the rollback steps, so that future reviews can trace why a route exists. After go-live, the payments team reviews the routing decision log and approval rates per route on a regular schedule and compares them with the documented expectations. Any difference is raised as a change request rather than edited directly in production. The output is a versioned routing record that auditors and operations staff can read alongside the deployment's configuration history.

How routing setup differs by deployment environment

A local setup, built with the Docker-based option or a local Minikube cluster from the Hyperswitch self-hosting guides, is meant for learning how routing rules, fallback order and processor eligibility interact. It runs on one machine with no real card traffic, so the team can create rules, change their order and observe the decisions without any exposure to live payments. The main risk here is building habits that do not carry forward, such as editing settings directly in the dashboard with no record of what changed.

  • Use sandbox processor credentials only: Connect test accounts from each processor so every routing decision is exercised against test data.
  • Treat the local dashboard as a scratchpad: Note each rule you create and why, so the same logic can be rebuilt in a controlled environment.
  • Expect a single-node footprint: A laptop cluster does not reflect replica behavior, so do not draw conclusions about availability from it.
  • Practice fallback paths deliberately: Mark one processor as ineligible and confirm that default fallback routing takes over.
  • Keep local data disposable: Reset the environment when you finish a lesson so test configuration does not drift.

Before relying on any local result, confirm which processor sandboxes your account can access and which Hyperswitch release the local setup pins.

How to test a routing change before it reaches live traffic

Test every routing change against replayed payments in a sandbox or staging deployment before it touches live traffic. Build a set of representative test payments that covers each currency, payment method, card network and amount band your merchants actually send, plus the edge cases that matter most: debit transactions where least cost routing applies, payments from merchants with custom rules, and payments that a processor is likely to decline. Submit them through the staging router and record which processor each request was sent to. Then compare those decisions against the order you wrote down before making the change. Any payment that lands on an unexpected processor is a defect in the rule or in its conditions, and you should fix it before moving on.

Next, confirm that default fallback behaves as designed. Disable or mark a processor as ineligible in staging, then send payments that would normally route to it and check that they move to the next processor in the fallback order. Simulate a decline from the first processor as well and confirm that retry and fallback follow the sequence you expect. Check the router logs and the payment records in Control Center, since those show the processor attempted for each step. Also confirm whether your staging processor connectors behave like production for these tests, because sandbox declines and error codes often differ from live ones and the fallback logic depends on them.

Be careful with auth-rate and multi-objective strategies. These rely on observed approval rates and, for multi-objective, processor cost, so a staging deployment with synthetic or low traffic cannot show whether they will perform well. Before you depend on them for pre-production checks, confirm with the Hyperswitch documentation and your own deployment what data the intelligent routing features need, how long they take to collect it, and whether they can run in a non-production environment. For these strategies, a safer path is to test the configuration and fallback behavior in staging, then stage the rollout to a limited share of live traffic, if your version supports traffic splitting, and compare approval rates against the baseline before increasing the share. Confirm the splitting and rollback controls for your release in the Hyperswitch intelligent routing documentation before you plan the cutover.

How a payment flows through routing and fallback

The flow starts when a payment request reaches the Router, the core app server. The Router evaluates the routing rules, keeps only the processors that are eligible for this payment, and ranks them using the strategy the merchant has chosen. It then calls the first processor. If that processor declines or is ineligible, the default fallback order decides the next attempt. Check that every attempt, including the final result, is recorded so reconciliation can match it to the processor's settlement data.

Routing decision path from request to reconciliation, including fallback on decline.

Access control and data handling for routing changes

Routing rules decide which processor sees each payment, so who edits them, how changes are reviewed, and what data the routing path touches matter as much as the rules themselves. The cards below cover roles, change records, processor credentials and keeping card data out of routing logs.

Who may edit routing rules

Routing changes can move live payment volume between processors within minutes, so edit rights belong in a short, named list rather than a general admin group. Map each role to a job: viewing performance, drafting rules in a sandbox, and approving production changes. Check which Control Center roles can publish a routing configuration, and confirm that a finance or operations user cannot publish one by accident. Test the role matrix in a non-production merchant profile before you rely on it.

SSO and roles docs

Roles managed in Hyperswitch

The Control Center takes its roles from Hyperswitch itself, not from your identity provider. Groups in your IdP do not map to routing permissions, so a user removed from an IdP group keeps the Hyperswitch role until someone removes it in Hyperswitch. Build a joiner and leaver step into the access process that covers both systems. Users must be invited first, so record who sent each invitation and when the role was granted.

Change review and approval

Treat every routing change as a controlled release. Require a written reason, a named approver who is not the author, and a rollback plan that names the previous fallback order. Keep the review in your own ticketing or change system, since Hyperswitch does not give you a built-in approval workflow to rely on. Confirm with the vendor and in your own test environment how a published rule can be reverted and how quickly.

Audit logs for routing edits

Your auditors will ask who changed a rule, what it said before and after, and when it went live. Export configuration history and Control Center activity on a schedule into storage that the routing admins cannot edit. Check which events Hyperswitch records for routing configuration, user invitations and role changes, and whether the timestamps and actor IDs are enough to rebuild a timeline. Gaps here are usually found during an assessment, not during an incident.

Protecting processor credentials

Each connector holds processor API keys and secrets that let routing move money. Store them in a secrets manager or Kubernetes secrets with restricted access, not in Helm values files or rule exports. Limit which admins can view or rotate connector credentials, separate them from routing edit rights, and rotate them on a set schedule and after staff changes. Confirm how Hyperswitch encrypts stored connector configuration with its encryption service before you document that control.

Routing on tokens, not card data

Card numbers stay in the card vault. Routing decisions should use the token, the processor, the currency, amount bands, the country and other metadata, never the primary account number. Review any custom rule or webhook that could pass request bodies to logs, dashboards or external analytics, and strip fields that contain card data. Ask your assessor which systems count as in scope once routing logs are included, because a single debug log line can widen the scope.

Vault deployment models

How to confirm routing works and fails safely

Test each routing strategy with known inputs before any rule reaches live traffic. Hyperswitch documents six strategies: rule-based, volume-based, auth-rate, multi-objective, least cost routing for debit networks, and default fallback. For each one you use, build a fixed set of test payments with known attributes such as currency, amount, country, card network and payment method, then record which processor the router selects. Compare that result with what the rule text says it should do. Keep the test set in version control next to the routing configuration, so every change to a rule is checked against the same cases. Confirm in the Hyperswitch docs, intelligent routing documentation, which inputs each strategy reads, because a test that omits one of them proves little.

Next, simulate failures on purpose. Force a processor to decline or time out in your sandbox, then confirm the router moves to the next processor in the configured fallback order and stops there. Look for three specific failure modes. A fallback loop shows up when two processors each route back to the other, so payments retry until a timeout. A misconfigured rule that blocks all payments appears when a condition is too broad or a required field is missing, and every test payment returns no eligible processor. Silent loss of a processor from the eligible list happens when a connector is disabled, its credentials expire, or it is removed from a merchant profile, and the routing still runs without error while that processor receives no traffic. Watch the eligible list and the traffic share per processor after each test, not only the final payment status.

Finally, confirm that the books agree with the routing decision. For every test payment, the processor that appears in the payment record should match the processor the router chose, and the processor's own transaction reference should reconcile to that record. Check also that no path can select a connector that has no configuration or no working credentials. Ask your implementation team to document the rollback step for each routing change and to confirm, in your environment, how quickly a previous routing version can be restored under load. Keep these results as evidence for your change management and PCI DSS assessment, since payment routing changes often touch systems in scope.

What to monitor, document and review after go-live

This table lists what to watch, record and re-check once Hyperswitch routing rules carry live traffic, with the reason for each item and the trigger that calls for action. Read each row as a standing duty with an owner, not a one-time launch task. The main takeaway is that routing quality drifts after go-live through processor behavior, release changes and configuration edits, so each item needs a baseline and a review cadence.

AreaWhat to track or doWhy it matters and what to confirm
Authorization outcomes per processorTrack approval rate, decline codes and timeouts separately for each connector and routeAuth-rate and multi-objective strategies depend on these numbers. Confirm which fields your Control Center reports and set a baseline before the first rule change.
Share of volume per routeRecord the percentage of transactions each rule, volume split and default route receivesShifts show whether rules match the traffic you designed for. A sudden change often means a rule condition or eligibility check changed, not the processor.
Fallback frequencyCount how often default fallback routing runs, and why (no rule matched or a processor was ineligible)Frequent fallback usually means a rule is incomplete or a connector is failing. Review the reason split, not just the total.
Cost per routeCompare processing cost per route where cost observability is enabled in your deploymentLeast cost and multi-objective routing trade approval rate against cost. Confirm with your vendor which cost data is captured before relying on it for decisions.
Alerts for sudden shiftsSet alerts on approval rate drops, volume share jumps and fallback spikes per routeThresholds should come from your own baseline. Agree who receives each alert and what the first response is, such as pausing a rule version.
Rule versions and ownersKeep a register of each routing rule, its version, business owner, technical owner and change dateAssessors and incident responders need to know which configuration was live at a given time. Store the register with change tickets.
Routing configuration backupsExport and store routing configuration on each change and on a fixed schedule, outside the live databaseLets you restore a known-good set after a bad edit. Confirm how the Control Center or API exports configuration in your release and test a restore.
Review after each monthly upgradeCheck routing behavior against the release notes and compatibility matrix after every Hyperswitch minor releaseUpgrades can change defaults or required services. Confirm Superposition status (required from v1.124.0) and run a replay or sandbox check before promoting.
Retest after connector or Superposition changesRe-run routing test cases whenever a connector, credential or Superposition configuration that routing depends on changesConnector updates can alter eligibility and response codes. Keep the test set with the rule register so each change is checked against the same cases.

Questions teams ask before routing Hyperswitch payments

How much effort does Hyperswitch routing setup take?

Effort depends mostly on how many processors you connect, how many payment methods and currencies each one must handle, how complex your rules are, and how much compliance review the changes need. A team with two processors, one currency and a simple default order has a much smaller job than a team routing card traffic across several processors in multiple currencies with auth-rate and least cost logic. Hyperswitch documents six routing strategies, so the first step is choosing which ones your business needs. Ask any partner to quote from a written list of processors, payment methods, currencies, strategies and required reviews, and confirm the scope with your own payments team before agreeing a timeline.

Can our own team set up Hyperswitch routing without a partner?

Often yes, if your engineers already run Hyperswitch and your payments team understands your processor contracts and fee structures. Routing touches live money, so the work usually needs people who can read processor performance data, define fallback behavior and sign off on changes. Teams without Hyperswitch operating experience often bring in outside help for the first build, the test plan and the cutover, then run routing changes in-house. Check whether your team has capacity for building rules, writing tests and reviewing changes during the same period as any self-hosting or vault work.

What does routing setup need from payments and security staff?

Payments staff need to define the business goals for each routing strategy, supply processor contract terms and cost data, and agree which declines or failure codes should trigger fallback. Security staff need to review who can change routing rules, how changes are approved and logged, and whether any routing data touches card data or the card vault. Both teams should agree a change process before the first rule goes live. Ask your partner which decisions they expect you to make and which they will document for you.

How long does routing testing take?

Testing length depends on the number of rules, processors and payment methods in scope, and on whether you test against sandbox processors, a staging environment or a limited share of live traffic. Each routing strategy needs its own checks, and fallback paths need tests for every case where a processor is ineligible or no rule applies. Compliance review of the test evidence can add time if your assessors want records of each change. Ask for a test plan with named cases, environments and exit criteria, and confirm the duration against the written scope.

Do routing changes need to be coordinated with Hyperswitch upgrades?

Yes, plan them together. Hyperswitch ships roughly monthly minor releases, and each release comes with a compatibility matrix for Control Center and web client versions. Routing configuration can behave differently after an upgrade, and some releases add required dependencies, such as Superposition in v1.124.0, which must run before you upgrade to that version. Schedule routing changes outside upgrade windows where possible, retest key rules after each upgrade, and record which Hyperswitch version each routing configuration was tested against.

How do we test a routing change before it reaches live traffic?

Test the change in a non-production environment first, using the same rule order and fallback settings you plan to deploy. Replay representative payment requests, confirm which processor each request selects, and check that the fallback order runs when a processor is marked ineligible. Compare the result with the expected routing decision for each strategy in use. Once staging results match, introduce the change gradually if your setup allows it, and keep the previous configuration ready to restore. Confirm with your partner which of these steps the Hyperswitch version you run supports.

Which parts of routing design should engineers check first?

Start with the default fallback order, because it applies whenever no rule matches or a processor is ineligible. Then check rule precedence, since overlapping rules can send the same payment to different processors depending on order. Verify how auth-rate and multi-objective strategies rank processors and what data they rely on, and confirm that least cost routing for debit networks matches your network mix. Document each rule with its owner and purpose so reviewers can trace why a payment went where it did. Hyperswitch's intelligent routing documentation is the natural next read for the strategy details.

How DeployOpen scopes and hands over Hyperswitch routing work

DeployOpen plans, builds, tests and documents Hyperswitch payment routing rules inside the client's own infrastructure, using the open-source Hyperswitch platform under Apache 2.0. Each engagement starts from a written scope that sets which processors, routing strategies and test environments are covered before any change reaches live payment traffic.

How we scope

  • Inventory the processors and connectors already configured, and which ones routing rules will choose between.
  • Agree which routing strategies apply: rule-based, volume-based, auth-rate, multi-objective, least cost or default fallback.
  • Define the default fallback order and the conditions under which a processor is treated as ineligible.
  • Confirm which Hyperswitch environments, Control Center access and approval roles the routing work depends on.

How we build

  • Write routing rules as versioned configuration, with each change tied to a stated business reason and an owner.
  • Model the rule set against replayed or sample transaction data before enabling it for any merchant profile.
  • Run routing changes in a staging environment or sandbox first, and confirm the Hyperswitch version and Control Center compatibility matrix.
  • Test fallback behavior by simulating processor outages, declines and ineligible processors, then record the results.

How we hand over

  • Deliver the routing rule catalog with the reason, scope and fallback path for each rule.
  • Document the staged rollout steps, rollback procedure and the metrics your team should watch after each change.
  • Walk your payments and engineering teams through how to add, change and retire rules without breaking the fallback order.
  • Provide the test cases and evidence used to approve each change, so your reviewers can repeat them.

How we support

  • Support routing changes after go-live under a retainer, covering review of new rules and processor changes.
  • Check each new Hyperswitch monthly release for routing-related changes before it is applied to your environment.
  • Retest the fallback order and high-impact rules after upgrades, connector changes or processor configuration updates.
  • Confirm with your team which routing decisions need sign-off from payments, risk or compliance before deployment.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.