Skip to content

Decrease credit

CreditOut

Description: Decreases credit on the user's account. Only negative values are accepted for the amount.

Request Parameters

Name Type Required Description
login int Yes User login ID whose credit should be decreased
amount double Yes Negative credit amount
comment string Yes Description or reason for the credit decrease
order int No Optional order ID for this credit 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": -100.0,
  "comment": "Credit correction"
}

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": 1242282,
  "state": 10,
  "login": 123456,
  "cmd": 9,
  "amount": -100.0
}

Errors

Code Description
400 Invalid request payload
401 Credit operation was rejected