Wrapper¶
- class aioyookassa.YooKassa(api_key: str, shop_id: int | str, timeout: ClientTimeout | None = None, connector: TCPConnector | None = None, proxy: str | None = None, enable_logging: bool = False, logger: Logger | None = None)[source]¶
Bases:
BaseAPIClientYooKassa API Client.
Main client for interacting with YooKassa payment system. Provides access to all available API modules: - payments: Payment operations - payment_methods: Payment method management - invoices: Invoice operations - refunds: Refund operations - receipts: Fiscal receipt operations - payouts: Payout operations - self_employed: Self-employed operations - sbp_banks: SBP participant banks operations - personal_data: Personal data operations - deals: Safe Deal operations - webhooks: Webhook operations (requires OAuth token)
Initialize Base API Client.
- Parameters:
api_key – YooKassa API key
shop_id – YooKassa shop ID
timeout – Custom timeout configuration. Defaults to 30s total, 5s connect, 25s read.
connector – Custom TCP connector. Defaults to optimized connection pooling.
proxy – Proxy URL (e.g., “http://proxy.example.com:8080”)
enable_logging – Enable request/response logging
logger – Custom logger instance. If not provided, uses default logger.
- __init__(api_key: str, shop_id: int | str, timeout: ClientTimeout | None = None, connector: TCPConnector | None = None, proxy: str | None = None, enable_logging: bool = False, logger: Logger | None = None)[source]¶
Initialize Base API Client.
- Parameters:
api_key – YooKassa API key
shop_id – YooKassa shop ID
timeout – Custom timeout configuration. Defaults to 30s total, 5s connect, 25s read.
connector – Custom TCP connector. Defaults to optimized connection pooling.
proxy – Proxy URL (e.g., “http://proxy.example.com:8080”)
enable_logging – Enable request/response logging
logger – Custom logger instance. If not provided, uses default logger.
- async get_me(on_behalf_of: str | None = None) Settings[source]¶
Get shop or gateway settings information.
- Parameters:
on_behalf_of (Optional[str]) – Shop ID for Split payments. Only for those who use Split payments.
- Returns:
Settings object with shop or gateway information.
- Return type:
Settings
- Seealso: