Skip to content

Add credit

CreditIn

Description: Adds a credit entry to the user's account. Only positive values are accepted. This operation does not affect the actual balance, but is used for credit tracking.

Request Parameters

Name Type Required Description
login int Yes User login ID to assign credit
amount double Yes Credit amount to add (must be >= 0)
comment string Yes Description or reason for the credit
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": 300.00,
  "comment": "Credit for promotion"
}

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": 1242281,
  "state": 10,
  "login": 123456,
  "cmd": 7,
  "amount": 300.0
}

⚠️ If a negative amount is provided, the operation will be rejected:

{
  "error": "INVALID_DATA",
  "message": "Amount must be greater than or equal to 0"
}