Adyen Python API Library
raw JSON → 15.0.1 verified Thu May 14 auth: no python
The Adyen Python API Library provides a comprehensive client for integrating with Adyen's various APIs, including Checkout, Management, Recurring, and more. It is currently at version 15.0.1 and receives frequent updates, often with minor or patch releases, and occasional major versions that align with Adyen's OpenAPI specification updates.
pip install Adyen Common errors
error ModuleNotFoundError: No module named 'adyen' ↓
cause The 'adyen' module is not installed in the Python environment.
fix
Install the Adyen Python API library using pip: 'pip install Adyen'.
error AttributeError: module 'Adyen' has no attribute 'Client' ↓
cause Incorrect import statement; 'Adyen' is the module, and 'Client' should be accessed as 'Adyen.client.Client'.
fix
Use the correct import: 'from Adyen.client import Client'.
error AdyenAPIAuthenticationError: HTTP Status 403: Not allowed ↓
cause The API key provided lacks the necessary permissions for the requested operation.
fix
Ensure the API key has the required roles assigned in the Adyen Customer Area.
error AdyenAPIResponseError: HTTP Status 422: Required object 'amount' is not provided. ↓
cause The 'amount' field is missing from the API request payload.
fix
Include the 'amount' field in the request payload as per Adyen's API documentation.
error AdyenAPIResponseError: HTTP Status 422: Invalid card number ↓
cause The card number provided in the payment request is invalid or incorrectly formatted.
fix
Verify and correct the card number in the payment request.
Warnings
breaking Version 15.0.0 raised the minimum Python requirement to 3.8. Support for Python 2.7 and 3.6 has been dropped. Integrations on older Python versions must upgrade before migrating to this release. ↓
fix Upgrade your Python environment to 3.8 or higher.
breaking In version 15.0.0, the base URL for the Recurring API changed from `pal-{env}.adyen.com/pal/servlet/Recurring/v68` to `paltokenization-{env}.adyen.com/paltokenization/servlet/Recurring/v68`. Any hard-coded environment-specific URL overrides for `RecurringApi` must be updated. ↓
fix Update any custom `RecurringApi` base URL configurations to use the new `paltokenization` domain and path.
breaking Version 14.0.0 introduced a significant refactoring of the service layer and corrected auto-generated method signatures. This may require adjustments to how API methods are called, particularly if relying on specific method names or structures from prior versions. ↓
fix Review the API Explorer and updated documentation for specific API services and method signatures when upgrading to v14.0.0 or later.
deprecated As of v13.5.0, `AdyenBalanceControlApi`, `AdyenRecurringApi` (prefer `Checkout API recurring endpoints`), and the POS Terminal Management API (prefer `Management API`) methods have been deprecated. ↓
fix Migrate to the recommended `Checkout API` recurring endpoints, `Management API`, or other relevant updated services as per Adyen documentation.
deprecated In version 13.3.0, methods within the `Terminal` service, such as `assign_terminals`, `find_terminal`, `get_stores_under_account`, `get_terminal_details`, and `get_terminals_under_account`, were deprecated. ↓
fix Consult Adyen's documentation for the recommended alternatives for terminal management operations.
gotcha Incorrect API key, environment (`test` vs `live`), or live endpoint prefix (`ADYEN_LIVE_ENDPOINT_PREFIX`) are common causes of authentication or routing errors. For live environments, ensure the correct unique prefix is included in the endpoint configuration. ↓
fix Double-check your API key permissions, the `client.platform` setting, and the `ADYEN_LIVE_ENDPOINT_PREFIX` if operating in a live environment.
Install compatibility last tested: 2026-05-14 v15.0.1 (up to date)
python os / libc status wheel install import disk mem side effects
3.10 alpine (musl) wheel - 0.14s 29.0M 4.8M clean
3.10 alpine (musl) - - 0.16s 29.0M 4.8M -
3.10 slim (glibc) wheel 3.8s 0.11s 29M 4.8M clean
3.10 slim (glibc) - - 0.11s 29M 4.8M -
3.11 alpine (musl) wheel - 0.19s 31.6M 5.3M clean
3.11 alpine (musl) - - 0.25s 31.6M 5.3M -
3.11 slim (glibc) wheel 3.2s 0.18s 31M 5.3M clean
3.11 slim (glibc) - - 0.18s 31M 5.3M -
3.12 alpine (musl) wheel - 0.15s 23.4M 5.2M clean
3.12 alpine (musl) - - 0.23s 23.4M 5.2M -
3.12 slim (glibc) wheel 2.6s 0.16s 23M 5.2M clean
3.12 slim (glibc) - - 0.17s 23M 5.2M -
3.13 alpine (musl) wheel - 0.13s 23.1M 5.1M clean
3.13 alpine (musl) - - 0.16s 23.0M 5.1M -
3.13 slim (glibc) wheel 2.8s 0.13s 23M 5.1M clean
3.13 slim (glibc) - - 0.17s 23M 5.1M -
3.9 alpine (musl) wheel - 0.13s 28.5M 4.8M clean
3.9 alpine (musl) - - 0.15s 28.5M 4.8M -
3.9 slim (glibc) wheel 4.3s 0.13s 28M 4.8M clean
3.9 slim (glibc) - - 0.14s 28M 4.8M -
Imports
- Adyen
import Adyen - AdyenClient
from Adyen import AdyenClient
Quickstart
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}")