Skip to main content

YooKassa API Python Client Library

Build Status Latest Stable Version Total Downloads License

Russian | English

This product is used for managing payments under The YooKassa API For usage by those who implemented YooKassa using the API method.

Features

  • Version 3.x supports Python >=3.7. To work on earlier versions of Python, use versions of yookassa 2.x
  • Changing the directory/file structure affected some package imports. When switching from the version of yookassa 2.x, check the imports in your project:
    • yookassa.domain.models.airline → yookassa.domain.models.payment_data.request.airline
    • yookassa.domain.models.authorization_details → yookassa.domain.models.payment_data.response.authorization_details
    • yookassa.domain.models.receipt_customer → yookassa.domain.models.receipt_data.receipt_customer
    • yookassa.domain.models.receipt_item → yookassa.domain.models.receipt_data.receipt_item
    • yookassa.domain.models.receipt_item_supplier → yookassa.domain.models.receipt_data.receipt_item_supplier
    • yookassa.domain.models.recipient → yookassa.domain.models.payment_data.recipient
    • yookassa.domain.models.refund_source → yookassa.domain.models.refund_data.refund_source
  • Settings.get_account_settings() now returns the Me object. To support compatibility, object fields can be accessed as an array - me.account_id = me['account_id']
  • The me.fiscalization_enabled field is deprecated, but it is still supported. The me.fiscalization object has been added instead..

Requirements

  1. Python >=3.7
  2. pip

Installation

Under console using pip

  1. Install pip.
  2. In the console, run the following command:
pip install --upgrade yookassa

Under console using easy_install

  1. Install easy_install.
  2. In the console, run the following command:
easy_install --upgrade yookassa

Commencing work

  1. Import module
import yookassa
  1. Configure a Client
from yookassa import Configuration

Configuration.configure('<Account Id>', '<Secret Key>')

or

from yookassa import Configuration

Configuration.account_id = '<Account Id>'
Configuration.secret_key = '<Secret Key>'

or via oauth

from yookassa import Configuration

Configuration.configure_auth_token('<Oauth Token>')

If you agree to participate in the development of the SDK, you can submit data about your framework, cms or module:

from yookassa import Configuration
from yookassa.domain.common.user_agent import Version

Configuration.configure('<Account Id>', '<Secret Key>')
Configuration.configure_user_agent(
    framework=Version('Django', '2.2.3'),
    cms=Version('Wagtail', '2.6.2'),
    module=Version('Y.CMS', '0.0.1')
)
  1. Call the required API method. More details in our documentation for the YooKassa API

Metadata

Release files for yookassa 3.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yookassa 3.13.0
File Size Uploaded
yookassa-3.13.0.tar.gz 148.8 kB Details

Release files / yookassa-3.13.0.tar.gz

Download URL yookassa-3.13.0.tar.gz
Size 148.8 kB
Tags Source
SHA-256 checksum
How to use checksums
03c3eafe8b8a652aec71f85e81627b2c633b1b07f177ec4bbc18a4fc6f1ee5fb
BLAKE2b-256 checksum
How to use checksums
917cbfd9cc8d1d5276100fd400e42a9d02ae752056ab3eeceda76a3f606f62cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

3.13.0 This release

1 release file

3.12.1

1 release file

3.12.0

1 release file

3.11.0

1 release file

3.10.1

1 release file

3.10.0

1 release file

3.9.0

1 release file

3.8.0

1 release file

3.7.1

1 release file

3.7.0

1 release file

3.6.0

1 release file

3.5.0

1 release file

3.4.3

1 release file

3.4.2

1 release file

3.4.1

1 release file

3.4.0

1 release file

3.3.0

1 release file

3.2.0

1 release file

3.1.0

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.5.0

1 release file

2.4.0

1 release file

2.3.6

1 release file

2.3.5

1 release file

2.3.4

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.3

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.5

1 release file

2.1.4

1 release file

2.1.3

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.1

1 release file

2.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page