Skip to content
Meem Payment

How intelligent payment routing works

Conditions, priority lists, deterministic weighted splits, cost- and approval-based routing, and how to test and govern routing changes.

RoutingFundamentalsPublished: 7 min read
On this page

Every card payment has to go somewhere. If you hold contracts with more than one payment service provider (PSP), or more than one account with the same PSP, something has to decide which one handles each transaction. Often that decision is hard-coded to one default gateway.

Intelligent routing replaces that with an explicit, testable decision made per payment. This article explains how that decision is usually built: the conditions it reads, the ways it chooses between providers, how it reacts to provider health, and how a team changes it safely and checks whether the change helped.

What a routing decision actually is

A routing decision takes a payment request and returns one of a small number of answers: send it to this gateway account, try these accounts in this order, split traffic between them, or refuse the payment. Everything else is about how you get to that answer.

The most practical way to model this is a workflow with a start point, condition nodes that branch on attributes of the payment, and terminal nodes that produce the answer. Every payment should follow exactly one path, and you should be able to see afterwards which path it took and why.

Rule-based conditions

Conditions are the backbone of routing. Common ones include:

  • Currency and amount. Route SAR payments to an account that settles in SAR; send high-value transactions to a provider with stronger fraud tooling or a better pricing tier for large tickets.
  • Card BIN and BIN range. The first digits of the card number identify the issuer and product. BIN rules let you route specific issuers or card programmes deliberately. See BIN intelligence for how BIN data is sourced and where it can be wrong.
  • Card brand and scheme. A local debit scheme such as mada may only be enabled on some of your accounts, so scheme-based branches keep those cards away from accounts that cannot process them.
  • Country. Card issuer country, customer country and IP country are three different signals. Mixing them up is a frequent source of surprising routes.
  • Method, device type, transaction type, metadata and time window. Useful for channel-specific and scheduled setups.

Operators should be explicit: equals, not-equals, in, not-in, comparisons, and between ranges. Ambiguous rules ("large amounts") turn into incidents later.

Priority lists and weighted splits

Once conditions have narrowed the options, you still need to choose among eligible accounts.

A priority list is an ordered set of fallbacks: try account A; if A is not eligible or the failure is one where retrying is safe, consider B. Priority lists interact closely with failover rules, which deserve their own discussion in payment failover best practices.

A weighted split sends a share of traffic to each branch, for example 80/20 between an incumbent provider and a new one. The detail that matters is how the split is computed. If it is random per request, a payment that is retried or re-submitted can land on a different branch, which muddies both the customer experience and your measurements. A deterministic split hashes a stable identifier, such as the payment id, into a bucket, so the same payment always takes the same branch. That keeps A/B comparisons honest and investigations reproducible.

Smart routing on cost and approval rate

Smart routing chooses among eligible accounts based on data rather than a fixed order. Two inputs are common:

  • Cost optimisation uses the prices you have declared for each account, which may vary by scheme, card type or region, to pick the cheaper eligible route.
  • Approval-rate optimisation uses recorded outcomes to prefer the account that has been approving similar payments more often.

Both come with caveats. Cost routing is only accurate if declared prices match your contracts, including scheme fees and cross-border surcharges. Approval-rate routing needs enough volume per segment to be meaningful, and it can chase noise if segments are too narrow. A sensible pattern is to apply smart routing within guardrails: conditions decide which accounts are allowed, and the optimiser only chooses among them.

Health signals and eligibility

A route that looks right on paper fails if the provider is down. Good routing engines feed health into eligibility:

  • A health monitor polls each account on an interval and uses hysteresis (several failures to mark unhealthy, several successes to recover) so a single blip does not flip traffic back and forth.
  • A circuit breaker opens when an account starts failing in production traffic, removing it from consideration until it recovers.
  • An eligibility check considers currencies, schemes, methods, countries, supported operations and environment, and it should be able to tell you why an account was excluded, not just that it was.

Testing and governing changes

Simulate before you publish

Routing changes affect real money, so test them before they go live. A useful simulator takes a sample payment (amount, currency, BIN, country and so on), runs it through a draft workflow without creating a payment, and shows the chosen path, eligibility reasons for each account, and what would happen on failure.

Two further checks are worth building into the process:

  • Saved scenarios as a regression gate. Keep a set of representative payments with expected routes. If a change breaks one, publishing stops.
  • Split verification. Run a batch of synthetic payment ids through a weighted split and confirm the observed distribution is close to the configured weights.

You can try the idea in our routing simulator, which runs entirely on synthetic data.

Versioning and governance

Treat routing configuration like production code. A workable lifecycle is draft, validated, approved, published, archived. Maker-checker approval means the person who builds a change is not the person who publishes it, which matters in production. Scheduled activation lets you line up a change with a contract start date. Rollback should be one step, and every transition should land in an audit log.

Signed exports between environments ensure the workflow tested in sandbox is the one that reaches production.

Measuring results

A routing change is a hypothesis. To know whether it worked, measure per workflow, per version and per node:

  • volume through each branch;
  • approval rate;
  • failover rate (how often a fallback was needed);
  • latency at p50 and p95.

Comparing versions on these numbers, over a similar traffic mix, tells you more than an overall dashboard. Replaying a set of past payments against a new version, without sending anything to a provider, is another way to see how routes would have changed before you publish. Workflow-level analytics of this kind sit alongside wider reporting in Meem Intelligence.

How Meem approaches this

Meem Routing implements the model described above in a visual Routing Studio. Workflows use typed conditions (currency, amount, BIN and BIN range, brand, scheme, issuer, customer and IP country, BIN-intelligence fields, transaction type and more), routing nodes for a pinned gateway, a priority list or a deterministic weighted split (bucketed by a SHA-256 hash of the payment id), smart-routing nodes for cost and approval rate, and terminals for route, reject and risk block.

Eligibility draws on a gateway health monitor and a per-account circuit breaker, and the eligibility service reports the reason an account was or was not eligible. Simulation creates no payments and shows eligibility, the failover plan and a recovery preview; saved scenarios gate publishing, and a 100-payment check verifies splits. Workflows move through draft, validated, approved, published and archived, with optional mandatory maker-checker approval in production, scheduled activation, rollback, signed export and import, and an audit trail. Analytics per workflow, version and node, plus replay of up to 500 past payments, close the loop.

The PSP adapters behind these routes are built and currently in sandbox status; merchants keep their own PSP contracts. To see it with your own scenarios, book a demo.

Related articles

See Meem orchestrate your payments

Walk through Routing Studio, recovery and intelligence with our team, using your providers, methods and markets.