Payment APIs: complete guide to integration & best practices
If you’ve ever tried to add a new provider, launch in a new country, or fix failing payments under pressure, you already know: payments are never ‘just an integration’. Payment APIs, and the way you structure them, can either lock you into one provider or give you the freedom to route, optimise, and scale.
This article gives you a practical tour of payment APIs: what they are, how they work, and how to roll them out in a way that stays flexible over time.
A payment API is an interface that allows businesses to connect their applications to payment processing networks and services. It serves as a bridge between your app or website and external payment services such as gateways, processors, banks, and digital wallets.
Instead of building integrations with card networks, acquirers, and banks yourself (plus maintaining compliance and uptime), you lean on payment providers who expose all of that through APIs you can call in a few lines of code.
Let’s walk through what typically happens during a card transaction:

All of this typically happens in seconds from the user’s perspective. Under the hood, the API orchestrates many moving parts.
API types can be viewed from different angles — interface style, integration pattern, or underlying rails. In this article, we describe them through the most practical lens: how the integration is implemented in real payment stacks.
REST (Representational State Transfer) is the most common merchant-facing API type in modern payment systems. It is HTTP-based, typically uses JSON, and follows a resource-oriented model.
REST APIs are widely used to create and manage payments, handle captures, refunds, and reversals, manage payouts and balances, and access transaction and settlement data.
SOAP (Simple Object Access Protocol) is an older, more rigid API standard widely used in banking and legacy payment systems.
While less popular for new merchant integrations, SOAP is still commonly used for bank integrations, card network and processor connections, and regulated financial environments where strict, contract-based integrations are required.
Importantly, SOAP does not represent different payment logic. It often exposes the same functionality as REST, just through a more formalised interface.
H2H (host-to-host) integrations using ISO 8583 operate at a much lower level of the payment stack. This is not a web API, but a financial messaging protocol used for card authorisations, reversals, clearing and settlement, as well as ATM and POS transactions.
ISO 8583 is the global backbone of card payments, even though it is usually hidden behind higher-level APIs and gateways.
SDKs are developer-friendly wrappers around backend payment APIs with strict scope limitations. They act as abstraction layers that collect sensitive payment data, perform client-side validation and encryption, tokenise payment methods, and simplify frontend and mobile integration.
SDKs rely on backend APIs underneath and exist to improve security, UX, and developer experience — not to introduce new payment flows.
Webhooks are event-driven callbacks designed for asynchronous communication. Instead of requesting data, the payment platform pushes notifications when something happens, such as a payment succeeding or failing, a refund being completed, a chargeback being created, or a payout being processed.
Webhooks are essential for building reliable payment logic because many payment events are asynchronous, delayed, or initiated by external actors (issuers, schemes, banks).
GraphQL is an alternative API paradigm focused on flexible data access. In payments, it’s most commonly used for dashboards and reporting, analytics and monitoring tools, and internal admin interfaces.
GraphQL rarely handles payment execution itself. Instead, it provides efficient access to complex payment data models.
Different integration styles exist for a reason. Which one you choose depends on your team, timelines, and the strategic role of payments in your business.
In a direct server-to-server setup, the merchant’s backend communicates directly with the payment provider’s API over secure channels, typically using REST or SOAP.
How it works: your backend creates and manages payment requests. The payment state is tracked via API responses and webhooks. Key logic — like routing, retries, and reconciliation — is handled server-side.
This model is preferred by larger merchants, platforms, and PSP-like businesses that need bespoke checkout experiences or advanced flows such as subscriptions, split payments, or marketplace settlements.
This model splits responsibilities between the client and the server. SDKs handle sensitive data collection and UX, while the backend API manages payment creation, confirmation, and business logic.
How it works: card or wallet details are collected via the SDK, tokenised on the client side, then sent to your backend. The backend uses the token to complete the payment via API.
This approach is common in e-commerce and mobile apps. It reduces PCI scope, accelerates frontend development, and still gives you backend control over payment flows, order logic, and post-payment actions.
Hosted checkout moves the sensitive parts of the flow to a provider-managed payment page, either through a redirect or an embedded experience such as an iframe.
How it works: you create a checkout session via API. The customer completes payment on the provider’s side. You receive the result via return URL and webhooks.
Teams often choose hosted checkout when speed and compliance simplicity are priorities — such as for MVPs or early-stage products. It offers the fastest go-live path and lowest implementation overhead. The trade-off is reduced flexibility: the checkout flow and experience depend on the provider’s design and availability.
A unified orchestration API creates a single point of integration across multiple payment providers, removing the need to build and maintain separate connections.
How it works: the merchant sends transactions to a single API, while routing, failover, retries, and optimisation rules are managed centrally across providers.
This setup is ideal for businesses using multiple PSPs, expanding globally, or focused on optimising approval rates and uptime. It reduces operational complexity at scale, streamlines provider onboarding, and centralises control over routing and payment logic.
| Integration option | How it works | Best fit for |
|---|---|---|
| Direct server-to-server API | Your backend calls the PSP API and manages payment logic; status via API + webhooks. | Larger merchants/platforms needing deep control and complex flows. |
| Client-side SDK + backend API | SDK captures + tokenises data; backend completes the payment via API. | E-commerce and mobile apps balancing UX, speed, and lower PCI exposure. |
| Hosted checkout (redirect/iframe) | Provider hosts the payment page; you create a session and receive results via return URL + webhooks. | MVPs/smaller teams prioritising fastest time-to-market and simpler compliance. |
| Unified orchestration API | One API layer routes across multiple PSPs with centralised rules (failover/retries/optimisation). | Multi-PSP setups, regional expansion, and teams optimising approvals and uptime. |
The end-to-end payment experience is built from a set of standard building blocks working together. Let’s walk through the core parts you’ll find in most modern payment APIs.

Before a payment system lets you move money, it needs to verify your identity. This happens through:
Why it matters: payments handle sensitive data and real funds. Strong authentication keeps fraudsters out and protects merchants and customers.
This is the main ‘start a payment’ endpoint. Most modern APIs use a payment intent model: you first create an intent, then move it through a series of steps until the payment either succeeds or definitively fails.
A typical payment creation request includes the amount and currency, payment method type, customer or order reference, and capture settings — for example, whether the payment should be captured immediately or authorised now and captured later.
Why it matters: this component defines your checkout flow and how flexible you can be with things like authorisation, delayed capture, or retries.
A payment API needs a safe way to collect, store, and reuse payment instruments. That typically includes cards, digital wallets, bank rails (SEPA, ACH, local transfers), alternative payment methods, and crypto rails.
Most providers solve this by tokenising sensitive details (such as card numbers): they replace sensitive details with secure tokens that your system can use for future charges, refunds, or subscriptions. This keeps raw data off your servers, reduces your PCI scope, and meaningfully improves your overall security posture.
Why it matters: flexible payment method support expands where you can sell and who can pay.
Instead of treating every transaction as a one-off, mature APIs let you create customer profiles.
A customer object usually stores:
Why it matters: customers enable subscriptions, one-click checkout, smarter retries, and cleaner reporting.
Many payments can’t be completed without extra customer steps, especially in regulated regions. Payment APIs support 3D Secure for cards, Strong Customer Authentication (SCA) in Europe, redirects or in-app challenges.
That’s why payments often move into a status like ‘requires_action’, and your app needs to send the user through verification before confirming the final result.
Why it matters: good handling of these flows is critical for conversion and compliance.
Things change: people cancel orders, returns happen, mistakes get made. Payment APIs include endpoints for:
Why it matters: refunds are part of customer trust. If your API makes them hard, support costs climb and UX suffers.
If your product pays money to sellers, partners, or users, payouts become a core module. Payout APIs manage:
Why it matters: payouts are essential for marketplaces, platforms, and PSPs — and they need the same reliability as collections.
Payments don’t always finish instantly. Banks, issuers, and APMs can respond seconds or even hours later. Webhooks notify your system about key events like:
Why it matters: without webhooks, your system would constantly ‘poll’ for updates and still risk missing outcomes.
A payment platform isn’t complete unless you can retrieve what happened. This includes:
Why it matters: clear reporting supports efficient dispute handling and optimisation.
Networks fail, requests time out, and users often refresh pages. That’s why payment APIs use idempotency keys — a simple way to guarantee that if you retry the same request, you don’t create duplicate charges.
Why it matters: it protects both your revenue and your users from accidental double payments.
In more advanced setups — especially when multiple PSPs are involved — payment APIs often include a routing layer. Routing can:
Why it matters: routing boosts resilience and can raise approval rates without changing the customer experience.
Finally, most payment APIs include fraud and compliance touchpoints such as:
Why it matters: risk tooling protects approval rates and reduces losses without blocking good customers.
Choosing a payment API is only half the job. How you implement it has a huge impact on your approval rates, user experience, and how much pain (or peace) your teams live with day to day. Below are the best practices that blend architecture, security, and operations.
Even if you start with a single provider, design as if you’ll add more later.
This gives you flexibility to change providers, add new acquirers, or plug in a payment orchestrator without rewriting your entire stack.
A few non-negotiables:
Payment flows will fail sometimes — banks time out, issuers go down, 3DS pages misbehave. Design for that reality.
This is what allows you to spot issues like a sudden spike in ‘do not honour’ declines or a broken redirect flow.
For many payment APIs, webhooks are where the “truth” of the transaction arrives.
Solid webhook handling keeps your system in sync with the actual state of payments and disputes.
The best integration from a developer’s point of view can still be a poor checkout for customers.
Taking money is only part of the story; you need a clean process for everything that happens after.
Well-implemented lifecycle flows reduce manual work and finance headaches.
Trying to launch every payment method, provider, and country at once is a recipe for delays and complexity.
Each phase should include a feedback loop from data, users, and internal teams.
If your payment setup is simple and you only work with one provider, integrating their payment API is usually straightforward. But as you grow, expand into new markets, and add more PSPs, things get messy fast — you’re suddenly dealing with different APIs, auth schemes, webhook formats, and error codes.
That’s where payment orchestration really pays off. It gives you a single, unified layer to connect all providers, so you integrate once and manage everything centrally instead of rebuilding the same logic for each PSP.
A good orchestration platform standardises authentication, request and response structures, webhook behaviour, error codes, and payment lifecycle events. This can cut integration timelines from months to weeks (or even days) and removes much of the pain of handling fragmented, provider-specific logic.
A payment gateway securely captures and forwards transaction data, while the acquirer/processor handles authorisation and settlement with card schemes and issuing banks. A payment API is the interface your systems use to talk to the gateway/processor.
Choosing the right provider depends on your geography, industry, and growth plans. Key factors to evaluate include:
If you expect to run multiple PSPs, consider a payment orchestrator — it gives you one integration and reduces long-term technical debt.
Most modern payment APIs can support international and multi-currency transactions, but the depth of that support varies. Some simply let you charge in multiple currencies, while others also offer local payment methods, local acquiring routes, better FX handling, and tools to present prices in the customer’s home currency.
When you’re evaluating providers, you should check not just whether they “support” a currency or country on paper, but how they handle settlement, FX costs, and cross-border routing in practice, because those details directly influence your fees and your approval rates.
Performance is a mix of backend architecture and checkout experience. On the technical side, you can reduce latency by using regional endpoints where available, caching static configuration data, avoiding unnecessary round-trips to the API, and leveraging webhooks instead of polling.
On the frontend, a lean, fast-loading checkout with minimal blocking scripts and well-structured forms can significantly improve conversion. If you work with multiple PSPs or acquirers, intelligent routing based on geography, card BIN, or historical performance can also improve both speed and authorisation rates.
The main principle is to keep raw card data away from your systems as much as possible. Using hosted fields, iframes, or provider-hosted payment pages ensures that card numbers are entered directly into the provider’s PCI-certified environment, and tokenisation means that you only ever handle tokens instead of real card details.
From there, you still need to follow PCI DSS requirements appropriate to your integration model, which include access controls, secure network configuration, logging, and regular security scans. A good payment provider or orchestrator will give you clear guidance on how to design your integration to keep your PCI scope as small and manageable as possible.