MngDeleteCashierTransaction¶
Deletes a Cashier deposit or withdrawal from CRM.
The Cashier record is not physically removed: it receives status 12
(deleted) together with deleted_by and deleted_time, so the audit trail
and the transaction id are kept. Only Cashier transactions are affected; balance
operations entered directly by a dealer have no Cashier record and are deleted
with DeleteBalance.
| Current status | Effect |
|---|---|
3 (credited) deposit, 10 (completed) withdrawal |
The linked balance trade is deleted and its balance effect is rolled back, then the transaction becomes deleted |
4 (credit_failed), 5 (failed), 6 (cancelled) |
The transaction becomes deleted immediately; the balance is not changed |
12 (deleted), 13 (deleting) |
Repeat call: returns the current transaction, a pending deletion is driven to completion |
| Any other status | Rejected with CASHIER_STATUS_NOT_DELETABLE |
Statuses still in progress (created, pending_payment, provider_confirmed,
manual_review, processing_ledger) cannot be deleted because they may still
be credited. refunded and chargeback follow their own reversal flow.
Rollback flow¶
For a credited deposit or a completed withdrawal the command:
- checks the deposit reversal policy (deposits only, see below);
- durably stores the transaction as
13(deleting) withdeleted_by; - submits deletion of the linked balance trade to the trading runtime.
The response normally returns the transaction in status 13. The transaction
becomes 12 and receives deleted_time only after the trade deletion is
committed to the trading database. The balance itself is recalculated by the
trading runtime from the remaining balance operations, so other operations of
the client are not affected. If submission is rejected, the transaction is
restored to its previous status and the error is returned.
The trading runtime may still reject the deletion when it executes it (it
applies the same deposit reversal policy, see
DeleteBalanceSync). In that case the
balance trade stays effective and the transaction returns from 13 to its
previous status (3 or 10) with deleted_by = 0. Re-read the transaction
with MngGetCashierTransaction to see the final
outcome.
A deletion interrupted by a restart is completed by Cashier reconciliation at startup and about every 10 seconds: when the trade no longer exists the transaction is finalized; when the trade is untouched for at least 60 seconds the deletion is submitted again. The balance is never rolled back twice: it is derived from the trades, and only one trade is deleted.
If the balance trade had already been removed earlier outside Cashier, the transaction is marked deleted without another rollback.
Deposit reversal policy¶
Deleting a deposit decreases the balance. The account group's
deposit_reversal_policy (see UpdateGroup) is
checked before anything is changed:
| Value | Behaviour |
|---|---|
0 (default) |
If balance - amount < 0, the request fails with NEGATIVE_BALANCE_FORBIDDEN; nothing changes |
1 |
The deposit is deleted even if the balance becomes negative; margin state is recalculated and may trigger Margin Call or Stop Out |
balance is the account cash balance; floating profit and credit are not
taken into account. Deleting a withdrawal increases the balance and is not
checked.
Provider transactions¶
A transaction created by a payment provider (source = 0) can be deleted only
with confirm_provider: true. Deleting it in the platform does not refund or
reverse anything at the payment provider. A late provider webhook for a deleted
transaction is stored as an ignored provider event (failure_reason =
TRANSACTION_DELETED) and does not change the transaction.
Effects in other parts of the platform¶
| Area | Result |
|---|---|
| Client terminal | GetCashierTransactions never returns statuses 12 and 13, and count excludes them. The balance trade disappears from the trade history |
| Back office | The balance trade disappears from finance history and reports |
| CRM lists | MngGetCashierTransactionsByFilter returns deleted transactions by default; filter by status to hide them |
| Manager statistics | Only credited/completed transactions are counted, so the deleted one is excluded immediately |
| Affiliate cabinet | Deleted transactions are excluded from affiliate transaction lists and first-deposit reports |
| Marketing | The DEPOSIT conversion of a deleted deposit is removed. If FIRST_DEPOSIT referenced it, it is moved to the earliest remaining credited deposit of the customer, or removed when there is none |
| Workflow | Bonuses granted and lifecycle flags set by workflow rules are not rolled back. While the FIRST_DEPOSIT lifecycle flag stays set, the marketing module may restore an empty FIRST_DEPOSIT conversion for the customer |
No module bus or TCP push event is published for the deletion. Open clients see the change after their next request; the balance update itself is pushed by the trading runtime as for any balance trade deletion. The server does not send affiliate postbacks, so nothing is recalled from external systems.
Access¶
| Role | Required permissions |
|---|---|
| Super admin | Allowed |
SESSION_MANAGER, SESSION_ADMIN, SESSION_CRM_MANAGER, SESSION_CRM_ADMIN |
access_crm = 1, del_cashier_transactions = 1 |
The command is available only to CRM managers. The manager record must exist
and be enabled. The transaction must be within the manager's customer/account
scope (brand and desk). Checks run inside the handler, including direct
Moleculer calls. The resolved manager id is stored in deleted_by.
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
id |
int | Yes | Cashier transaction id |
confirm_provider |
bool | No | Must be true to delete a provider transaction (source = 0). Default false |
Request Example¶
{
"command": "MngDeleteCashierTransaction",
"extID": "1",
"data": {
"id": 481,
"confirm_provider": false
}
}
Response¶
Returns transaction with the complete Cashier transaction structure; see
MngGetCashierTransaction.
{
"transaction": {
"id": 481,
"customer_id": 95,
"login": 2000009,
"type": 0,
"provider": "manual",
"method": "bank_transfer",
"provider_config_id": 12,
"provider_payment_id": "",
"amount": 500.0,
"currency": "EUR",
"account_currency": "EUR",
"converted_amount": 500.0,
"conversion_rate": 1.0,
"status": 13,
"failure_reason": "",
"idempotency_key": "dep-481",
"comment": "Bank transfer",
"metadata_json": "{}",
"source": 1,
"approved_by": 12,
"approved_time": 1790580100,
"processed_by": 12,
"processed_time": 1790580101,
"reject_reason": "",
"created_time": 1790580000,
"updated_time": 1790590000,
"attributed_manager_id": 0,
"owner_manager_id": 12,
"deleted_by": 7,
"deleted_time": 0
}
}
After the trade deletion is committed, the same transaction is returned by
MngGetCashierTransaction with "status": 12
and a non-zero deleted_time.
Errors¶
Error responses for an existing transaction also contain transaction with its
current state.
| Code | Error | Description |
|---|---|---|
400 |
INVALID_DATA |
Missing or invalid id or confirm_provider |
403 |
RET_NOT_ENOUGH_RIGHTS |
Caller lacks access_crm, del_cashier_transactions, or transaction scope |
409 |
PROVIDER_CONFIRMATION_REQUIRED |
Provider transaction without confirm_provider: true |
409 |
CASHIER_STATUS_NOT_DELETABLE |
Transaction status cannot be deleted |
409 |
NEGATIVE_BALANCE_FORBIDDEN |
Deleting the deposit would make the balance negative and the group policy is 0 |
404 |
RET_NOT_FOUND |
The trading account or its group of a deposit could not be loaded for the reversal policy check |
500 |
RET_ERR_NOTFOUND |
Transaction does not exist |
500 |
RET_ERR_NOSERVICE |
Trading runtime is not available yet |
500 |
RET_TECH_PROBLEM |
Durable Cashier state could not be written, or the transaction has more than one live balance trade |
400/403/500 |
RET_* |
Trading runtime rejected the trade deletion request; the transaction is restored to its previous status |
Related¶
DeleteBalancerejects balance trades created by Cashier withCASHIER_TRANSACTION_OWNED.MngUpdateCashierTransactioncannot modify transactions in statuses12and13.