Platform
Gateway Routing
Route payments intelligently across multiple payment providers.
Overview
PaymentHooks sits between your application and multiple payment gateways. Instead of hard-coding a single gateway, you define routing rules that automatically select the optimal gateway for each transaction based on currency, amount, region, gateway health, and cost.
37+ gateways
Connect any provider
Auto failover
Transparent retry on failure
Cost optimization
Route for lowest fees
Routing rules
Rules are evaluated in priority order. The first matching rule determines which gateway processes the payment.
| Condition | Example | Description |
|---|---|---|
| currency | currency == 'inr' | Route by payment currency |
| amount | amount > 100000 | Route high-value payments differently |
| region | region == 'EU' | Route by customer region |
| gateway_health | health > 0.95 | Skip degraded gateways |
| cost | fee < 2.5 | Optimize for lowest processing cost |
| card_brand | card == 'amex' | Route specific card brands |
Automatic failover
If the primary gateway returns an error or is unhealthy, PaymentHooks automatically retries the payment through the next gateway in your routing chain. This happens transparently to your application and typically adds less than 200ms of additional latency.
Configuration
Routing rules are configured via the merchant dashboard under Settings → Routing. You can also use the API to create rules programmatically:
curl -X POST https://paymenthooks.com/api/v1/routing-rules \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Route INR to Razorpay",
"priority": 1,
"conditions": [{"field": "currency", "operator": "equals", "value": "inr"}],
"gatewayId": "gw_razorpay",
"fallbackGatewayId": "gw_stripe"
}'