Skip to Content
Docs

Routing rules

Send payments that match your conditions to a settlement account, a percentage split, or the account that last approved the card.

A routing rule sends the payments that match its conditions to a settlement account. You manage routing rules in the Pay.com dashboard under Rules → Routing, and Pay.com evaluates them on every charge, hold, payout, and card verification, including the payments customers make in a payment session.

Requirements

Before you create routing rules, make sure you have:

  • Routing rules enabled on your account. If Routing doesn't appear under Rules, contact your Pay.com account team to enable it.
  • A dashboard user role that can edit routing rules. Without it, the list of rules is read-only.
  • At least two settlement accounts. Check them in Settings → Settlement Accounts.

How Pay.com picks a rule

Pay.com checks your routing rules in the order of the Position column, from the top of the list down. The first rule whose conditions match the payment decides where it goes, and Pay.com doesn't use the rules below it to route that payment.

  • Unavailable targets: if every target of a matching rule is unavailable, Pay.com skips that rule and uses the next one that matches. See Choose where a rule routes.
  • No match: if no rule matches, Pay.com sends the payment to your default settlement account. See How routing works.
  • Payment methods: each payment method has its own list of rules. Cards & Wallets holds the rules for cards, Apple Pay, and Google Pay, and every other payment method has its own tab with its own positions.
  • Recurring payments: routing rules run on merchant-initiated payments by default. To exclude recurring payments from a rule, clear Evaluate in recurring transactions on the rule. See Recurring routing.
  • System rules: rules that Pay.com creates for your account sit at the top of the list and can't be edited.

To change the order, use the arrows next to each rule's position. A rule you duplicate is placed directly below the original.

Payment rules run separately. The ones that apply to every settlement account run before routing, and the ones scoped to one settlement account run after routing has picked that account. See Payment rules.

Choose where a rule routes

Each rule routes to one target, or to several targets split by percentage. The Route to column shows each rule's targets.

TargetWhere the payment goes
A settlement accountThat settlement account.
Previous Successful Settlement AccountThe settlement account that last approved this customer's card, Apple Pay, or Google Pay payment method. If there isn't one, Pay.com treats the target as unavailable. See Recurring routing.
A settlement account groupThe group's first enabled account that accepts the payment's currency. If none does, the group's default account. Your Pay.com account team sets up groups.
A Smart Router configurationThe account that Smart Router picks for the payment from the configuration's accounts. Available in rules for cards. See Smart Router.

Pay.com also checks each target before it uses it. A settlement account that's disabled, or that can't process the payment's currency, payment method, or transaction type (payment, refund, or payout), is unavailable.

Split traffic by percentage

A rule can split the payments it matches between several targets, for example to send 60% of them to one settlement account and 40% to another. Each split covers a range of numbers from 1 to 100. Pay.com assigns every payment a number from 1 to 100 for the rule and uses the split whose range includes it. In the Route to column, each target shows its share, such as (60%).

The number depends only on the payment and the rule, so Pay.com always picks the same split if it evaluates the same payment again.

If one split's settlement account is unavailable, Pay.com shares that split's range evenly between the other splits. If every split is unavailable, Pay.com skips the rule.

Add a fallback to a rule

A target in a routing rule can have its own fallback, which lists the decline codes that trigger a retry and the settlement account Pay.com retries on. You can pick only decline codes marked Fallbackable in the error codes table. A target can also use the default fallback of its settlement account, which you set in Settings → Settlement Accounts on the account's Fallback card.

Each split of a rule has its own fallback, and a fallback can route to Previous Successful Settlement Account or to a Smart Router configuration. With advanced fallback routing, if it's enabled on your account, a fallback can also split by percentage and have fallbacks of its own. For how fallbacks run and how to read them on a charge, see Fallbacks and retries.

Create a routing rule

Create rules in the dashboard's rule builder. A rule routes payments only while it's enabled, which the Enabled column shows.

  1. 1

    Open the routing rules

    Go to Rules → Routing in the Pay.com dashboard. Pick the tab of the payment method the rule is for, such as Cards & Wallets, then click Create new rule.

  2. 2

    Add conditions

    Add the conditions a payment must match, such as the card's issuing country or the amount in USD. Combine conditions with AND or OR. For the fields and operators you can use, see Fields you can route on.

  3. 3

    Choose the targets

    Pick the settlement account to route to. To split traffic, add more targets and set each one's percentage. Add a fallback for each target if you want Pay.com to retry declined payments on another account.

  4. 4

    Save and order the rule

    Save the rule. Then use the arrows in the Position column to move it above any broader rule that would otherwise match the same payments first.

Check which rule routed a payment

When processor details are enabled on your account, a payment routed by a rule carries the rule's ID in underlying_processing_details.routing_details.rule_engine.rule_id, which matches the Rule ID shown on the rule's page in the dashboard. For the response fields and example payload, see See which route processed a payment.

In the dashboard, open a rule and select Logs to see its evaluations and the settlement account each payment used. The Performance tab, where it's available on your account, shows how the rule's traffic performs.

Next steps

Was this page helpful?