This page is part of the REST API Guides. Card capture happens in the frontend through the Payments Library; see the Payments Library Guides.
Why Use Multi-Gateway Failover
Without Orchestra, a provider outage means lost transactions. With multi-gateway failover, your payment flow stays resilient:- Provider downtime - If Stripe is down, Orchestra tries Adyen next
- Rate limiting - If a provider rejects a payment because of a rate limit, Orchestra tries the next provider
- Business continuity - Problems with one provider don’t stop your payments
Where Failover Is Available
Failover is self-serve. You don’t need to contact support or change your account setup. Add afallbackUpgs array to the request on any of these endpoints:
- Charge (
POST /PaymentGateway/charge) - Authorize (
POST /PaymentGateway/authorize) - Payments Library sessions (
POST /EWalletOperations), forCHARGE,CHARGE_AND_TOKENIZEandPREAUTH_AND_TOKENIZEoperations
fallbackUpgs names a backup Payment Gateway Account. Orchestra sends the transaction to the primary gateway first. If it fails, Orchestra tries each fallback in the order you list them.
Capture, void, refund and tokenize requests do not fail over.
Scheduled payments do not fail over. Each payment contract charges through its template’s payment gateway account only.
In sessions, failover applies to payments that go through a payment gateway: CardPay, Apple Pay and Google Pay. It does not apply to PayPal, BankPay or UPI, because those methods charge the payer directly without a payment gateway.
REST Example (Charge)
The primary gateway ispaymentGatewayAccountName. Each fallback entry also uses paymentGatewayAccountName:
fallbackUpgs array works on POST /PaymentGateway/authorize.
Session Example (Payments Library)
In a session request, the primary gateway ispaymentGatewayAccountId, and each fallback entry also uses paymentGatewayAccountId:
The fallbackUpgs Array
The entries have different fields on REST requests and in sessions.
REST (charge, authorize)
Fallback entries must reference stored Payment Gateway Accounts. Only the primary gateway can use raw credentials in the
paymentGatewayAccount object.
Sessions (POST /EWalletOperations)
Failover Logic
On charge requests and in sessions, Orchestra works through the list like this:- Primary attempt - Orchestra sends the transaction to the primary gateway.
- Check result - A
SuccessorAcceptedresult ends the flow. - Check the reason code - If the primary gateway rejected the payment with one of the reason codes listed below, the flow ends.
- Try fallbacks in order - Orchestra tries each fallback in the order you listed them, and stops at the first
SuccessorAcceptedresult. - Final result - Orchestra returns the first successful result, or the result of the last attempt.
rejectReasonCode to decide whether to fail over. If a fallback gateway rejects the payment, its reason code does not stop the chain: Orchestra still tries the next fallback.
The reason code rules on this page apply to charge requests and sessions. On authorize, any result other than
Success or Accepted moves to the next gateway.What Triggers Failover
Orchestra tries the next gateway when the primary attempt does not end inSuccess or Accepted. This includes:
- Temporary and fatal gateway failures (HTTP 503 and 500 responses)
- Rejections with no
rejectReasonCode - Rejections with any reason code not listed below, for example
DoNotHonor,InvalidCard,ProcessorDecline,ExceedsLimit,AuthenticationFailedorTechnicalError
What Doesn’t Trigger Failover
Orchestra does not fail over when the primary gateway rejects the payment with one of theserejectReasonCode values:
CardExpiredFraudLostOrStolenCardInsufficientFunds
When a Fallback Account Can’t Be Loaded
Sessions: Orchestra checks the primary account, every fallback account and every certificate when you create the session. If one of them can’t be found,POST /EWalletOperations returns HTTP 400 and no session is created. This check does not run for TOKENIZE sessions or when none of the allowed payment methods uses a payment gateway. If a fallback account can’t be loaded later, when the payment runs, the payment fails with a FatalFailure result that describes the problem.
REST: Orchestra does not check fallback accounts in advance. It loads each fallback account only when it reaches it in the list, which is after the primary gateway has failed. If it can’t load the account or certificate, the request stops and returns that error (for example HTTP 404 for an account or certificate that doesn’t exist) instead of a gateway result.
Test your fallback account names before you go live.
3DS Data
REST: Every gateway in the chain gets the same request. If you send 3DS results incard.threeDSAuthentication, Orchestra sends them to the primary gateway and to every fallback.
Sessions: The primary gateway gets the 3DS result collected in the session, if the gateway supports 3DS. A fallback gateway only gets it when its entry has pass3DSData: true and the gateway supports 3DS. With the default false, the fallback gets the payment without 3DS data.
Configuration Strategies
Primary + Backup
Most common setup: one primary provider, one backup for emergencies. This is a partial REST request body:Geographic Routing with Failover
Combine BIN-based routing with failover on a REST charge. By the time you charge, you have the card, so you can look up the issuer country and pick the primary gateway, then add backups:With Client Certificates
Some gateways require client certificates. UsepaymentGatewayCertName in the fallback entry. This is a partial session request body:
paymentGatewayAccountName instead of paymentGatewayAccountId.
Response
REST
The response is the result of the last attempt, and the HTTP status follows it: 200 forSuccess, 202 for Accepted, 409 for Rejected, 503 for TemporaryFailure and 500 for FatalFailure. Earlier failed attempts are not returned.
Sessions
Validate the result token withPOST /EWalletOperations/validateResults. upgChargeResults holds the last attempt. failedUpgChargeResults lists the earlier failed attempts in order, or is null if there was only one attempt.
Which Gateway Processed the Payment
gatewayName is the payment gateway type (for example Stripe), not the name of your Payment Gateway Account. If two of your accounts use the same gateway type, use gatewayReference and your own records to tell them apart.
Track which gateway succeeded to help with:
- Cost analysis per provider
- Performance monitoring
- Ensuring subsequent operations (capture, void, refund) go to the correct gateway
Testing Failover
Use the mock gateways:- Create a Payment Gateway Account for
NULLFailureand one forNULLSuccess. - Set the
NULLFailureaccount as the primary gateway. - Add the
NULLSuccessaccount as the fallback infallbackUpgs.
NULLFailure rejects every payment without a reason code, so Orchestra fails over and the payment succeeds on NULLSuccess.
Best Practices
Order by Preference
List fallback gateways in order of preference - lowest cost or best performance first.
Monitor Usage
Track which gateways are being used. High failover rates indicate issues with the primary.
Test Regularly
Verify failover works by simulating primary gateway failures in sandbox.
Geographic Alignment
Use providers with strong presence in your target markets as primary for those regions.
Related
How Orchestra Works
Understanding Orchestra’s architecture
Payment Gateway Accounts
Configure multiple providers
Charge Payments
Basic charge operation
Card Metadata Lookup
Get card issuer country for BIN-based routing