# Configure processor routing You can set custom routing and retry strategies using the Payments API to control the flow of your payments at an API level. This enables you to: - Be more flexible with how you route payments. - Quickly iterate on your payment routing and retry strategies. - Leverage your own tools to set routing rules – For example, using A/B testing. For example, you may want to route a payment through a specific processor if: - Your business has an agreement for lower fees from a specific card scheme or acquirer. - Your business type qualifies for reduced scheme fees from a specific processor. - The value of the transaction means it's cheaper to use a processor that charges a fixed fee instead of a percentage-based fee, or vice versa. > **Information** > > To enable custom payment routing, contact your account manager or [request support](https://dashboard.checkout.com/support/new?topic=case_account_management_and_access&issue=issue_account_changes). --- ## Get a list of available processors `Beta` Check which processors are available on your account before you set which processors to route your payment through. To return the processors available for a specific processing channel, pass the `processing_channel_id` as a query parameter. For example: ``` https://{prefix}.api.checkout.com/payment-methods?processing_channel_id=pc_ovo75iz4hdyudnx6tu74mum3fq ``` > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `GET` `https://{prefix}.api.checkout.com/payment-methods` **Sandbox** `GET` `https://{prefix}.api.sandbox.checkout.com/payment-methods` ### Response example ```json { "methods": [ { "type": "star" }, { "type": "nyce" }, { "type": "maestro" } ] } ``` --- ## Configure processor rules To set your payment routing rules, call the [Request a payment](https://api-reference.checkout.com/tag/Payments/#operation/requestAPaymentOrPayout) endpoint, and provide the `routing.attempts` array. Each object in the array must be a unique expression of a processor rule. You can set each `attempts.scheme` value to one of the following: | Scheme | Value | | --- | --- | | Accel | `accel` | | American Express | `amex` | | Cartes Bancaires | `cartes_bancaires` | | Diners Club International | `diners` | | Discover | `discover` | | JCB | `jcb` | | Mada | `mada` | | Maestro | `maestro` | | Mastercard | `mastercard` | | NYCE | `nyce` | | OmanNet | `omannet` | | Pulse | `pulse` | | STAR | `star` | | UnionPay International | `upi` | | Visa | `visa` | > **Information** > > We only attempt an authorization with the processors you explicitly include in your request. If your transaction fails, the [Intelligent Acceptance](https://www.checkout.com/docs/payments/optimize-payments.md#Intelligent_Acceptance) solution can help you improve your acceptance rate by optimizing the request and retrying it with your specified processor. We attempt to route the payment authorization to the processors you specify, in the order you set. If an attempt is declined or the card is not eligible to be processed with the specified processor, we attempt authorization with the next processor. For example, in the following request: 1. We attempt to send the authorization to the `star` processor first. 2. If `star` declines the attempt and you have Intelligent Acceptance enabled, we automatically retry the request to `star` with an optimized request payload. 3. If `star` declines the attempt again, we immediately send the authorization to the `nyce` processor. 3. If `nyce` accepts the authorization, we do not attempt to authorize with `maestro`. **Production** `POST` `https://{prefix}.api.checkout.com/payments` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` ### Request example ```json { "source": { "type": "card", "number": "4242424242424242", "expiry_month": 12, "expiry_year": 2022 }, "amount": 6500, "currency": "USD", "processing_channel_id": "pc_ovo75iz4hdyudnx6tu74mum3fq", "routing": { "attempts": [ { "scheme": "star" }, { "scheme": "nyce" }, { "scheme": "maestro" } ] }, "reference": "ORD-5023-4E89", "success_url": "https://example.com/payments/success", "failure_url": "https://example.com/payments/fail" } ``` ### Response example ```json { "id": "pay_mbabizu24mvu3mela5njyhpit4", "action_id": "act_mbabizu24mvu3mela5njyhpit4", "amount": 6500, "currency": "USD", "approved": true, "status": "Authorized", "auth_code": "770687", "response_code": "10000", "response_summary": "Approved", "processing": { "scheme": "nyce" }, "source": { "type": "card", "id": "src_nwd3m4in3hkuddfpjsaevunhdy", "last4": "4242", "fingerprint": "F31828E2BDABAE63EB694903825CDD36041CC6ED461440B81415895855502832", "bin": "424242" }, "links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4" }, "action": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4/actions" }, "void": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4/voids" }, "capture": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4/captures" } } } ```