Routing

Overview

With Payrails you can configure your own routing rules to make sure that each transaction is processed via the most efficient route, to maximize your acceptance rates.

The routing rules are a part of a workflow configuration, together with Payment options. Both steps need to be configured before the workflow version can be used for processing payments.

If you are creating an entirely new workflow configuration using “+ New version”, after clicking on Routing you will be redirected to an empty canvas where you can configure the rules. If you are making changes to an existing version using “Edit as new version”, you will see all the routing rules of this version.

Routing configuration

Routing configuration consists of two parts:

  • Authorization settings configuration
  • Routing configuration, separately for each payment method you added in Payment options


Authorization settings

To configure authorization settings, simply click on “Authorization settings” in the upper right part. Here you can configure:


Routing rules

Routing rules have to be configured for every payment method separately. To add a routing rule, simply click on “+ Add Routing rule”. As a first step you need to define the default routing - this is the provider to which the payment will be routed if no other rules are configured or no other rules apply.

Once you confirm, you will see your first rule on the canvas.

After configuring your default route, you can add more rules. A rule can consist of a single condition, or multiple conditions with an AND operator.

  • Example: “IF Card Network is equal to Visa THEN authorize with Adyen”
  • Example: “IF Authorization Currency is one of EUR,GBP THEN authorize via Stripe”
  • Example: “IF Card Issuer Country is one of AT,DE,CH AND Authorization Currency is equal to EUR THEN authorize via Braintree”

After adding the above rules, your canvas should look like this:


📘

It is important to remember that the rules are evaluated in the order of configuration.

In the example above, rule 3 will never happen, because rule 2 already takes care of all the EUR payments. If you want to keep rule 3, you need to have it evaluated before rule 2. To do it, simply drag and drop the rule higher.

You can configure the Routing rules based on any fields related to the authorization request body or workflow execution context. This includes but is not limited to:

  • Authorization request body fields
  • Meta fields
  • Workflow execution context fields, e.g., Card Issuer Country or Card Network

Additionally, Payrails allows you to split the traffic between providers using Routing Randomizer field and assigning a value between 0-100. In the below example the traffic is split 50/50 between Stripe and Checkout.com.


Retries rules

Payrails also supports Retries to automatically retry a failed authorization attempt. Retry rules allow configuring “fallback” providers, to recover failed payment authorizations.

📘

To enable Retries, please reach out to your Payrails account manager.

Once the retry configuration is enabled and set up, you can create Routing rules for the retry authorizations. Retry rules decide when and in what situation a retry should happen (for example, “retry InsufficientFunds decline reason in 24 hours”), whereas Routing rules decide where the retried authorization should be routed (for example, “retry all failed Stripe authorizations with Adyen”).

You can configure a retry either with the same PSP or a different PSP. In case you configure a retry with a different PSP, Payrails will handle transforming the request body and automatically making the authorization request with the configured fallback PSP.

To set up the Routing rules for retries, you can use the following fields to specify the fallback rule:

  • Last authorize provider
  • Current authorize attempt

In this example, if the first failed authorization attempt was processed with Stripe, then the authorization retry will happen with Adyen.


In this example, the second authorization attempt will be processed with Checkout.com, regardless of the provider used for the first authorization attempt.


Tips for routing configuration

  • If you want to use a specific provider for a single authorization attempt, you can override the rules by sending Payment Provider Override in the authorization attempt, and making sure that a related rule is created
  • You can create rules based on Customers’ data, for example Customer country code or Customer email
  • For text values you can use operators like contains or does not contain as well as starts with or ends with

What’s Next

Create an execution