Registry / payments / yookassa

yookassa

JSON →
library3.10.1pypypi✓ verified 84d ago

YooKassa (formerly Yandex.Checkout) Python SDK for payment acceptance via API. Current version 3.10.1, active development with monthly releases.

pip install yookassa
INSTALL
IMPORT
SIG · YOOKASSA
Y
yookassa
paymentspythonv3.10.1
Install
4.3s avg
Import
789ms
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.10.1 · 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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.814s · 36.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.3s · import 0.764s · 37MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Configuration
from yookassa import Configuration
from yookassa.configuration import Configuration
Configuration is a top-level class in yookassa, not a submodule.

Create a payment and get a confirmation URL.

import os from yookassa import Configuration, Payment Configuration.account_id = os.environ.get('YOOKASSA_SHOP_ID', '') Configuration.secret_key = os.environ.get('YOOKASSA_SECRET_KEY', '') payment = Payment.create({ 'amount': {'value': '100.00', 'currency': 'RUB'}, 'confirmation': {'type': 'redirect', 'return_url': 'https://example.com'}, 'capture': True, 'description': 'Test payment' }) print(payment.id)
Debug
Known issues
breakingVersion 3.0.0 changed authentication from YooKassaClient to Configuration.account_id / secret_key
fix
Use Configuration.account_id and Configuration.secret_key instead of YooKassaClient.
affects: <3.0.0
breakingVersion 3.0.0 removed synchronous client; all methods are synchronous but now require explicit Configuration
fix
Update imports and initialization to use Configuration.
affects: <3.0.0
gotchaPayment.id is a string, not an integer. Concatenation without str() will cause TypeError.
fix
Always treat payment.id as string; use str() if needed.
affects: all
gotchaAPI keys must be set before any SDK calls; otherwise AuthenticationError is raised.
fix
Set Configuration.account_id and Configuration.secret_key at the top of your script.
affects: all
Errors
Common errors & fixes
yookassa.exceptions.AuthenticationError: 401 Unauthorized
Missing or incorrect account_id or secret_key in Configuration.
fix
Verify environment variables YOOKASSA_SHOP_ID and YOOKASSA_SECRET_KEY are set correctly.
yookassa.exceptions.BadRequestError: 400 - invalid request
Missing required fields in payment request (e.g., amount or confirmation).
fix
Ensure 'amount' and 'confirmation' dictionaries are provided in the request body.
ModuleNotFoundError: No module named 'yookassa'
Library not installed or installed in wrong environment.
fix
Run 'pip install yookassa' in the correct Python environment.
TypeError: can only concatenate str (not 'Payment') to str
Attempting to concatenate payment object directly with string.
fix
Use f-string or str(payment.id) when printing payment ID.
Upgrade
Version history
3.10.1latest on PyPI · released Apr 22, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
52 hits · last 30 days
node
44
Resources
yookassa — pip install yookassa · libregistry