| Permalink: |
Getting the wallet balance
URL¶
POST https://w3s.webmoney.com/json/V1/GetPurses.ashx
Headers¶
Authorization: Bearer {JWT}— required JWT token. Issued at https://security.webmoney.com/trustlisttokens.aspxContent-Type: application/json; charset=utf-8
Request body (JSON)¶
{
"reqn": 1730486400000,
"wmid": ""
}
Fields¶
| *. Field | *. Type | Description |
|---|---|---|
| reqn | long | Request number (recommended: Unix time in milliseconds) |
| wmid | string | Optional; if specified, must match the slaveWMId from JWT, otherwise 400 |
Notes:
- The WMID is taken from the JWT (
slaveWMId) and is not required in the request body. - The interface is available for participants with a Personal or higher passport and with the
Permission.Balanceright.
Example of a successful response¶
{
"reqn": 1730486400000,
"purses": [
{
"id": 1234567,
"pursename": "Z123456789012",
"amount": 10.25,
"desc": "Primary Z",
"income": true,
"incomestate": 0,
"lastintr": 987654321,
"lastouttr": 123456789
}
],
"retval": 0,
"retdesc": "OK"
}
Notes on response:
lastintr— ID of the last incoming operation (wmtranid).lastouttr— ID of the last outgoing operation.
Error examples¶
401 Unauthorized:
{
"retval": 401,
"retdesc": "Authorization error: <descrПолучение баланса кошелькаiption>"
}
405 Method Not Allowed:
{
"retval": 405,
"retdesc": "Method not allowed. Use POST."
}
400 Bad Request (validation error):
{
"reqn": 1730486400000,
"retval": -3,
"retdesc": "Request processing error: <description>"
}
Possible return codes¶
| *. Code | *. Description |
| 0 | Ok |
| 401 | Authorization error |
| 405 | Method not allowed (only POST) |
| -3 | Request processing error |
| ... | Other codes are described in Interface X9 |