Skip to content
EN
Book a demo

HomeProducts

Payment Routing Rules Behind One API

Payment routing is the decision about which provider, acquirer or MID gets each payment. In a layer, that decision runs on rules you set in a dashboard, and your checkout code never has to know about it.

On this page

That's the integration point. It's also why routing belongs in the layer. When routing lives in your own code, every change to a rule is a release. When it lives in the layer, a change is an edit to a rule, and the call your checkout makes stays the same.

01Payment routing: where it sits in the layer

Sample case: a PSP with three acquirers sends a EUR 120.00 card payment. The figures are sample data.

Your side sends The layer does The provider receives
One request with amount, currency and card or token Reads what the payment is: the card's BIN and type, the money, the country and the method Nothing yet
The same request, unchanged Matches the payment against your rules and picks a provider or MID The payment, shaped for that provider
Nothing Maps the provider's reply to one status Nothing further

Your code makes one call. How each route performed shows up afterward in the analytics, where your payments team can read it without opening a pull request.

02What it replaces

Hard-coded routing grows slowly and then all at once. A team starts with one if-statement for a currency and ends with a table of exceptions nobody wants to touch.

Rules in application code

Each rule needs a developer, a review, a test and a release, so a change for one market waits for the next release. A rule edit in the layer's dashboard takes the release out of that loop, and the people who own the numbers can make the change themselves.

A routing table per provider

If every provider has its own integration, each one also carries its own idea of what a route is. The layer holds one rule set above all of them, so you describe the route once.

Guesswork about which route works

In a direct setup, outcomes sit in each provider's portal. The layer shows approval rates, declines, latency and route efficiency for every route in one place, so a rule change can be judged on data.

03Moving it over

Routing is one of the easier parts to move, because you can write the rules before any traffic arrives.

  1. 01 First, write your current rules down

    Pull every routing decision out of your code and your provider contracts. Typical ones are "this currency goes to that acquirer" and "large amounts go to the provider we trust most", and a few have been in the code for years. Note the owner of each, because a rule nobody owns is the one that breaks quietly.

  2. 02 Then, choose the conditions

    Six conditions are available: BIN, card type, currency, amount, country and payment method. Map each of your written rules to one or more of these. If a rule needs a condition outside this list, ask in a demo before you plan around it.

  3. 03 Then, add the special cases

    A customer you trust, a high-value order or a recurring charge can each get a route of its own, pointing at the MIDs or acquirers you choose. Wallets have their own options: Apple Pay and Google Pay follow region, issuer, currency or how a provider is performing. You set cost-led, BIN-led and performance-led rules in the dashboard.

  4. 04 Last, test in the sandbox, then go live

    Run a set of sample payments through the sandbox, one per rule, and confirm each lands on the route you expect. Then move live traffic in steps. Keep the old path available until the reports show the new rules behaving the same way for a full business cycle.

04Data on the way through

The layer's analytics cover approval rates, declines, latency and route efficiency, so your payments team can read how each route performs.

Card data sits in the vault as tokens, so your systems don't handle the card number when a route changes. For a bank where issuer and acquirer are the same, on-us routing keeps those payments on the bank's own route.

05Questions for your engineers

Before you move a rule out of code, work through these.

  • Which rules exist today, and who wrote each one?
  • Which of them fit the supported conditions, and which don't?
  • Which of them depend on something our code knows and the layer can't see?
  • What is the default route when no rule matches?
  • Who is allowed to change a rule in the dashboard, and how is that reviewed?
  • How do we compare a route's results before and after a change?
  • Which customers count as trusted, and how does the layer recognize them?

Settle the default route first. It decides what happens on every payment your rules don't cover, and in a young rule set that's more payments than you'd expect.

06FAQ

What is smart payment routing?

Smart routing is rule-based routing that can also weigh cost or how a provider has been performing, on top of what the payment itself shows, such as BIN, currency and amount.

Does routing mean changing my checkout?

No. The checkout sends the same request whatever the rule says. Changing a route is an edit in the dashboard.

Can I route Apple Pay and Google Pay differently from cards?

Yes. Wallet payments have their own rules, so one from a given market can take a different route than a card from the same market.

What happens when the chosen provider declines?

That belongs to cascading, where a soft decline is retried on another provider in the same payment flow. See cascade rules.

Next step

Move your routing out of code

Bring your current routing rules, even as a rough list, and we'll map them to the rule types the layer supports. Send us the list.

Book a demo

Map your integrations onto one API

We look at the providers you run today and what moving them behind one API would take.