Skip to content

DeleteCreditSync

Description: Requests deletion of a credit finance transaction and keeps the TCP request open until the matching final delete or rejection update is broadcast by the trading runtime.

The runtime validates projected credit and margin state before applying the reversal. A runtime rejection is returned through the matching update event rather than being left to time out.

SEO

DeleteCreditSync is the synchronous TCP credit transaction delete method for ScaleTrade manager API integrations. Use this endpoint when a CRM, bonus system, cashier, or backoffice connector must delete a credit finance transaction and receive the final deleted trade payload by order.

Access Control

Requires del_accounts_balance for manager/dealer sessions. The target finance transaction account must also match the manager groups and brand scope loaded from the cached manager record. Token payload is used only for manager id and session type.

Request Parameters

Name Type Required Description
order int Yes Finance transaction order ID

Final Response

On success the response contains only the data object from the matching trade:event.

{
  "extID": "delete-credit-req-1001",
  "status": 200,
  "data": {
    "order": 1242281,
    "state": 6
  }
}

Inspect data.state: TS_DELETED (6) confirms deletion, while TS_CLOSED_NORMAL (3) means the runtime rejected it and the original credit transaction remains effective. The exact rejection code is written to the server finance log.

Event Matching

TCP waits for trade:event with matching data.order and either type = EV_RECORD_DELETE (deleted) or type = EV_RECORD_UPDATE (runtime rejection).

Timeout

The default timeout is 5000 ms. If no matching trade event arrives before timeout, TCP returns status = 504 with SYNC_TIMEOUT.