Adyen
Official Python API library for Adyen payment processing. Auto-generated from OpenAPI spec. PyPI package name is 'Adyen' (capital A). Uses X-API-Key auth, not OAuth. Each major version pins updated API versions and may contain breaking changes from codegen corrections.
Warnings
- breaking v13.0 introduced a codegen fix: service methods that previously duplicated required path parameters as separate unused method arguments were corrected. Code that was passing those extra args (e.g. method(entity_id, entity_id, request)) now receives TypeError for unexpected arguments.
- breaking POS Terminal Management API deprecated. All terminal fleet management must migrate to the Management API. Calls to terminal management endpoints via the old API return deprecation errors.
- gotcha Package name is 'Adyen' (capital A). pip install adyen (lowercase) installs a different, unrelated package. import adyen fails with ModuleNotFoundError.
- gotcha All payment amounts are in minor currency units. 1000 = $10.00 USD, £10.00 GBP, €10.00 EUR. Passing major units (e.g. value: 10) results in processing 10 cents/pence.
- gotcha adyen.client.platform must be set to 'test' or 'live'. Default is 'test'. Forgetting to set 'live' in production sends requests to the test environment, resulting in no real charges.
- gotcha Live environment endpoints require a live URL prefix specific to your account (e.g. {YOUR-UNIQUE-LIVE-PREFIX}-checkout-live.adyenpayments.com). The SDK default live URL will fail for checkout endpoints without this prefix.
Install
-
pip install Adyen
Imports
- Adyen
import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = 'YOUR_X_API_KEY' adyen.client.platform = 'test' # or 'live'
- Service-specific client
from Adyen import checkout checkout.client.xapikey = 'YOUR_X_API_KEY' checkout.client.platform = 'test'
Quickstart
import Adyen
adyen = Adyen.Adyen()
adyen.client.xapikey = 'YOUR_X_API_KEY'
adyen.client.platform = 'test' # change to 'live' for production
request = {
'merchantAccount': 'YOUR_MERCHANT_ACCOUNT',
'amount': {'currency': 'USD', 'value': 1000}, # value in minor units (cents)
'reference': 'order-12345',
'paymentMethod': {
'type': 'scheme',
'encryptedCardNumber': 'test_4111111111111111',
'encryptedExpiryMonth': 'test_03',
'encryptedExpiryYear': 'test_2030',
'encryptedSecurityCode': 'test_737'
},
'returnUrl': 'https://your-company.com/checkout/return'
}
result = adyen.checkout.payments_api.payments(request)
print(result.message)