Decrease balance
BalanceOut¶
Description: Subtracts a withdrawal from the user's account balance. Only negative values are accepted for the amount.
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
| login | int | Yes | User login ID from whose balance to withdraw |
| amount | double | Yes | Negative amount to withdraw (e.g., -100.0) |
| comment | string | No | Optional comment (default: "Finance") |
| order | int | No | Optional order ID for this balance operation. If set, the operation updates an existing finance transaction |
| open_time | int | No | Optional open timestamp |
| close_time | int | No | Optional close timestamp |
Request Example¶
{
"login": 123456,
"amount": -250.00,
"comment": "Manual withdrawal"
}
Response Parameters¶
Successful finance commands return the same accepted-command structure as trade commands. In the
raw TCP response envelope, the fields below are returned inside data.
| Name | Type | Description |
|---|---|---|
| accepted | bool | true when the command was accepted for processing |
| order | int | Server-assigned finance transaction order ID |
| state | int | Finance request state. New transactions return TS_FINANCE_OPEN_REQUEST (10); updates return TS_FINANCE_UPDATE_REQUEST (11) |
| login | int | Account login |
| cmd | int | Finance command type |
| amount | double | Operation amount |
Response Example¶
{
"accepted": true,
"order": 1242280,
"state": 10,
"login": 123456,
"cmd": 8,
"amount": -250.0
}
⚠️ If a positive amount is passed, the request will be rejected due to validation rules:
{ "error": "INVALID_DATA", "message": "Amount must be less than to 0" }