> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration Method - Payment Providers Routing Rules

Payment provider routing rules are used to route transactions to the appropriate payment provider. Each merchant will have one or more payment providers configured in Payment Provider section of Merchant Configuration..

As transactions are prepared for payment, the routing rules are applied to map which provider should be used for which transaction.

The key components to how the rules are applied are:

* **Rule Ordinal** - (index sequential numbers) Ordinals are applied in highest first order, such as 9 before 8 before 7. As a rule, best practice dictates that the final rule (Ordinal 0) should be the default\_method rule, which will route all transactions to the provider that failed to meet a previous rule.

  **Note:** Keep in mind that the lowest ordinal rule (0) should be the default method for use when all others fail.

* **Rule Method** - Control the routing of transactions based on certain conditions. If the conditions are not met, the rule is skipped for the next one. For details of the Rule methods, see [Routing Rules- Supported Rule Methods](#section_v21_grz_5vb) below

* **Active Flag** - The active flag ignores inactive rules and applies active ones in the reverse ordinal order. 1 indicates Active, 0 or empty indicate inactive rule.

## Routing Rules- Supported Rule Methods

The following Rule Methods are available:

| Routing Rule | Description |
| - | - |
| **payment\_method (Rule ID 21)** | - Use this rule to route traffic based on the different payment methods (like Credit Card, ECP, Venmo, MAP) to different providers (for example Paymentech, Braintree, or Litle). **Note:** Paypal is a special exception, in the absence of a rule all transactions of PayPal payment type are routed to the PayPal processor. It is strongly recommended that a payment\_method rule be set up for PayPal with the PayPal processor. |
| **billing\_address\_country (Rule ID 1008836)** | - Use this rule to route payments to different providers based on the country of the customers' billing address. **Note:** When using this rule, the country used is the default country set up in the merchant config. |
| **card\_and\_country\_and\_currency\_and\_payment\_method (Rule ID 54)** | Use this rule to apply a combination of rules as the rule name implies - specifically - Credit card - Country - Currency - Payment Method You may use one or more of the possible options on this rule. It is also possible to use multiple values for multiple items. For example, if you want to route transactions for Great Britain and Ireland countries (GBR and IRL) with currencies Pounds and Euros (GBP and EUR) to paymentech, you can use this rule and specify two values for country and two values for currencies. |
| **zero\_amount\_transaction (Rule ID 452):** | Use this rule to route transactions that end up with a zero balance (usually because the credits applied reduce the owed amount to zero) to a specific processor. |
| **name\_value\_processor (Rule ID 22):** | This method routes based on a Name value pair appearing in the Transaction. To use it, the defined provider is defined with a value for the payment provider. When the value is encountered, the Transaction is routed accordingly. The value entered in the Routing rule should be identical to the spelling of the provider name. The most common use for this method is for Retain decision rules that reroute the retry attempts to different providers, see [Custom Retry Rerouting](decisionRulesRetryProviderRouting_r).If not using for routing decision rules - do not use this method and keep it for QA testing. There should not be any use of this in production for other uses. Please speak with Product or QA leads if you have questions. (overridenormal PaymentProvider via nameValue vin:payment\_processor) |
| **default\_method (Rule ID 1)**: | This is a catch all method, so that any transaction that does not meet the other rules will use this rule to process payments to the provider set up on this rule. Every merchant must have this rule set up and usually as ordinal 0. If you have this rule at a higher ordinal than 0 anything with a lower ordinal will be ignored. |

## Paypal Routing

Paypal routing is an exception, whereby all PayPal transactions in the absence of a rule will be routed to the PayPal processor. It is still strongly recommended that a payment\_method rule be set up for PayPal with the PayPal processor.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.