Python SDK

Install and start using the Python SDK.

Intro

The Adyen APIs SDK provides access to the Adyen APIs REST APIs.

Adyen Checkout API Configure and manage your Adyen company and merchant accounts, stores, and payment terminals.

Authentication

Each request to the Management API must be signed with an API key. Generate your API key in the Customer Area and then set this key to the X-API-Key header value.

To access the live endpoints, you need to generate a new API key in your live Customer Area.

Versioning

Management API handles versioning as part of the endpoint URL. For example, to send a request to this version of the /companies/{companyId}/webhooks endpoint, use:

https://management-test.adyen.com/v3/companies/{companyId}/webhooks

Going live

To access the live endpoints, you need an API key from your live Customer Area. Use this API key to make requests to:

https://management-live.adyen.com/v3

Release notes

Have a look at the release notes to find out what changed in this version!

Installation

Add the SDK to your project from its folder, with whichever package manager your project uses. Give each tool a path containing a slash, such as ../adyen-apis — a bare folder name is looked up on PyPI instead, and resolves to whatever project holds that name there:

Terminal
pip install <path-to-sdk>
Terminal
uv add <path-to-sdk>
Terminal
poetry add <path-to-sdk>

Quick Start

Synchronous client

Construct AdyenApisClient with keyword arguments, and call close() when you are done. Every argument is optional.

Python
from adyen_apis import AdyenApisClient
from adyen_apis.core import BasicAuthCredentials

client = AdyenApisClient(
    api_key_auth="YOUR_API_KEY", basic_auth=BasicAuthCredentials(username="YOUR_USERNAME", password="YOUR_PASSWORD")
)

client.close()

Alternatively, scope it — with AdyenApisClient(...) as client: closes the pool on exit.

Asynchronous client

AsyncAdyenApisClient mirrors AdyenApisClient with identical method names, and every endpoint method is a coroutine. It takes the same arguments, with some differences — for example, the transport argument is custom_async_http_client.

Python
from asyncio import run

from adyen_apis import AsyncAdyenApisClient
from adyen_apis.core import BasicAuthCredentials


async def main() -> None:
    client = AsyncAdyenApisClient(
        api_key_auth="YOUR_API_KEY", basic_auth=BasicAuthCredentials(username="YOUR_USERNAME", password="YOUR_PASSWORD")
    )
    await client.aclose()


run(main())

Alternatively, scope it — async with AsyncAdyenApisClient(...) as client: closes the pool on exit.

On this page