HyperSwitch payment orchestration
Turn more declined payments into revenue
HyperSwitch is open-source payment orchestration, written in Rust. It can send each payment to the processor with the best recent approval rate, retry a soft decline on another processor, and fall back when one is down. For a B2B business with large orders and more than one processor, every payment it saves is revenue kept. We're an independent team that builds on it, and we maintain its open-source PHP SDK.
One declined payment, saved
A single gateway has one answer: approved or declined. HyperSwitch has a second processor to ask.
- A buyer pays a $48,600 order by card at checkout.
- HyperSwitch sends it to the processor with the best recent approval rate for this kind of payment.
- That processor answers "Processing temporarily unavailable": a soft decline, the kind another processor can clear.
- HyperSwitch retries it on the next processor, on its own. The buyer doesn't type anything again.
- Approved. Without the retry, that was a lost order. With it, $48,600 of revenue kept.
An example of how it works, not a client's numbers. Not every decline gets a retry: HyperSwitch sorts each processor's decline codes, and doesn't retry a hard decline where another attempt would only add cost. Sources: smart retries, approval-rate routing.
What HyperSwitch does that a single gateway can't
Each feature below is from HyperSwitch's own documentation, with what it means for the money you take.
Routing by approval rate, rules and cost, with automatic fallback
Route each payment by amount, currency, country, card network or payment method; split volume by percentage; or send most traffic to the processor with the best recent approval rate, keeping a small share on the others to keep testing them. A multi-objective mode weighs approval rate against what each processor costs. When a processor is temporarily unavailable, payments go to the next one in your fallback order.
For revenue: more payments go to the processor approving the most, large orders go where you choose, and payments keep moving when a processor is down.
Sources: routing, approval-rate routing, fallback
HyperSwitchwhere each payment goes- Processor Aapproves 91%15%
- Processor Bapproves 96%Down75%
- Processor Capproves 89%10%
- Payments start spread across your processors while HyperSwitch watches which one approves the most.
- Most payments now go to Processor B, the best recent approval rate. A small share keeps testing the others.
- Processor B goes down. Its payments go to the next processor in your fallback order, so payments keep moving.
- B is healthy again. As its approvals come back, so does its share.
Illustrative numbers, not a client's.
Smart retries on another processor
A payment that fails for a reason another processor can clear, such as a system error or a processor that is temporarily unavailable, is retried on the next one automatically. Not every decline gets a retry: hard declines that another attempt can't clear are left alone.
For revenue: a soft decline becomes an approved order instead of an abandoned one, and nobody has to ask the buyer to pay again.
Source: HyperSwitch docs
Revenue recovery for recurring billing
For subscriptions and recurring invoices, it sits between your billing system and your processors and retries a failed invoice within the grace period and retry budget you set, then reports back to billing.
For revenue: a contract or subscription doesn't lapse because one card payment failed. A paid add-on when self-hosted, included in HyperSwitch's cloud.
Source: HyperSwitch docs
One vault, any processor
Saved cards, wallets and bank accounts live in one vault, each with one ID that works across the processors you connect. Network tokens are supported, with the card number as a silent fallback, and an account updater keeps saved cards current.
For revenue: repeat buyers keep their saved cards when you add or change a processor, and fewer saved cards fail at the next order.
Source: HyperSwitch docs
3-D Secure only where it's needed
Rules decide when to ask for 3-D Secure, for example above an amount you set, and the 3DS engine decides whether to request an exemption where strong customer authentication applies.
For revenue: fewer buyers leave at an authentication step they didn't need, while risky payments still get one.
Source: HyperSwitch docs
Fraud checks through one connection
Connect a fraud provider once and check payments before or after authorization: accept, decline or hold for review. A blocklist can stop specific cards, card ranges and card-testing attacks.
For revenue: high-value orders get a closer look without slowing down every other payment.
Source: HyperSwitch docs
Commercial card data
Level 2 and Level 3 data (purchase order, tax, line items) is passed to the processor on eligible commercial cards, mostly for US domestic processing.
For revenue: interchange costs optimized on eligible commercial cards, where your processor supports it.
Source: HyperSwitch docs
Bank payments and split captures
Bank transfers and bank debits (ACH, SEPA, BACS) suit large business payments, and one authorization can be captured in several parts as an order ships.
For revenue: payment options that fit how large B2B orders are actually paid, through the same integration.
Source: HyperSwitch docs
Fees and reconciliation, in one place
Cost observability turns processor fee reports into a breakdown of interchange, scheme fees and penalties and flags overcharges. Reconciliation matches orders against processor and bank records, two-way or three-way.
For revenue: you see what each payment really costs and where the money landed. Both are paid add-ons when self-hosted, included in HyperSwitch's cloud.
Source: HyperSwitch docs
One integration for many processors
One API in front of all of them: you add, switch or remove a processor without rewriting your checkout, and saved cards and reporting stay in one place.
For revenue: you can add a second processor, or leave one for a better rate, without a new checkout project.
Source: HyperSwitch docs
Why it matters more in B2B
Large orders
A declined card on a $40,000 order isn't a lost basket; it's a phone call, a delay, and sometimes the order. A retry that clears a soft decline is worth more per payment in B2B than anywhere else.
More than one processor
Different regions, currencies, card types and entities often mean different processors. HyperSwitch puts them behind one integration, with accounts and profiles for each brand, entity or region.
Cost per payment
Routing can weigh what each processor charges, commercial card data can optimize interchange on eligible cards, and the fee breakdown shows where the money goes.
Recurring and contract billing
Subscriptions, service contracts and standing orders get revenue recovery: a failed invoice is retried on the schedule you set instead of lapsing.
HyperSwitch's cloud, or your own servers
HyperSwitch is open source under the Apache 2.0 license, so you can run it yourself. Most businesses shouldn't.
Our recommendation: HyperSwitch's cloud
Juspay runs it as a PCI DSS v4.0 Level 1 service provider, and revenue recovery, cost observability and reconciliation are included. Card data stays out of your own systems.
Self-hosted, if you need it
We can help you run it on your own infrastructure. Plainly: that puts the card data, and its PCI DSS compliance, in your scope, and revenue recovery, cost observability and reconciliation become paid add-ons. A hosted vault can keep card numbers out of your servers.
HyperSwitch, added into operations and commerce
A payment is revenue once the order, the payment and the books agree. We can help you add HyperSwitch between the checkout your buyers use and the ERP your team runs on.
- Adobe Commerce
- Magento/Mage-OS
- Your own application
- ERP
- Accounting
- Billing
- Every payment on its orderPayments, captures and refunds post to the order in your ERP, so nobody rekeys them.
- Reconciliation in the booksHyperSwitch matches orders against processor and bank records, and the result lands in accounting.
- Billing that recoversRecurring invoices from your billing system get retried on the schedule you set.
Reconciliation and revenue recovery are HyperSwitch modules: included in its cloud, paid add-ons when self-hosted.
Our open-source HyperSwitch PHP SDK
We built and maintain the open-source PHP SDK for HyperSwitch, so a PHP application can take payments through it without writing its own client.
- MIT-licensed, open on GitHub
- Every operation in HyperSwitch's v1 API, checked against a pinned copy of its spec so it can't drift
- Any PHP project: Magento, Laravel, Symfony or plain PHP, on PHP 8.1 and up
# the package installs from GitHub
composer config repositories.hyperswitch-client \
vcs https://github.com/X2Y-DEV/Hyperswitch-PHP-SDK
composer require x2y/hyperswitch-client:^0.2
$response = $client->payments()->create(new CreatePaymentRequest(
amount: 4500,
currency: Currency::USD,
));
echo $response->paymentId; // pay_abc123Where we come in
Connected to your ecommerce and ERP
We connect HyperSwitch to your Adobe Commerce (Magento/Mage-OS) checkout or your own application, and payments, refunds and captures to the ERP behind it.
Routing, retries and fallback, set up for your volume
Which processor gets which payments, which declines get a retry, and what happens when a processor is down: set up and tested with your own payment mix before it goes live.
Kept current
HyperSwitch ships often. We keep your integration and the SDK in step with each release, so a new version is a routine update, not a project.
Common questions
What is HyperSwitch?
Open-source payment orchestration from Juspay, written in Rust. It sits between your checkout and your payment processors and decides where each payment goes, retries the ones that can be saved, and keeps saved cards in one vault.
Does it replace our payment gateway?
No. Your processors stay. HyperSwitch sits in front of them, so you can use more than one and move between them without rebuilding checkout.
Which declines get retried?
Soft declines that another processor may approve, such as a system error or a processor that is temporarily unavailable. Not every decline gets a retry: HyperSwitch sorts each processor's decline codes, and hard declines that another attempt can't clear are left alone. Wallets, 3-D Secure card payments and bank transfers are not retried this way, because the buyer would have to act again.
Is it really open source?
The core is open source under the Apache 2.0 license. The self-hosted routing service is under the AGPL-3.0 license, and revenue recovery, cost observability and reconciliation are paid add-ons when self-hosted. HyperSwitch's cloud includes all of them.
Should we host it ourselves?
Usually not. Self-hosting puts card data and PCI DSS compliance in your scope. HyperSwitch's cloud is run by Juspay as a PCI DSS v4.0 Level 1 service provider. We recommend the cloud, and we can help with either.
Does it work with Adobe Commerce and Magento?
Through its API, yes. Our open-source PHP SDK covers every operation in HyperSwitch's v1 API and drops into Magento, Mage-OS, Laravel or any PHP project.
Running more than one processor, or thinking about it?
Tell us your order sizes, your processors and where payments fail today. We'll tell you plainly whether HyperSwitch would earn its keep.
Talk to us about HyperSwitch