account.balance_out.created¶
Direction: server → modules. External Moleculer event name: account.balance_out.created.
Source and occurrence¶
C++ payload: FinanceCreatedRecord (wraps the published TradeCalcRecord). Internal
EventBus name: finance.created. Event code: EV_RECORD_ADD (0).
The event is emitted by CoreApiAdapter::publishTradeEvent when the calculation runtime
reports a balance withdrawal applied to an account (cmd 8, OP_BALANCE_OUT). It is raised on
every path that applies the operation; no workflow rule is involved:
| Source | Who applies the operation |
|---|---|
BalanceOut, BalanceOutSync |
Manager, admin or dealer with set_accounts_balance |
Plugin BalanceOut |
Server plugin |
MngApproveFinanceRequest |
CRM manager approving a finance request with cmd 8; published once the request is executed |
| Cashier | An approved cashier withdrawal, once the balance operation is applied (reason 12, cashier_transaction_id set) |
Nothing is published for:
BalanceInand other finance commands — see the sibling events;- a balance correction —
BalanceOutwith an existingorder; - a withdrawal rejected by the finance policy before it is applied;
MngCreateFinanceRequest— a pending request is not applied;MngDeclineFinanceRequest;- a cashier withdrawal request that is created but not yet approved — that is
cashier.withdrawal.created; DeleteBalance.
This is asynchronous fire-and-forget publication. It does not confirm delivery or processing by a module.
On 2026-10-27 this event was published as internal.withdrawal.created; it was renamed on 2026-10-28
with unchanged fields. sct-mailer and sct-sms move their triggers with the migration
20261028_rename_internal_finance_events; other subscribers must subscribe to the new name.
Sibling events of the same shape: account.balance_in.created, account.credit_in.created.
JSON payload¶
{
"event_id": "3f1c9a7e5b2d4c6f8a0b1c2d3e4f5a6b",
"event_code": 0,
"occurred_at": 1789639050,
"schema_version": 2,
"brand": "ion4",
"order": 500312,
"login": 7777853,
"cmd": 8,
"amount": 100.0,
"comment": "CASHIER_WITHDRAWAL",
"reason": 12,
"cashier_transaction_id": 185
}
Shared shape¶
account.balance_in.created, account.balance_out.created and account.credit_in.created
have the same fields, so one template or handler serves all three:
| Field | Type | Meaning |
|---|---|---|
brand |
string | Brand resolved from the account during formatting; empty if the account lookup fails |
order |
integer | Finance operation order |
login |
integer | Trading account login |
cmd |
integer | 6 balance in, 8 balance out, 7 credit in |
amount |
number | Operation amount in the account currency, always positive; the direction is the event name and cmd |
comment |
string | Operation comment from the stored record; empty if the record is not found |
reason |
integer | Source of the operation (TR_REASON_*), for example 2 dealer, 11 cashier deposit, 12 cashier withdrawal, 17 bonus conversion |
cashier_transaction_id |
integer | Linked cashier transaction; 0 when the operation is not from the cashier or the stored record is not found |
occurred_at is the record's update_time, or its close_time when update_time is
0; a zero source time remains zero. api_data, the gateway fields (gw_order,
gw_source, gw_uuid) and position fields are not published. The event has no customer
identifier, email or name: a consumer resolves them by login.
There is no trade-state filter: an applied finance record is already closed, which is why
trade.add — it takes open records only — does not describe it.
Mailer and SMS triggers¶
A trigger with "event": "account.balance_out.created" fires on every applied balance withdrawal. The mailer resolves the recipient
and the account currency by login, so the template can show amount.
The workflow trigger with the same name starts on the same operation; its provider action
mailer.send_template receives this event in its event block — see
Workflow provider actions. Configure only one
source per email, otherwise the customer receives it twice.
See shared outbound rules for metadata, queue limits and delivery guarantees.