Skip to content
EN
Book a demo

HomeGuides

How to Integrate Multiple Payment Gateways Behind One API

How to integrate multiple payment gateways comes down to one move: connect your checkout to one API and attach each gateway behind it, instead of writing a separate integration per gateway. Each new gateway then becomes credentials, a connector and a routing rule, and the code that takes the customer's payment stays as it is.

On this page

The steps below fit any layer that offers one API in front of several providers. They also answer how to connect multiple payment providers without a rebuild each time. Your side is done once, and every later gateway reuses it.

01How to integrate multiple payment gateways: before you start

Gather these before you touch any configuration. Most delays come from the second and third rows, and they sit outside your team.

What you need Who owns it Where it comes from
Contract and live credentials for the new gateway Head of payments The gateway's onboarding team
API documentation and test credentials Integration engineer The gateway, on request
A named technical contact at the gateway Integration engineer The gateway's integration support
Every payment status your checkout handles today Your developers Your own code and order system
Markets, currencies and methods the gateway should cover Payments lead Your sales and decline data
Settlement files and a reconciliation owner Finance The gateway's reporting

If the gateway has no ready connector in your layer, the documentation and the technical contact are what its build depends on. Ask for both on day one.

02Step by step

  1. 01 Write down why you're adding the gateway

    Pick one reason and put it in a sentence, for example "send EUR card payments from Germany to a local acquirer" or "keep a fallback for when the first gateway times out". The sentence becomes your first routing rule and your pass-or-fail test later. Two reasons at once make a messy first rollout, so take the second one in a later round.

  2. 02 List what your checkout sends and receives

    Open your current payment code and write out every field it sends, every status it reads and every place a status changes an order. Mark the statuses that end a payment (approved, declined, canceled) and the ones that don't (pending, awaiting authentication). You're not changing this code. You're building the checklist the new setup has to satisfy, so the gateway's own vocabulary never reaches your orders.

  3. 03 Confirm the gateway has a connector in your layer

    A connector is the part of the layer that speaks one gateway's format. Ask your layer's vendor whether one exists for your gateway. If it doesn't, ask what a new one needs. Expect the answer to be the gateway's valid API documentation and a person at its technical team who replies quickly, because those two things set the schedule more than any code does.

  4. 04 Point your checkout at the one API

    Send payment requests to the single API of the layer and keep gateway-specific fields out of your code. Read the layer's API documentation for how each status is named and which are final, then map them to the checklist from step 2.

    Subscribe to its webhooks for status updates, so your orders update without polling. Afterward you see one request format and one status model, whichever gateway handled the payment.

  5. 05 Attach the gateway and set one narrow rule

    Enter the gateway's credentials in the layer, then create a single rule that matches your sentence from step 1. Routing rules usually key on card BIN, card type, currency, amount, country or payment method. Start with the narrowest one that covers your reason, such as one currency from one country, so a mistake touches few customers.

  6. 06 Decide what happens on a decline

    How to route payments across multiple payment gateways includes what to do when the first choice says no. Decide which declines should try the second gateway in the same payment (soft declines and timeouts are the usual candidates) and which should stop there. A hard decline for a stolen card gains nothing from a retry, and a second attempt only adds noise to your reports.

  7. 07 Run it in test mode

    Use the sandbox and the gateway's test credentials. Walk through each scenario from the next section with your QA team. You should see every test payment come back with a status your checklist covers, and a webhook arrive for each change.

  8. 08 Move live traffic and read the combined reports

    Switch the narrow rule to live and watch the first day's payments in one dashboard rather than in the gateway's portal. How to manage multiple payment gateways day to day is mostly this view: volume, approvals and declines per gateway side by side. Widen the rule only after finance confirms the first settlement matches.

03Testing before real traffic

Run each of these with test credentials before a single live payment moves. Give each one an owner and a pass mark.

  • An approved payment ends in your order system as paid, with one webhook received
  • A declined payment shows the reason in the layer's dashboard and the order stays unpaid
  • A payment that needs authentication completes and updates the order afterward
  • A timeout on the first gateway sends the payment to the second only when your rule says so
  • A refund made through the layer appears in the gateway's test reports
  • Your rule leaves every payment outside its scope on the original gateway

When all six pass, you have evidence for the go-live decision. Keep the test records, because the first live problem usually looks like one of them.

04Rolling back, and what goes wrong

The gateway rejects your test credentials. Often the cause is a mix-up between test and live keys, or a credential issued for a different merchant account. Ask the gateway to confirm the exact environment the keys belong to before you change any code.

Statuses disagree between your orders and the dashboard. Usually a webhook was missed or an in-between status was treated as final. Compare the layer's call logs with your order history for one payment, find the first point they differ, and fix the mapping from step 4.

A rule sends too much to the new gateway. Disable or narrow the rule and traffic returns to the original gateway without a deployment on your side. This is why rules beat code branches, and payment routing rules on currency or country are the easiest to check first.

Reports don't reconcile. Settlement files come per gateway, on the gateway's own schedule, so match them gateway by gateway before you compare totals, and ask finance who signs off each one.

05Where the platform does the step

We do steps 3 to 5 and 8 in the platform. Its single API layer connects several providers, with results in API responses and status updates pushed by webhooks, and all providers appear in one dashboard. A connector that isn't ready yet takes about 14 days, provided the provider supplies valid documentation and a technical contact. Your existing providers can be brought in.

Providers you already use stay in place, and one missing from the ready list becomes a multi PSP integration request.

06FAQ

Can I use multiple payment gateways at the same time?

Yes. Each payment goes to one gateway chosen by a rule, and the others stay idle for that payment unless a decline triggers a retry. Your checkout needs no second integration if the layer sits in between.

How do I add multiple payment gateways to a WooCommerce store?

Install the layer's plugin if it offers one for WooCommerce, then add gateways in the layer, not in the store. If no plugin exists, use its hosted page or API. Ask the vendor which of these it supports for your store version.

How many payment gateways should I offer?

Add one per reason: a market or method the first gateway can't serve, or a fallback. A third gateway without a stated reason mostly adds reconciliation work. Review each one against its original sentence every quarter.

Do I need separate code for each gateway?

Not behind a single API. Your code sends one request format and reads one status model. Provider API changes are handled in the layer, so your developers aren't pulled into each gateway's update cycle.

Next step

Plan the first gateway you add

Tell us which gateway you want next and which market it serves, and we'll check it against the connector list and name what a new one would need from that provider. Contact us about your gateway.

Book a demo

Map your integrations onto one API

We look at the providers you run today and what moving them behind one API would take.