Getting the wallet balance

URL

POST https://security.webmoney.com/V1/GetPurses.ashx

Headers

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 certificate and with the Permission.Balance right.

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: <description>" 
}

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