API Reference
In development
There is only initial API reference, thats why the provided info may be not full
Apps
App
Class for interacting with Yoomoney APIs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
str
|
Yoomoney application token (can get via Authorizer) |
required |
Attributes:
Name | Type | Description |
---|---|---|
token |
str
|
Yoomoney application token (can get via Authorizer) |
headers |
Dict[str, str]
|
Default headers for API requests |
Example:
import asyncio
from yoowallet import App
from yoowallet.types import AccountInfo
async def main():
app: App = App("TOKEN")
if not await app.connect():
raise ValueError('Token is invalid!')
app_info = await app.account_info()
app_info.debug()
if __name__ == "__main__":
asyncio.run(main())
Source code in yoowallet/core/app.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
|
account_info()
async
Getting account information. Needs at least this scope: ["account-info"]
Returns:
Type | Description |
---|---|
AccountInfo
|
AccountInfo entity |
Source code in yoowallet/core/app.py
connect()
async
Verifying App's token via getting account information
Returns:
Type | Description |
---|---|
bool
|
True if token is valid, False if invalid |
get_by_label(label)
async
Checks whether payment with such label exists
Parameters:
Name | Type | Description | Default |
---|---|---|---|
label |
str
|
Lable of needed operation |
required |
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
Operation details |
Source code in yoowallet/core/app.py
operation_history(type=None, label=None, from_time=None, till_time=None, start_record=None, records=None, details=None)
async
Getting operation history. Needs at least this scope: ["operation-history", "operation-details"]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type |
Optional[List[str]]
|
Operation types (deposition or payment) |
None
|
label |
Optional[str]
|
Filtering value (custom operation id) |
None
|
from_time |
Optional[datetime]
|
Operations from this timestamp |
None
|
till_time |
Optional[datetime]
|
Operations till this timestamp |
None
|
start_record |
Optional[str]
|
Operations from this number |
None
|
records |
Optional[int]
|
Number of history records |
None
|
details |
Optional[bool]
|
Show operation details (True or False) |
None
|
Returns:
Type | Description |
---|---|
OperationHistory
|
OperationHistory entity |
Source code in yoowallet/core/app.py
quickpay(sum, payment_type='AC', label=None, success_url=None)
async
Creating fundraising link
Example:
import asyncio
from yoowallet import App
async def main():
app: App = App("TOKEN")
if not await app.connect():
raise ValueError('Token is invalid!')
# Generating fundraising for 5 RUB
payment = await app.quickpay(5.0)
print(f"QucikPay URL is {payment['url']}")
if __name__ == "__main__":
asyncio.run(main())
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sum |
float
|
Transfer amount (the amount debited from the sender) |
required |
payment_type |
str
|
PC for a payment from a YooMoney wallet, AC for a payment from a bank card |
'AC'
|
label |
str
|
The label that a site or app assigns to a certain transfer |
None
|
success_url |
str
|
URL where the user is redirected after the transfer |
None
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Python dictionary with fields: url and amount_due (the amount, that will be received) |
Source code in yoowallet/core/app.py
App (sync version)
Class for interacting with Yoomoney APIs synchronously.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
str
|
Yoomoney application token (can get via Authorizer) |
required |
Attributes:
Name | Type | Description |
---|---|---|
token |
str
|
Yoomoney application token (can get via Authorizer) |
headers |
Dict[str, str]
|
Default headers for API requests |
Example:
from yoowallet.sync import App
from yoowallet.types import AccountInfo
app: App = App("TOKEN")
if not app.connect():
raise ValueError('Token is invalid!')
app_info = app.account_info()
app_info.debug()
Source code in yoowallet/sync/app.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
account_info()
Getting account information. Needs at least this scope: ["account-info"]
Returns:
Type | Description |
---|---|
AccountInfo
|
AccountInfo entity |
Source code in yoowallet/sync/app.py
connect()
Verifying App's token via getting account information
Returns:
Type | Description |
---|---|
bool
|
True if token is valid, False if invalid |
get_by_label(label)
Checks whether payment with such label exists
Parameters:
Name | Type | Description | Default |
---|---|---|---|
label |
str
|
Lable of needed operation |
required |
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
Operation details |
Source code in yoowallet/sync/app.py
operation_history(type=None, label=None, from_time=None, till_time=None, start_record=None, records=None, details=None)
Getting operation history. Needs at least this scope: ["operation-history", "operation-details"]
Example:
from yoowallet.sync import App
from yoowallet.types import OperationHistory
app: App = App("TOKEN")
if not app.connect():
raise ValueError('Token is invalid!')
app_info = app.operation_history()
app_info.debug()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type |
Optional[List[str]]
|
Operation types (deposition or payment) |
None
|
label |
Optional[str]
|
Filtering value (custom operation id) |
None
|
from_time |
Optional[datetime]
|
Operations from this timestamp |
None
|
till_time |
Optional[datetime]
|
Operations till this timestamp |
None
|
start_record |
Optional[str]
|
Operations from this number |
None
|
records |
Optional[int]
|
Number of history records |
None
|
details |
Optional[bool]
|
Show operation details (True or False) |
None
|
Returns:
Type | Description |
---|---|
OperationHistory
|
OperationHistory entity |
Source code in yoowallet/sync/app.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
quickpay(sum, payment_type='AC', label=None, success_url=None)
Creating fundraising link
Example:
from yoowallet.sync import App
app: App = App("TOKEN")
if not app.connect():
raise ValueError('Token is invalid!')
# Generating fundraising for 5 RUB
payment = app.quickpay(5.0)
print(f"QucikPay URL is {payment['url']}")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sum |
float
|
Transfer amount (the amount debited from the sender) |
required |
payment_type |
str
|
PC for a payment from a YooMoney wallet, AC for a payment from a bank card |
'AC'
|
label |
str
|
The label that a site or app assigns to a certain transfer |
None
|
success_url |
str
|
URL where the user is redirected after the transfer |
None
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Python dictionary with fields: url and amount_due (the amount, that will be received) |
Source code in yoowallet/sync/app.py
Types
Entity
Bases: ABC
Abstract class, which represents the skelet of API response entities (like account info)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctx |
Dict[Any, Any]
|
Dictionary, got from raw response |
required |
Attributes:
Name | Type | Description |
---|---|---|
ctx |
Dict[Any, Any]
|
Dictionary, got from raw response |
required_scope |
List[str]
|
Required permission for dealing with this entity |
Source code in yoowallet/types.py
ctx: Dict[Any, Any]
property
Dictionary from raw request
keys: List[str]
property
Available entity fields. Defining in 'parse' method
required_scope: List[str]
property
Required permissions for dealing with this entity
debug()
AccountInfo
Bases: Entity
Provides interface for account information Args: ctx (Dict[Any, Any]): Dictionary, got using '/api/account-info' request
Attributes:
Name | Type | Description |
---|---|---|
ctx |
Dict[Any, Any]
|
Dictionary, got using '/api/account-info' request |
Source code in yoowallet/types.py
account: str
property
User’s account number
account_status: str
property
The user’s status
account_type: str
property
User’s account type
balance: str
property
User’s account balance
balance_details: Optional[Dict[str, Any]]
property
Detailed information about the balance (by default, this section is omitted)
cards_linked: Optional[List[Dict[str, Any]]]
property
Information about bank cards linked to the account
currency: str
property
User’s account currency code (always 643)
identified: str
property
User’s account identification
OperationHistory
Bases: Entity
Provides interface for operation history Args: ctx (Dict[Any, Any]): Dictionary, got using '/api/operation-history' request
Attributes:
Name | Type | Description |
---|---|---|
ctx |
Dict[Any, Any]
|
Dictionary, got using '/api/operation-history' request |
Source code in yoowallet/types.py
next_record: str
property
The number of the first history record on the next page
operations: Optional[List[Dict[str, Any]]]
property
List of operations