Update group balance

POST /user/balance/update


Description

The method allows updating the balance of the specified group by changing it by a given amount. It is used for manual top-ups or deductions from the group’s balance.


Request format

  • HTTP method: POST
  • URL: /user/balance/update
  • Content type: application/json
  • Authorization: required

Query Parameters

ParameterTypeWhere PassedRequiredDescription
tokenstringHeaderUser’s JWT token

Request Body (JSON)

FieldTypeRequiredDescription
groupIdintegerGroup identifier
amountnumberAmount to change the balance (can be negative)

Example Request (cURL)

curl -X POST "https://api.neuro-vision.ru/v1/user/balance/update" 
  -H "Content-Type: application/json" 
  -H "Authorization: Bearer jwt.temporary.token" 
  -d '{
    "groupId": 1,
    "amount": 1000
  }'

Example Answers

Success (200 OK)
{
  "status": "ok"
}
Error (400 Bad Request)
{
  "message": "invalid schema",
  "status": "error"
}
Error (401 Unauthorized)
{
  "message": "access denied",
  "status": "error"
}
Error (404 Not Found)
{
  "message": "item with this id does not found",
  "status": "error"
}