Getting started overview

Integrating with Adyen requires a structured approach, beginning with account setup and culminating in your first successful API request. This guide outlines the essential steps to get your development environment configured and process a test payment. Adyen's platform is designed for global payment processing, supporting various payment methods and enabling advanced risk management. The initial setup focuses on obtaining the necessary credentials to authenticate your application's interactions with Adyen's APIs.

Before making live transactions, all development typically occurs within Adyen's test environment. This environment mirrors the production API but uses test card numbers and simulated responses to allow for thorough integration testing without financial implications. Understanding the distinction between test and live environments is crucial for a smooth development process and eventual go-live.

Here's a quick reference for the Adyen getting started process:

Step What to do Where
1. Create Account Sign up for an Adyen test account. Adyen signup page
2. Configure Accounts Set up company and merchant accounts within the Customer Area. Adyen Customer Area
3. Generate API Keys Obtain API Key, Client Key, and HMAC Key. Adyen Customer Area > Developers > API credentials
4. Choose Integration Select an API integration method (e.g., Checkout API, Classic API). Adyen developer documentation
5. Make First Request Send a test payment request using your chosen SDK or direct API call. Your development environment, Adyen API reference

Create an account and get keys

The first step in using Adyen is to create a test account. This account provides access to the Adyen Customer Area, which is the central portal for managing your Adyen integration, configuring settings, and accessing developer tools. The test environment allows you to simulate transactions and test your integration thoroughly before processing live payments.

Account creation

  1. Navigate to the Adyen signup page.
  2. Fill in the required information to create your test account.
  3. Once your test account is created, you will gain access to the Adyen Customer Area.

Configuring company and merchant accounts

Within the Customer Area, Adyen uses a hierarchical account structure: a company account can have multiple merchant accounts. Transactions are processed through merchant accounts. For initial setup, you typically configure at least one merchant account linked to your company account. This involves specifying basic business details and currency preferences, as outlined in the Adyen account getting started documentation.

Generating API keys and credentials

To authenticate your API requests, you will need several key pieces of information from the Adyen Customer Area:

  • API Key: Used for authenticating server-to-server requests to the Adyen API. This key should be kept confidential and never exposed client-side.
  • Client Key: Used for authenticating client-side requests, typically for front-end integrations with Adyen's Web Drop-in or Components.
  • HMAC Key: Used to verify the integrity and authenticity of webhooks sent by Adyen.

To generate these credentials:

  1. Log in to your Adyen Customer Area.
  2. Navigate to Developers > API credentials.
  3. Create a new API credential or select an existing one.
  4. Generate and copy your API Key, Client Key, and HMAC Key. Ensure you store these securely, especially the API Key and HMAC Key. The Adyen API credentials documentation provides detailed steps for this process.

Your first request

To make your first request, you'll typically use Adyen's Checkout API to initiate a payment. This process involves creating a payment session and then submitting payment details. Most developers opt to use one of Adyen's official SDKs (Java, PHP, Python, .NET, Node.js, Ruby) to simplify API interactions.

Example: Processing a test payment with the Checkout API

This example demonstrates a server-side call to the /payments endpoint of the Checkout API, which is a common way to initiate a payment flow. For this example, we'll use a conceptual Python representation, but the logic applies across SDKs.

Prerequisites:

  • Your Adyen API Key and Merchant Account ID.
  • A test card number (e.g., 4242 4242 4242 4242 for Visa, expiration 12/2030, CVC 123) from the Adyen test card numbers documentation.
  • The Adyen Python SDK installed (pip install adyen).

Python code snippet:


from adyen import Adyen

# --- Configuration ---
ADYEN_API_KEY = "YOUR_API_KEY"  # Replace with your actual API Key
ADYEN_MERCHANT_ACCOUNT = "YOUR_MERCHANT_ACCOUNT"  # Replace with your Merchant Account ID

# Initialize Adyen client
adyen = Adyen()
adyen.client.x_api_key = ADYEN_API_KEY
adyen.client.platform = "test"  # Use 'test' for the test environment

def make_payment_request():
    try:
        # Construct the payment request payload
        payment_request = {
            "amount": {
                "currency": "EUR",
                "value": 1000  # Value in minor units (e.g., 10.00 EUR)
            },
            "reference": "your-order-reference-123",
            "paymentMethod": {
                "type": "scheme", # For card payments
                "number": "4242424242424242",
                "expiryMonth": "12",
                "expiryYear": "2030",
                "cvc": "123"
            },
            "returnUrl": "https://your-website.com/redirect", # Required for some payment methods
            "merchantAccount": ADYEN_MERCHANT_ACCOUNT,
            "countryCode": "NL"
        }

        # Make the API call
        response = adyen.checkout.payments(payment_request)

        print(f"Payment response: {response.message}")
        # Expected result: { "resultCode": "Authorised", ... }
        if response.message.get("resultCode") == "Authorised":
            print("Test payment authorized successfully!")
        else:
            print(f"Test payment failed or requires further action: {response.message.get('resultCode')}")

    except Exception as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    make_payment_request()

This code snippet illustrates a direct API call for a card payment. For a full integration, you would typically use Adyen's Drop-in or Components to handle client-side payment data collection securely, reducing your PCI DSS scope. The server-side would then receive a paymentMethod.token or paymentMethod.encryptedCard from the client to process the payment.

Common next steps

After successfully making your first test payment, consider these common next steps to advance your Adyen integration:

  • Explore other payment methods: Adyen supports a wide array of payment methods, including local options, digital wallets, and bank transfers. Integrate additional methods relevant to your target audience.
  • Implement webhooks: Webhooks are crucial for receiving asynchronous updates about payment statuses (e.g., capture, refund, chargeback). Configure and secure your webhook endpoint in the Customer Area, and verify incoming notifications using the HMAC key. The Adyen webhooks documentation provides detailed guidance.
  • Integrate client-side components: For online payments, use Adyen's Web Components (or mobile SDKs for app integrations) to render payment forms and securely collect sensitive payment data. This simplifies PCI DSS compliance.
  • Test fraud prevention: Familiarize yourself with Adyen's Risk Management (RevenueProtect) features. Test different fraud scenarios using specific card numbers or transaction details as documented by Adyen to ensure your rules are effective.
  • Go live readiness: Once your integration is thoroughly tested in the test environment, follow Adyen's go-live checklist. This typically involves applying for a live account, completing necessary KYC (Know Your Customer) checks, and switching your API calls to the live endpoint.

Troubleshooting the first call

Encountering issues during your first API call is common. Here are some troubleshooting tips:

  • Check API Key and Merchant Account: Ensure your API Key is correct and that the Merchant Account ID in your request matches the one associated with your API credentials in the Customer Area. A common error is using a live API key with the test environment, or vice-versa.
  • Verify Endpoint: Confirm you are sending requests to the correct Adyen API endpoint for the test environment (e.g., https://checkout-test.adyen.com/v69/payments).
  • Review Request Payload: Carefully examine your JSON request payload for syntax errors, missing required fields, or incorrect data types. Compare it against the Adyen API reference for the specific endpoint you are calling.
  • Examine Response Codes and Messages: Adyen's API responses provide detailed resultCode and refusalReason fields. These are critical for diagnosing issues. For example, a resultCode of Refused with a refusalReason of CVC_DECLINED indicates a problem with the Card Verification Code.
  • Consult Adyen's Error Codes: Adyen provides comprehensive documentation on API error codes and their meanings. Use this resource to understand specific error messages.
  • Check API Logs in Customer Area: The Adyen Customer Area contains detailed API logs (Developers > API logs) for all requests made to your account. These logs can show the exact request sent, Adyen's processing, and the response, helping you pinpoint discrepancies.
  • Test Card Numbers: Ensure you are using valid Adyen test card numbers for your test transactions. Using real card numbers in the test environment will result in errors.
  • SDK Specific Issues: If using an SDK, ensure it is correctly initialized and that you are using the correct version compatible with your API integration. Refer to the specific SDK documentation for setup and usage.