Recurring routing
Keep a customer's repeat and merchant-initiated payments on the settlement account that approved their card, with a routing rule or fallback.
Merchant-initiated payments, such as recurring charges on a saved card, follow the same routing order as other payments. To keep a customer's card on the settlement account that approved it before, route to Previous Successful Settlement Account in a routing rule or in a rule's fallback.
How routing rules treat recurring payments
Pay.com treats a payment as recurring when it's merchant-initiated and isn't
the first payment of the series. For example, a charge with
"off_session": true on a saved payment method is recurring. The first charge
that saves a card with "setup_future_usage": "off_session" isn't. See
Create recurring charges.
Routing rules run on recurring payments by default. To exclude recurring payments from a rule, clear Evaluate in recurring transactions on the rule. Payment rules work the opposite way and skip recurring payments unless you check that box.
The previous successful settlement account
When a payment for a customer is approved, Pay.com records its settlement account on that customer's card, Apple Pay, or Google Pay payment method. That account is the payment method's previous successful settlement account. It applies to the customer's later payments with the same payment method, whether they're merchant-initiated or not, and it updates each time a payment with it is approved on another account.
Pay.com looks the previous account up through the customer, so pass the same
customer_reference_id on every payment from that customer, or charge their
saved payment method.
Route to the previous account
To send a returning card to the account that approved it last, create a routing rule that routes to Previous Successful Settlement Account and place it above your other routing rules. If the payment method has no previous account, for example a card the customer is using for the first time, Pay.com treats the target as unavailable and uses the next rule that matches.
If the previous account belongs to a settlement account group, Pay.com routes to the group's account for the payment's currency instead.
To route on the previous account in a condition, use the fields in Fields you can route on. For example, a rule can split new cards between two accounts only when no previous account exists.
Fall back to the previous account
A fallback can also route to Previous Successful Settlement Account. For example, a rule can split new traffic between two settlement accounts, with a fallback to the card's previous account when an attempt is declined. If the card has no previous account, Pay.com skips that fallback and moves on to the next one. See Fallbacks and retries.
Route recurring payments from your code
To choose the settlement account from your own backend instead, store
underlying_processing_details.settlement_account from the customer's first
approved payment and pass it as settlement_account on later
POST /v1/charges requests.
The amount is in minor units, so 5000 is $50.00 USD.
{
"amount": 5000,
"currency": "usd",
"source": "pm_card_687080745486778368",
"off_session": true,
"settlement_account": "sa_296645958265997349",
"reference": "sub-renewal-001"
}underlying_processing_details is returned only when processor details are
enabled on your account. See
Settlement account routing.
Next steps
- Routing rules: Create, order, and split routing rules.
- How routing works: The routing order and active methodologies Pay.com evaluates.
- Fallbacks and retries: How fallbacks run and how to read them.
- Create recurring charges: Charge a saved payment method off-session.