A payment processing API lets business software create payment requests and retrieve transaction status from a payment service provider. In an invoicing portal, this gives customers the latest payment state without sending staff to a separate dashboard.
Before coding, agree which payment state allows an order to ship or an invoice to be credited. The transaction reference may already exist during checkout, while the customer still has steps to complete.
What is API payment processing?
API payment processing uses an application programming interface to send payment instructions and receive machine-readable responses. Creating a payment session and reading its status are usually separate operations. Each operation specifies the fields your application sends and the responses it needs to handle. The browser’s Payment Request API helps customers choose and share a payment method; this guide covers your application’s connection to the provider, which creates and tracks the payment.
The two systems usually keep different references. Your request might carry an invoice reference and the amount due, while the response supplies the provider’s transaction reference. Saving that reference against the invoice gives staff and software a way to retrieve the same attempt later.
For the broader journey from checkout through settlement, see our guide to the online payment process.
How do requests, responses, and callbacks fit together?
A request acknowledgment often arrives before the payment outcome. Consider a trade supplier that adds a pay button to its invoice portal. The server uses the following sequence to connect the payment attempt to the invoice.
- Create the request. The server checks that the customer is allowed to pay the invoice and reads the amount and currency from billing. It sends the payment request and saves its own attempt reference against the invoice.
- Read the response. In a hosted checkout integration, the provider may return a payment reference and a checkout URL. The portal records the reference and sends the customer to the URL. A successful HTTP response at this stage means the API call succeeded.
- Confirm the transaction server-side. The portal waits for a verified callback or makes an authenticated status query. It matches the transaction to the invoice, then updates the invoice when the provider reports the payment state the business agreed to accept.
Say a customer closes checkout, then reopens the invoice an hour later. The portal reads the payment state held by its server, just as it would after a redirect. If no payment confirmation has reached the server, that invoice still shows as pending.

How do APIs, gateways, and processors differ?
Your application talks to the API. The gateway carries its requests into payment infrastructure, where a card processor exchanges messages such as authorization requests. A payment service provider (PSP) may provide that whole route behind the single API your team integrates.
A missing request field sends you back to the integration code. An issuer decline, even in a valid API response, needs investigation on the payment side. Give support the provider’s request or transaction reference so they can trace the message.
Which operations do payment APIs expose?
A provider may offer payment creation and status queries through one product, with payouts under a separate agreement. Check the operations your application will need before committing to the integration.
| Operation | What the integration must handle |
|---|---|
| One-off collection | Create a payment against an order or invoice and store the provider’s reference. |
| Status lookup | Read an existing transaction and translate its state into a business action. |
| Recurring collection | Keep the consent or mandate reference separate from the record for each charge. |
| Payout | Create and track an outbound transfer under the provider’s payout rules and permissions. |
| Payment initiation | Request a transfer from the payer’s bank account, with the payer’s consent. |
For recurring euro collections by SEPA Direct Debit, the biller first obtains the payer’s mandate. Bluem’s digital SEPA Direct Debit mandates address that authorization. Record each collection separately so a signed mandate cannot mark an invoice paid.
Which payment methods and checkout setups fit your integration?
Compare methods against the checkout your customers will actually use. A provider’s published list gives you a starting point. Ask which methods it enables for your market and integration route, then confirm the response your server receives for each one.
Cards and wallets
A card authorization may be followed by a separate capture. Decide which event your fulfillment code should act on. For card-backed wallets, test a supported device from the wallet handoff through to the payment result saved against the order.
Local payment methods
iDEAL and Wero are account-to-account options. Get your provider’s position on the Dutch migration before designing the checkout choices it will enable for you. Bancontact is a separate Belgian method; test its phone and desktop handoffs on their own.
Hosted or embedded checkout
With hosted checkout, the provider serves the payment page. An embedded flow needs a closer look at who serves each payment field and receives the sensitive data. Try a desktop and a phone, including an app switch, and check that the customer returns to the same order.
Bluem lists iDEAL/Wero and Bancontact for Online Payments. Check method availability with Bluem for your account and channel before putting either option into the checkout design.
How does a payment API help businesses?
Connecting payment references to orders and invoices cuts manual lookups. In an ERP, a confirmed payment can update the matching invoice without asking staff to check a second dashboard. Keep exceptions visible so unmatched payments still reach a person.
“A provider’s online payment software may let you brand checkout while your portal keeps track of the order. Start with the checkou options and payment states your team needs; as volume grows, check that your provider’s limits and your own callback handling can support it.
How do you secure payment API integration?
API authentication identifies the software calling the service. Use the provider’s documented token authentication method over HTTPS, keeping tokens out of logs. For certificate authentication, keep the private key in the backend’s secure key store and use it locally to prove possession. If permissions are configurable, limit the service to the operations it actually uses.
Payer authentication verifies the person taking a payment action. For in-scope electronic payments in the European Economic Area, PSD2 generally requires PSPs to apply Strong Customer Authentication (SCA), subject to exemptions. For a remote payment subject to SCA, the authentication code is tied to its amount and payee.
Passing the bank’s authentication challenge does not guarantee card authorization. The issuer can still decline the charge. Store the result of the payer’s authentication and the issuer’s authorization decision separately so your application can represent that case.
Card data scope. The PCI Security Standards Council explains why outsourcing card processing leaves merchants with PCI responsibilities. A hosted checkout may reduce your scope. Ask your acquirer which validation route applies, with a clear map of anywhere card data could enter, including logs.
How do you connect a payment API to a website or ERP?
For a website, the order record normally supplies the amount. An enterprise resource planning (ERP) system might use an open invoice. Store the provider’s reference alongside the order or invoice so staff can find the transaction.
Website and ERP responsibilities
A plugin can save development time when its session and status handling already fit the shop. Before using it, check the order state it sets after payment and where custom fulfillment begins. With a direct REST integration, your team controls those updates and maintains the code.
One invoice can have several payment attempts. The callback must identify the particular attempt before the integration posts an update to that invoice. Give that posting job to one service; otherwise, both the ERP and the portal could apply the same payment.
Bluem payment processing API example
Bluem documents a real-time REST service with token or certificate authentication. The available message format is XML and/or JSON, depending on the integration. A merchant sends a TransactionRequest and receives a TransactionResponse with the branded checkout link.
Bluem sends a StatusUpdate to the merchant URL and documents a StatusRequest for checking the latest transaction status. Use the Bluem API integration documentation to identify the configuration for your chosen route. Bluem also lists PHP integration and prebuilt plugins for Online Payments.
Tests before production
Bluem names three environments: TEST, ACCEPTANCE, and PRODUCTION. Use separate credentials for the non-live environments to keep test transactions out of production records. Deployment also needs a check of the live callback address.
In acceptance testing, cut the connection just after submitting a payment, then check whether the ERP retained the attempt. Replay a status update as a separate test. There should be one fulfillment action in the order history, even though the update arrived twice.
Go-live check. A successful checkout test tells you little about a receiver hidden behind a firewall. Send it a callback with the production configuration, checking credentials as well. Before launch, assign someone to investigate a backlog of open payment attempts.
How do you handle missing responses, status changes, and refunds?
After a timeout, the merchant still needs to find out whether the provider processed the request. An explicit decline has a known outcome. Record those cases separately: sending a second create request while the first result is unknown risks a duplicate payment.
Safe retries after a timeout
The retry belongs to the same operation, so it needs the key saved before the first call and exactly the same request data. This applies only where the endpoint supports idempotency. Adyen’s API idempotency documentation gives an example of retry signals and backoff; key expiry and scope depend on the endpoint.
If a timeout occurs before a transaction ID arrives, look up the original attempt using a merchant-generated reference, if the provider supports it. Otherwise, send the attempt for investigation before creating another payment. Validation errors need correction; retryable rate limits and temporary errors need the provider’s backoff policy.

Duplicate and out-of-order updates
For a signed webhook, the signature check may depend on the body arriving byte for byte as sent. Follow the provider’s verification instructions. Some callbacks only signal a change; in that case, obtain the payment outcome with an authenticated status request.
Consider a pending event delivered after a paid event. Check their documented order, or fetch the current status, before changing the record. Store event IDs when provided. Save the paid status and a record of the fulfillment job in the same database transaction. Process the job separately, with an order-level safeguard against fulfilling the same order twice.
Refund references and final states
A customer whose checkout has expired needs a new session, but only after the server verifies the expiry. A still-pending payment needs investigation instead. Show the customer an actionable message for the relevant case and keep the provider’s raw codes in support logs.
An accepted refund request can still be waiting for completion. Keep its reference beside the original transaction and leave it outstanding until the provider reports the final result. Partial-refund controls also depend on the chosen route supporting them for that payment method.
What should you verify before choosing a provider?
Ask each shortlisted provider to demonstrate a payment on the method and market your business will launch first. Hand your team a transaction reference from the provider’s tools. They should be able to find the corresponding ERP or order record. Introduce a delay in the status update and check who owns the follow-up.
Price the provider against your expected payment-method mix and refunds. Ask about rate limits, escalation, and whether it publishes a status page and incident history; Bluem publishes both. Then check whether staff can find a transaction in a sample report using the provider reference.
Explore Bluem’s online payment processing API for branded checkout and a backend connection to the system that manages your orders or invoices.
What are the FAQs for payment API implementation?
How do minor units affect the amount you send?
Follow the provider’s currency and amount format for that operation. An API that expects euro cents takes 1099 for €10.99. Multiplying every amount by 100 would give the wrong value for currencies the provider treats as zero-decimal.
Can a webhook payload use a different API version?
Some providers version webhook payloads separately from API requests. Before upgrading a client library, replay fixtures from the configured event version against the upgraded handler. Pay attention to fields your code uses to identify the transaction.
How do you rotate a live API key without dropping requests?
For a planned rotation, first check whether the provider permits old and new keys to overlap. If it does, deploy the new one and verify successful requests before revoking the old one. Handle a suspected leak through the incident procedure, with prompt revocation of the exposed key.
How can you recover events missed during a webhook outage?
Check the provider’s delivery history and replay the missed events if that feature is available. If the provider offers a query for undelivered events, use it to recover the affected time window and check for gaps before closing the incident.
What is the difference between a payment API and a payment gateway?
A payment API is how your software sends requests and reads results. A gateway routes payment details for processing. One provider can bundle both, so ask whether the integration creates checkout sessions, returns transaction status, or does both.



