Install & Compatibility
Where this runs
tested against v15.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.148s · 18.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.130s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Adyen
✓ import Adyen
Main library import for the facade client.
AdyenClient
✓ from Adyen import AdyenClient
For explicit client instantiation, though `Adyen.Adyen()` is also common.
This quickstart demonstrates how to initialize the Adyen client, set your API key and merchant account, and make a simple credit card payment request using the `payments_api` service. Replace placeholder values with your actual Adyen credentials and test card details.
import Adyen
import os
# Set your API Key and Merchant Account from environment variables
ADYEN_API_KEY = os.environ.get('ADYEN_API_KEY', 'YOUR_ADYEN_API_KEY')
ADYEN_MERCHANT_ACCOUNT = os.environ.get('ADYEN_MERCHANT_ACCOUNT', 'YOUR_MERCHANT_ACCOUNT')
# Initialize Adyen client
adyen = Adyen.Adyen()
adyen.client.xapikey = ADYEN_API_KEY
adyen.client.platform = 'test' # Use 'live' for production
try:
# Example: Make a test payment request
request = {
"merchantAccount": ADYEN_MERCHANT_ACCOUNT,
"amount": {"currency": "EUR", "value": 1000}, # Value in minor units (e.g., 10 EUR)
"reference": "my-test-payment-ref-123",
"paymentMethod": {"type": "scheme", "number": "4921960000000000", "expiryMonth": "12", "expiryYear": "2030", "cvc": "123"}
}
print("Initiating payment request...")
response = adyen.checkout.payments_api.payments(request)
print("Payment response:", response)
if response.status_code == 200 and response.message.get('resultCode') == 'Authorised':
print("Payment successful!")
else:
print("Payment failed or pending.")
print(f"Result Code: {response.message.get('resultCode')}, Refusal Reason: {response.message.get('refusalReason')}")
except Adyen.exceptions.AdyenError as e:
print(f"Adyen API Error: {e.debug()}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'adyen'
The 'adyen' module is not installed in the Python environment.
fixInstall the Adyen Python API library using pip: 'pip install Adyen'.
AttributeError: module 'Adyen' has no attribute 'Client'
Incorrect import statement; 'Adyen' is the module, and 'Client' should be accessed as 'Adyen.client.Client'.
fixUse the correct import: 'from Adyen.client import Client'.
AdyenAPIAuthenticationError: HTTP Status 403: Not allowed
The API key provided lacks the necessary permissions for the requested operation.
fixEnsure the API key has the required roles assigned in the Adyen Customer Area.
AdyenAPIResponseError: HTTP Status 422: Required object 'amount' is not provided.
The 'amount' field is missing from the API request payload.
fixInclude the 'amount' field in the request payload as per Adyen's API documentation.
AdyenAPIResponseError: HTTP Status 422: Invalid card number
The card number provided in the payment request is invalid or incorrectly formatted.
fixVerify and correct the card number in the payment request.
Upgrade
Version history
15.0.2latest on PyPI · released Jun 1, 2026
Audit
Dependencies
PythonrequiredRequires Python 3.8 or higher.
requestsoptionalOptional HTTP client; the library can use 'requests' or 'pycurl'.
pycurloptionalOptional HTTP client; the library can use 'requests' or 'pycurl'.