Smart Routing
Route transactions automatically to the most suitable terminal for easier integration and better operational control.
Smart Routing is emerchantpay’s adaptive gateway endpoint that automatically selects the most suitable terminal for each transaction. By shifting the routing logic from your application to the platform, you can
- Simplify your integration – call a single endpoint instead of hard-coding terminal tokens or maintaining complex routing tables.
- Route based on transaction parameters – the platform uses inputs like currency, card brand, and required features to select a compatible terminal, without needing routing logic in your application.
- Reduce configuration overhead – if no terminal matches, Smart Routing returns a descriptive error, helping you recover or retry without guesswork.
- Adapt more easily – when new terminals or acquirers are added to your merchant profile, Smart Routing includes them automatically—no code changes required.
How Smart Routing works
When you POST a standard Processing API payload to the Smart Routing endpoint, the platform performs the following sequence:
- Eligibility check – verifies that your merchant profile has Smart Routing enabled.
- Initial pool – builds a candidate list of terminals/MIDs that support the requested currency.
- Progressive filtering
- Transaction type support (e.g.,
authorize3d
,sale
). - Terminal-level feature flags (e.g.,
3-D Secure
,recurring
,installment
). - MID-level feature flags.
- Mandatory parameter support (e.g., AVS or CVV).
- “Same MID” requirement, if the request references a previous transaction.
- Card-brand compatibility (applied only when you send a PAN or token).
- Terminal selection
- If exactly one candidate remains, that terminal is used.
- If several remain, the platform selects one based on internal prioritisation logic.
- If none remain, the gateway returns a
terminal_not_found
error with a human-readable cause.
Tip: Provide the full set of optional fields (device data, customer address, etc.)—richer requests increase the pool of terminals that qualify for risk-based exemptions and frictionless 3-D Secure flows.
Single-transaction reconciliation
Smart Routing supports reconciliation and lets you respond to chargebacks without specifying a terminal token. The platform determines the correct terminal based on the original transaction.
Authentication and credentials
Smart Routing uses the same merchant ID, username and password as the Processing API. You authenticate with HTTP Basic:
POST /smart-routing/v1/transactions
Authorization: Basic {base64(user:pass)}
Accept: application/xml # or text/xml
Content-Type: application/xml
Enable Smart Routing
- Open a ticket with Tech Support and request activation for your merchant ID (specify test / production).
- Wait for confirmation that the feature flag is enabled.
- Swap your endpoint URL and add the
Accept
header. Everything else in your request body stays identical to the Processing API schema.
Example request
<payment_transaction>
<transaction_type>authorize3d</transaction_type>
<transaction_id>TRX_20250623_123</transaction_id>
<remote_ip>203.0.113.5</remote_ip>
<amount>100</amount>
<currency>EUR</currency>
<card_holder>Jane Doe</card_holder>
<card_number>4200000000000000</card_number>
<expiration_month>12</expiration_month>
<expiration_year>2026</expiration_year>
<cvv>123</cvv>
<customer_email>jane@example.com</customer_email>
</payment_transaction>
The gateway replies with
object, plus a
element that shows which terminal was chosen.
Error handling
Smart Routing returns the standard response_code
list plus three routing-specific errors:
Code | Description | Typical cause | Recommended Action |
---|---|---|---|
terminal_not_found |
No terminal matches all filters | Unsupported currency / card brand | Check the parameters; consider creating a new terminal |
smart_routing_not_enabled |
Feature flag off | Merchant ID not activated | Contact Tech Support |
rate_limit_exceeded |
Burst or sustained TPS above limit | Traffic spike | Retry with exponential back-off or request higher capacity |
Performance and rate limits
To keep the service stable, Smart Routing applies rate and burst limits. If you expect higher traffic than usual, such as during flash sales or marketplace activity, contact Tech Support with your expected peak transactions per second (TPS).