EPaySe
Advanced

Multi-PSP Routing

Optimize your payment stack by routing transactions across multiple Payment Service Providers (PSPs) for higher approval rates, lower costs, and built-in redundancy.

Why Multi-PSP Routing?

Higher Approval Rates

Route transactions to the PSP with the best approval rate for each region and card type, maximizing successful payments.

Automatic Failover

When a PSP fails or times out, transactions automatically cascade to the next available provider without customer intervention.

Risk Distribution

Distribute transaction volume across multiple PSPs to reduce concentration risk and maintain business continuity.

How Routing Works

EPaySe uses a 3-tier routing system. Each incoming transaction is evaluated through these tiers in order until a payment method is selected.

1

Routing Rules

Highest Priority

Custom rules with conditions (country, amount, card type, time) that route, boost, or block specific payment methods. Rules are evaluated by priority order with AND logic between conditions.

2

Priority-Based Selection

Default

If no rules match, the system calculates an effective priority score combining merchant's method priority (0-100) and admin's PSP priority (0-100) to select the best payment method.

3

Fallback

Last Resort

If no priorities are configured, the first available payment method assigned to the merchant is used as fallback.

Priority System

The priority-based routing combines two levels of priority to calculate an effective score for each payment method:

Priority LevelRangeManaged ByDescription
Method Priority0 - 100
Merchant
Merchant sets per-method priority in their dashboard
PSP Priority0 - 100
Admin
Platform admin sets per-PSP priority per merchant
JavaScript
Effective Priority Formula
// Effective Priority Formula
effective_priority = method_priority + (psp_priority × 0.2) + boost

// Example calculation
// Method Priority: 80 (set by merchant)
// PSP Priority: 90 (set by admin)
// Boost: 0 (no rule boost active)
effective_priority = 80 + (90 × 0.2) + 0 = 98

Routing Rules

Routing rules provide fine-grained control over payment method selection. Each rule has conditions that are evaluated against the transaction context, and an action to execute when all conditions match.

Rule Types

Route To

Direct transaction to a specific payment method when conditions match.

Priority Boost

Increase the effective priority of payment methods when conditions match, influencing selection order.

Block

Prevent a specific payment method from being used when conditions match.

Routing Context

Each transaction generates a routing context containing the following fields that can be used in rule conditions:

FieldTypeDescription
countrystringCustomer's country code (e.g., US, JP, VN)
amountnumberTransaction amount
currencystringCurrency code (e.g., USD, EUR, JPY)
card_binstringFirst 6 digits of card number (BIN)
card_brandstringCard brand (visa, mastercard, amex, etc.)
card_typestringCard type (credit, debit, prepaid)
customer_email_domainstringEmail domain of the customer
hour_of_daynumberHour of day (0-23) for time-based routing
day_of_weekstringDay of week (Monday, Tuesday, etc.)

Condition Operators

Rules support a rich set of operators for building conditions:

OperatorDescriptionExample
equalsExact match (case-insensitive for strings)country equals "US"
not_equalsDoes not matchcurrency not_equals "JPY"
inValue is in a listcountry in ["US", "CA", "GB"]
greater_thanNumeric comparisonamount greater_than 1000
betweenValue within range (inclusive)amount between [100, 5000]
starts_withString prefix matchcard_bin starts_with "411111"
containsString contains substringcustomer_email_domain contains "corp"
matches_regexRegular expression matchcard_bin matches_regex "/^4[0-9]{5}/"
JSON
Example Routing Rule
// Example routing rule structure
{
    "rule_name": "Route US high-value to primary PSP",
    "rule_type": "route_to",
    "priority": 100,
    "conditions": [
        {
            "field": "country",
            "operator": "equals",
            "value": "US"
        },
        {
            "field": "amount",
            "operator": "greater_than",
            "value": 1000
        }
    ],
    "actions": {
        "route_to": "payment_method_id_here"
    }
}

Cascading & Failover

When a payment attempt fails with the selected PSP, EPaySe automatically cascades to the next available payment method. This ensures maximum payment success rates.

TEXT
Cascading Failover Flow
// Cascading failover flow
Transaction → PSP A (primary, priority 98)
    ↓ Failed (timeout/declined)
Transaction → PSP B (secondary, priority 85)
    ↓ Failed (declined)
Transaction → PSP C (tertiary, priority 72)
    ✓ Success

How Cascading Works

1

Primary PSP selected

Transaction routes to highest-priority PSP based on rules and priorities

2

Payment attempt sent

EPaySe creates a payment attempt and sends it to the selected PSP

3

If failed: cascade to next PSP

The next payment method in priority order is selected automatically. Each cascade creates a new payment attempt.

4

Decision recorded

All routing decisions (selected method, reason, alternatives considered) are logged for analytics and optimization

Routing Context

For each transaction, EPaySe builds a routing context containing all available information about the transaction, customer, and timing. This context is used to evaluate routing rules.

JSON
Example Routing Context
// Routing context built for each transaction
{
    "country": "US",
    "ip_country": "US",
    "card_bin": "411111",
    "card_brand": "visa",
    "card_type": "credit",
    "amount": 150.00,
    "currency": "USD",
    "customer_email": "[email protected]",
    "customer_email_domain": "example.com",
    "customer_ip": "192.168.1.1",
    "time_of_day": "14:30",
    "day_of_week": "Monday",
    "hour_of_day": 14,
    "transaction_id": "01abc...",
    "merchant_id": "01xyz..."
}

PSP Management

Platform administrators manage PSP configurations through the admin dashboard. Each PSP has the following controls:

FeatureDescription
Enable / DisableToggle PSP active status globally. Disabled PSPs are excluded from routing.
Freeze / UnfreezeFreeze a PSP to halt all new transactions. Existing transactions in progress continue. Creates reserve records for affected merchants.
Credential ManagementStore and update PSP API credentials securely. Credentials are encrypted at rest and masked in admin views.
Merchant AssignmentAssign PSPs to specific merchants with per-merchant priority and activation status.
Webhook ConfigurationConfigure webhook URLs and secrets for receiving payment status updates from each PSP.

PSP Status Lifecycle

StatusCan ProcessDescription
Active
YesPSP is operational and available for routing
Freezing
NoFreeze in progress, creating reserve records for affected merchants
Frozen
NoPSP is frozen, all new transactions blocked. Can be unfrozen by admin.

Dashboard Configuration

For Merchants

Merchants can manage routing through the merchant dashboard:

  • Payment Method Priorities — Set the priority (0-100) for each assigned payment method
  • Routing Rules — Create custom rules based on transaction conditions
  • Rule Testing — Test routing configuration with sample transactions before going live
  • Analytics — View routing decision history to understand how transactions are being routed

For Admins

Platform administrators have additional controls:

  • PSP Management — Enable/disable PSPs, manage credentials, freeze/unfreeze
  • Merchant PSP Assignment — Assign PSPs to merchants with per-merchant priority
  • Global Configuration — Set platform-wide routing defaults and PSP weights
  • Monitoring — Track PSP health, success rates, and routing patterns

Best Practices

DO

Configure at least 2 PSPs per merchant for failover redundancy

DO

Use the rule testing feature before activating new routing rules

DO

Set distinct priority scores for each payment method (avoid ties)

DO

Monitor routing analytics regularly to identify optimization opportunities

DON'T

Rely on a single PSP for all transactions — if that PSP goes down, all payments stop

DON'T

Create overlapping rules without understanding the priority order — higher priority rules always win

DON'T

Set all payment methods to the same priority — it makes routing unpredictable

Related Resources

Learn more about the payment system and how to integrate with EPaySe.