{"id":23009,"library":"yookassa","title":"YooKassa Python SDK","description":"YooKassa (formerly Yandex.Checkout) Python SDK for payment acceptance via API. Current version 3.10.1, active development with monthly releases.","status":"active","version":"3.10.1","language":"python","source_language":"en","source_url":"https://github.com/yoomoney/yookassa-python-sdk","tags":["payments","yookassa","sdk","api"],"install":[{"cmd":"pip install yookassa","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Configuration is a top-level class in yookassa, not a submodule.","wrong":"from yookassa.configuration import Configuration","symbol":"Configuration","correct":"from yookassa import Configuration"}],"quickstart":{"code":"import os\nfrom yookassa import Configuration, Payment\n\nConfiguration.account_id = os.environ.get('YOOKASSA_SHOP_ID', '')\nConfiguration.secret_key = os.environ.get('YOOKASSA_SECRET_KEY', '')\n\npayment = Payment.create({\n    'amount': {'value': '100.00', 'currency': 'RUB'},\n    'confirmation': {'type': 'redirect', 'return_url': 'https://example.com'},\n    'capture': True,\n    'description': 'Test payment'\n})\nprint(payment.id)","lang":"python","description":"Create a payment and get a confirmation URL."},"warnings":[{"fix":"Use Configuration.account_id and Configuration.secret_key instead of YooKassaClient.","message":"Version 3.0.0 changed authentication from YooKassaClient to Configuration.account_id / secret_key","severity":"breaking","affected_versions":"<3.0.0"},{"fix":"Update imports and initialization to use Configuration.","message":"Version 3.0.0 removed synchronous client; all methods are synchronous but now require explicit Configuration","severity":"breaking","affected_versions":"<3.0.0"},{"fix":"Always treat payment.id as string; use str() if needed.","message":"Payment.id is a string, not an integer. Concatenation without str() will cause TypeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Set Configuration.account_id and Configuration.secret_key at the top of your script.","message":"API keys must be set before any SDK calls; otherwise AuthenticationError is raised.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Verify environment variables YOOKASSA_SHOP_ID and YOOKASSA_SECRET_KEY are set correctly.","cause":"Missing or incorrect account_id or secret_key in Configuration.","error":"yookassa.exceptions.AuthenticationError: 401 Unauthorized"},{"fix":"Ensure 'amount' and 'confirmation' dictionaries are provided in the request body.","cause":"Missing required fields in payment request (e.g., amount or confirmation).","error":"yookassa.exceptions.BadRequestError: 400 - invalid request"},{"fix":"Run 'pip install yookassa' in the correct Python environment.","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'yookassa'"},{"fix":"Use f-string or str(payment.id) when printing payment ID.","cause":"Attempting to concatenate payment object directly with string.","error":"TypeError: can only concatenate str (not 'Payment') to str"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}