A payment switch moves transaction messages between the parties of a card or account payment: terminals and gateways on one side, acquirers, card networks and issuers on the other. It reads each message, decides where it goes and passes the answer back, thousands of times a second, without losing one.
This page explains payment switch architecture for PSPs and banks: how a switch differs from a gateway, which components it's built from, what open source offers and when a new payment company actually needs one.
Payment switch and payment gateway: the difference
The two get confused because both route payments. They sit at different points in the chain and speak different languages.
| Payment gateway | Payment switch | |
|---|---|---|
| Faces | Merchants and their checkouts | Acquirers, networks, issuers, ATMs and terminals |
| Typical messages | Web APIs (JSON over HTTPS) | Card network formats such as ISO 8583, and ISO 20022 for account payments |
| Main job | Take a payment, protect card data, send it to an acquirer | Route authorization and clearing messages between institutions |
| Who runs one | PSPs, payment facilitators, platforms | Banks, processors, national networks |
A merchant never talks to a switch directly. Its gateway or acquirer does, often several hops later.
Components of a payment switch architecture
Every switch has a similar set of parts, whatever vendor or code it comes from. These are the main ones.
| Component | What it does |
|---|---|
| Connection handlers | Keep persistent links to networks, acquirers and terminals |
| Message parser and builder | Read and write ISO 8583 and ISO 20022 messages, field by field |
| Routing engine | Picks the destination by card range (BIN), message type, amount or rules |
| Security module interface | Sends PIN and key operations to hardware security modules |
| Stand-in processing | Approves or declines by rules when an issuer can't answer in time |
| Transaction log | Records every message for disputes, audits and reconciliation |
| Clearing and settlement | Builds the files and totals that move money between institutions |
| Monitoring | Tracks latency, timeouts and declines per connection |
The routing engine and the security module interface are where switches differ most. Routing tables decide performance, and integration with an HSM decides whether PIN payments can run at all.
How a message moves through a switch
The flow is short but strict, and each step has a timeout. A card payment runs roughly like this.
- A terminal or gateway sends an authorization request in the format the switch expects.
- The switch parses it, checks the format and logs it.
- The routing engine picks a destination by card range and rules.
- If the message carries a PIN, the switch has the HSM translate it into the destination's keys.
- The switch forwards the request and waits for the response within the timeout.
- If the issuer doesn't answer in time, stand-in processing applies its rules.
- The response goes back the way it came, and the transaction joins the clearing file for that day.
Each hop adds latency, so switches are built for speed and long-lived connections rather than for flexible web APIs.
Open source payment switch options
The best-known open source building block is jPOS, a Java framework for ISO 8583 messaging. Its GitHub repository had 739 stars on November 16, 2026, and it's licensed under AGPL 3.0, which matters if you modify it and offer it over a network.
A framework like jPOS gives you message handling, not a finished switch. Routing rules, HSM integration, clearing, monitoring and certification with each network are still your work, and so is the security assessment of the whole environment.
Does a new PSP need a payment switch?
Usually not. A PSP that serves online merchants needs a gateway that routes between acquirers and payment methods, and its acquirers run the switching toward the card networks.
A switch becomes necessary when you connect to card networks directly, run ATMs or card-present terminals at scale, issue cards, or operate a domestic network. Those are projects for banks and processors, with scheme certification and much larger budgets.
For a new PSP startup: build a switch or not?
If the question is whether to build a switch internally or use what acquirers provide, start with the acquirers. Building a switch only pays off once you have direct network access or volume that justifies your own routing toward networks.
What a new PSP does need is good routing at the gateway level. Our gateway routes and cascades payments across 700+ ready connectors by cost, region and card type, and stops sending traffic to a connector that fails. That's acquirer-level routing, the switching job a PSP needs first.
Questions
What is a payment switch?
A system that routes transaction messages between terminals or gateways and acquirers, card networks and issuers, using formats such as ISO 8583. Banks, processors and national networks run switches.
What's the difference between a payment switch and a payment gateway?
A gateway faces merchants and takes payments through web APIs. A switch faces institutions and routes network messages between them.
Is there an open source payment switch?
jPOS is a widely used open source Java framework for ISO 8583 messaging under AGPL 3.0. It handles messages; routing, security modules, clearing and certification still have to be built around it.
Should a new PSP build its own payment switch?
Usually not. Acquirers handle switching toward the card networks, and a new PSP gets more from good routing between acquirers at the gateway level.