What we do
Tools
Industries
Department
How we workLet's talk →
Home/Adyen
Adyen

Making Your First Adyen API Call, Then Taking It Live

You've got an Adyen test account and a ticket that says "integrate the API". The payment request itself is rarely what goes wrong. What catches teams out is that test and live are separate Customer Areas with separate keys, live calls go to a URL with your own prefix in it, and an order isn't really paid until a webhook says so.

Where Adyen stops

It unifies how customers pay you, but not what happens to that data next.

Stuck on Adyen? Let's solve it →
What you need before the first request

An API key. In the Customer Area, open or create a web service user, then generate the key under Server settings, Authentication. Copy it straight away: once you leave the page you can't copy it again.

Developers API credentials Generate API key

The right header. Server calls carry the key in x-API-key. The client key, which starts test_ or live_, is a separate public value that Drop-in and Components use in the browser.

The right base URL. Test calls go to https://checkout-test.adyen.com/[version]/[method]. Live calls go to https://[prefix]-checkout-live.adyenpayments.com/checkout/[version]/[method], with the prefix taken from your live Customer Area.

Developers API URLs Prefix

A webhook endpoint. The reply to a payment request isn't the final word on every method. Webhooks carry the outcome, and your server must answer each one with a 2xx status within 10 seconds.

Test credential to real money, in order

  1. 1

    Create the credential in the test Customer Area

    Developers API credentials Create new credential

    Pick Web service user, save the username it gives you, then generate an API key under Server settings. That key goes in your server's environment variables and nowhere near front-end code.

    Watch for: rotation. When you generate a new key, the old one keeps working for 24 hours, so deploy the new one inside that window.

  2. 2

    Add a client key and allowed origins

    Client settings Authentication Client key

    On the same credential, generate the client key and list the domains your checkout runs on. Wildcards like https://*.example.org work. In test, http://localhost is allowed; in live every origin has to be HTTPS.

  3. 3

    Pick a flow and make the call

    For most online checkouts that's one /sessions request from your server. If your server needs to see the payment before it completes, use the Advanced flow instead. The difference is laid out below.

  4. 4

    Register a webhook and its HMAC key

    Developers Webhooks Create new webhook

    Add the standard webhook, point it at your endpoint, and generate an HMAC key under Security. Your code checks each webhook's signature with that key before it trusts the event.

  5. 5

    Do it all again in live

    Live is its own Customer Area at ca-live.adyen.com. Create the credential, API key, client key, allowed origins and webhook there, put the live HMAC key in your config, and switch the base URL to the one with your prefix.

    Watch for: the HMAC key. Test and live use different ones, and the test key left in production config is a classic go-live failure.

Sessions flow or Advanced flow for Adyen Checkout

Sessions flow

One call, the front end does the rest

  • Your server makes a single /sessions request.
  • Adyen sends payment data from its server to your client-side app.
  • Redirects and extra steps such as 3D Secure are handled in the browser or app.
  • Adyen calls it the default and recommends it for most online payments.
Advanced flow

Three calls, your server stays in the loop

  • /paymentMethods, then /payments, then /payments/details when an extra step is needed.
  • Payment data comes back to your server, not just the client.
  • Suits a stock check on the server right before payment, or confirming redirects server-side.
  • More code to write and keep up to date.

Start on Sessions unless your server genuinely has to see or change the payment before it completes. On either flow, let the webhook set the order's final state.

Why an order still shows unpaid after Adyen approved it

The handler does its work before answering

How you'll know: The Customer Area shows your endpoint failing, and events start arriving late or in bursts.

Fix: Adyen waits 10 seconds for a 2xx reply. Miss it and every event for that endpoint goes into a retry queue. Store the event, reply at once, then process it from a queue of your own.

The live HMAC check uses the test key

How you'll know: Signature checks passed all through testing and fail on every live event.

Fix: Generate the HMAC key in the live webhook's Security settings and load it into production config. Keep the two keys in clearly named variables.

The /payments reply is treated as final

How you'll know: Orders paid with redirect or bank methods sit as pending, or get marked paid and later turn out refused.

Fix: Use the response to show the shopper a result, and use the AUTHORISATION webhook to set the order's real status.

Retries create duplicate refunds or emails

How you'll know: The same customer gets two confirmations, or a refund is logged twice.

Fix: Because of the retry queue, one event can reach you more than once. Record each event by its pspReference and event code, and skip any you've already handled.

Live keys pointed at the test URL

How you'll know: Every request fails the minute you swap in live credentials.

Fix: The base URL changes too. Live calls need the prefixed adyenpayments.com address from your live Customer Area.

A retailer selling in stores and online, all in one settlement

A retail brand taking Adyen payments on its website and at its store counters.

Before

Settlements from the shops and the website came through combined.

Finance spent days each period sorting the lines by location and by legal entity before anything could be booked.

After

Each settlement is matched to the right location and entity automatically as it arrives.

Reconciling several channels stopped being a monthly project.

Adyen questions beyond the first API call

What is Adyen?

A payments platform that takes online, in-app and in-person payments through one system and one contract. It's aimed at businesses selling across several countries or channels, and it acts as the acquirer itself rather than passing that part to another bank.

How much does Adyen cost?

Adyen prices per transaction: a fixed processing fee plus a fee for the payment method, with cards charged on interchange++ so the card scheme costs pass through at cost. What you pay depends on your method mix, regions and volume, so take the numbers from Adyen's pricing page or your contract.

What payment methods does Adyen support?

Card networks, wallets such as Apple Pay and Google Pay, bank transfers and a long list of local methods like iDEAL or BLIK, all through the same Checkout API. Which ones a shopper sees depends on your account and the request; our Adyen payment methods page goes through it.

Is Adyen a bank?

It holds a European banking license, which it uses to run its payments business, not to offer current accounts or loans to the public. Think of it as a payment platform that's also a licensed financial institution.

What's Adyen for Platforms?

Adyen's product for marketplaces and platforms that take a payment and split it between sellers, with onboarding and verification for each seller handled through Adyen. The seller side is covered on our Adyen for Platforms page.

Does Adyen integrate with accounting or ERP software?

Adyen produces the reports finance needs, such as the settlement details report, and they can be downloaded or fetched by your own code. Getting those lines into an accounting system or ERP, split the way your company is structured, is integration work. n-frames builds that posting step for businesses on Adyen.

Can I use the same Adyen API key in test and live?

No. Test and live are separate Customer Areas, and each has its own credentials, API keys, client keys and webhook HMAC keys. A test key sent to the live URL is rejected.

Who can build the webhook handling and reporting around our Adyen integration?

n-frames does that work for businesses already taking payments on Adyen: webhook handlers that verify each event and update the order, refund or dispute it belongs to, and the settlement split that posts per store, brand or entity in your books. Your checkout stays as it is.

Let's talk

Tell us the one thing your team does manually that eats up time. We read every message and reply within a day.