docs/integrations/payments/adyen.mdx
Adyen is a global payment platform that enables businesses to accept payments across multiple channels and markets. It supports a wide range of payment methods, provides advanced fraud protection, and offers seamless checkout experiences for customers worldwide.
Before you can enable Adyen, it must be installed. To do so, you need to run the following command:
bundle add spree_adyen --github spree/spree_adyen && bundle exec rails g spree_adyen:install
After that, you need to make sure to restart the server.
Sign in to your Spree admin dashboard and navigate to Settings → Payments.
Find Adyen under Available Payment Methods and click Add.
This will redirect you to the Adyen setup form.
You only need to provide the API Key, Client Key, and (for live payments) Live URL Prefix to get started. Spree automatically populates the Merchant Account, Hmac Key, and Webhook fields after you create the payment method.
<Warning>Don't enter values into the Merchant Account, Hmac Key, or Webhook fields manually. Spree fills these in automatically after creation — entering values yourself can block the auto-population process.</Warning>
The following steps walk through generating the credentials you need from inside the Adyen Customer Area.
Log into the Adyen Customer Area and select the merchant account you're configuring. A company account can contain multiple merchant accounts — if so, pick the one tied to the store you're setting up.
All subsequent steps (generating API credentials, retrieving the Live URL Prefix) happen inside this merchant account.
Inside the merchant account you selected, Adyen groups your Client Key and API Key under a single "API credential" record.
https://your-store.com). Without this, the Drop-in checkout component won't load on your storefront.<Warning>Copy your API Key and Client Key as soon as they're generated and store them somewhere safe. Adyen displays the API Key only once — if you navigate away without copying it, you'll need to generate a new credential. The process is quick, but it's an avoidable annoyance.</Warning>
If you're configuring Adyen for live (non-test) payments, you'll need your unique API URL prefix. In the Adyen Customer Area, navigate to Developers → API URLs and copy the value under Prefix.
This field is not needed for test mode.
Back in the Spree admin form, paste each value into its matching field:
Leave the Merchant Account, Hmac Key, and Webhook fields blank — Spree populates them automatically once the payment method is created.
Tick Test Mode if you're using test credentials, then click Create to enable Adyen as a payment method on your store.
For the Adyen Drop-in SDK to initialize on the Next.js storefront, set the following environment variables in your storefront's hosting platform or .env file:
NEXT_PUBLIC_ADYEN_CLIENT_KEY — Your Adyen Client Key (test or live, matching the environment you're running). This is the same value you pasted into the Spree admin.NEXT_PUBLIC_ADYEN_ENVIRONMENT — Either test or live. Determines which Adyen environment the Drop-in SDK connects to. Defaults to test if unset.The NEXT_PUBLIC_ prefix makes the variables available to client-side code so the Adyen JS SDK can initialize in the browser. The Client Key is safe to expose publicly.
<Note>If NEXT_PUBLIC_ADYEN_CLIENT_KEY isn't set, the Adyen payment option won't render on the storefront even if Adyen is configured in the Spree admin.</Note>
You can optionally configure the following settings for your Adyen payment method:
If you'd like to test your checkout flow without processing real payments, Adyen's test environment is a safe and effective way to simulate transactions. To enable it:
See Testing Adyen payments below for a walkthrough of simulating transactions with Adyen's test card numbers.
Once Test Mode is set up, you can simulate real payments using Adyen's published test card numbers.
At checkout on your Spree store, Adyen's Drop-in component will present payment options. Use one of Adyen's official test card numbers to simulate:
4111 1111 1111 1111For CVC and expiry, any valid-format values work (e.g. 737 CVC, a future expiry date).
To see transactions from Adyen's side, log in to the Adyen Customer Area with Test selected in the environment switcher. Navigate to Transactions → All transactions to view captures, authorizations, refunds, and webhook delivery attempts.
Spree's native Adyen integration supports a comprehensive range of features and payment methods to help you offer a fast, secure, and flexible checkout experience:
Spree's Adyen integration enhances the customer experience with dynamic, context-aware payment options across the storefront:
Feel free to reach out to learn more.