How routing works
The order Pay.com follows to pick a settlement account for a payment, and where the response shows the route.
Pay.com sends every charge, hold, payout, and card verification through one settlement account. A settlement account is an account with an acquirer or processor, in one currency, that belongs to one of your legal entities. Picking that account is routing. Pay.com picks it the same way for payments you create with the API and for the payments customers make in a payment session.
Routing order
Pay.com checks three sources in order and uses the first one that specifies a settlement account. The response records which one it used as the routing methodology.
| Methodology | Where the settlement account comes from |
|---|---|
merchant_provided | The settlement_account you passed in the request. Pay.com doesn't apply routing rules to choose the account. See Settlement account routing. |
rule_engine | The first routing rule that matches the payment. See Routing rules. |
static_settlement_account | Your default settlement account for the payment's currency, or your account's general default. Your Pay.com account team sets these defaults. |
If the account Pay.com picks is disabled, the payment is declined. When a routing rule picked the account, the rule's fallback can send a declined attempt to another account. See Fallbacks and retries.
Limit the routing methodologies
Pass payment_method_options.routing_methodologies when you create a charge,
hold, payment session, or setup session to limit which methodologies Pay.com
can use for it. The field is on
POST /v1/charges,
POST /v1/holds,
POST /v1/sessions/payment,
and POST /v1/sessions/setup.
Pay.com keeps the order shown above and skips the methodologies you leave out.
For example, to skip your routing rules for a charge and use your default
account, leave out rule_engine:
{
"amount": 8000,
"currency": "usd",
"source": "pm_card_685125127054035968",
"payment_method_options": {
"routing_methodologies": ["merchant_provided", "static_settlement_account"]
}
}The amount is in minor units, so 8000 is $80.00 USD.
Your account's own list is in routing_methodologies in
GET /v1/merchants/current/payment_method_options,
and it applies when the request doesn't pass one. The API also accepts
initial_mit, stored_processor_token, and
previous_successful_settlement_account, but Pay.com ignores them when picking
a settlement account. If none of the values you pass can apply, Pay.com uses the
full order. To keep a customer's payments on the account that approved them
before, use a routing rule instead. See Recurring routing.
See which route processed a payment
When processor details are enabled on your account, charges, holds, refunds, and
payouts include underlying_processing_details. Contact your Pay.com account
team to enable processor details. These fields describe the route:
| Field | What it holds |
|---|---|
settlement_account | The settlement account that processed the payment. After a fallback, it's the fallback's account. |
settlement_account_details | The account's name, its currency, and the legal entity that owns it (entity and entity_details). currency is absent for an account where the processor settles to you directly. |
routing_details.selected_methodology | How Pay.com picked the first route. One of merchant_provided, rule_engine, or static_settlement_account. |
routing_details.rule_engine | The rule_id of the routing rule that picked the first route, when selected_methodology is rule_engine. Otherwise null. |
transaction_id | The processor's ID for the transaction. For some payments that Pay.com acquires itself, it's the digits of Pay.com's own ID. |
failure_code and failure_message | The processor's own decline code and message, when the payment was declined. The charge's top-level failure_code is Pay.com's normalized code. |
routing_details describes the first routing decision. If a fallback processed
the payment, settlement_account identifies the fallback's account, and
retry_attempts lists the attempts before it. The pruned response below omits
unused null fields. See
POST /v1/charges for the full
schema.
{
"id": "chrg_685125114794084352",
"resource": "charge",
"amount": 8000,
"currency": "usd",
"status": "succeeded",
"underlying_processing_details": {
"settlement_account": "sa_296645958265997349",
"settlement_account_details": {
"name": "Main Settlement Account",
"currency": "usd",
"entity": "ent_296645958265997359",
"entity_details": {
"legal_name": "ACME Corp",
"country": "US"
}
},
"routing_details": {
"selected_methodology": "rule_engine",
"rule_engine": {
"rule_id": "rl_772846036363248640"
}
}
},
"retry_attempts": []
}In the Pay.com dashboard, the Settlement Account column in Activity → Transactions shows the same account.
Smart Router
If Smart Router is enabled on your account, a routing rule can route to a Smart
Router configuration instead of a single settlement account, and Smart Router
picks one of the configuration's accounts for each payment. When it picked the
account, routing_details also carries smart_router (true),
smart_router_configuration_id, and smart_router_configuration_name. The
dashboard marks these payments in the Smart Router column of Activity →
Transactions. See Smart Router.
Next steps
- Routing rules: Route payments by conditions, splits, and fallbacks.
- Settlement account routing: Specify the settlement account in your request.
- Fallbacks and retries: Read the attempts behind a retried charge.