Custom Gateway Routing
Learn how to use Custom gateway routing via our V3 and V2 APIs when performing orchestrated routing from your own platform.
Overview
Custom gateway routing involves using the gateway_code parameter intelligently to route your transactions instead of using Recurly's selection logic or set Default a gateway to do so. For example, if your default gateway for credit cards is Stripe, but you want a specific signup transaction to use Braintree, you can pass in the unique ID (the gateway code) of that gateway instance, to bypass defaults, and use the gateway of your choice.
Read more about gateway routing in our dedicated overview: Custom gateway routing
Placement Definitions
Where you place your gateway_code matters. Depending on the effect you want, ensuring that the gateway code is sent appropriately is exceptionally important.
- In the
billing_infoobject: Placement here affects the transaction in progress, and will direct the transaction to the gateway_code you send. Sending thegateway_codein this object does not control which gateway is used for renewals or trial conversions. This is also where abackup_gateway_codecan be set. - In the Subscription endpoint, top level: Placement here affects renewals only, and will not affect the gateway used for the signup transaction.
- In the Purchase endpoint, within the subscription object: Similar to the previous point, this affects where renewals are sent, and does not control the signup gateway used.
- To control both: Send the
gateway_codeparameter and value in both places. This ensures you get the effect you want, such as signup and renewal or trial conversion continuity on the same gateway, or different if you prefer.
Guides:
Updated about 5 hours ago