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.
Routing Rules
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.
Priority-Based Selection
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.
Fallback
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 Level | Range | Managed By | Description |
|---|---|---|---|
| Method Priority | 0 - 100 | Merchant | Merchant sets per-method priority in their dashboard |
| PSP Priority | 0 - 100 | Admin | Platform admin sets per-PSP priority per merchant |
// 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 = 98PSP Priority Weight
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:
| Field | Type | Description |
|---|---|---|
country | string | Customer's country code (e.g., US, JP, VN) |
amount | number | Transaction amount |
currency | string | Currency code (e.g., USD, EUR, JPY) |
card_bin | string | First 6 digits of card number (BIN) |
card_brand | string | Card brand (visa, mastercard, amex, etc.) |
card_type | string | Card type (credit, debit, prepaid) |
customer_email_domain | string | Email domain of the customer |
hour_of_day | number | Hour of day (0-23) for time-based routing |
day_of_week | string | Day of week (Monday, Tuesday, etc.) |
Condition Operators
Rules support a rich set of operators for building conditions:
| Operator | Description | Example |
|---|---|---|
equals | Exact match (case-insensitive for strings) | country equals "US" |
not_equals | Does not match | currency not_equals "JPY" |
in | Value is in a list | country in ["US", "CA", "GB"] |
greater_than | Numeric comparison | amount greater_than 1000 |
between | Value within range (inclusive) | amount between [100, 5000] |
starts_with | String prefix match | card_bin starts_with "411111" |
contains | String contains substring | customer_email_domain contains "corp" |
matches_regex | Regular expression match | card_bin matches_regex "/^4[0-9]{5}/" |
// 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.
// 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)
✓ SuccessHow Cascading Works
Primary PSP selected
Transaction routes to highest-priority PSP based on rules and priorities
Payment attempt sent
EPaySe creates a payment attempt and sends it to the selected PSP
If failed: cascade to next PSP
The next payment method in priority order is selected automatically. Each cascade creates a new payment attempt.
Decision recorded
All routing decisions (selected method, reason, alternatives considered) are logged for analytics and optimization
Retry vs. Cascade
CASCADE. 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.
// 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:
| Feature | Description |
|---|---|
| Enable / Disable | Toggle PSP active status globally. Disabled PSPs are excluded from routing. |
| Freeze / Unfreeze | Freeze a PSP to halt all new transactions. Existing transactions in progress continue. Creates reserve records for affected merchants. |
| Credential Management | Store and update PSP API credentials securely. Credentials are encrypted at rest and masked in admin views. |
| Merchant Assignment | Assign PSPs to specific merchants with per-merchant priority and activation status. |
| Webhook Configuration | Configure webhook URLs and secrets for receiving payment status updates from each PSP. |
PSP Status Lifecycle
| Status | Can Process | Description |
|---|---|---|
Active | Yes | PSP is operational and available for routing |
Freezing | No | Freeze in progress, creating reserve records for affected merchants |
Frozen | No | PSP 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
Configure at least 2 PSPs per merchant for failover redundancy
Use the rule testing feature before activating new routing rules
Set distinct priority scores for each payment method (avoid ties)
Monitor routing analytics regularly to identify optimization opportunities
Rely on a single PSP for all transactions — if that PSP goes down, all payments stop
Create overlapping rules without understanding the priority order — higher priority rules always win
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.
