Reopen Trade
MngRestoreTrade¶
Description: Allows a manager to reopen a closed trade order by its order ID.
This method follows the common Trade Request Lifecycle. A successful response means the restore request was accepted into runtime processing.
Warning
This method is available only to manager, admin, and dealer sessions, and only restores closed market trades.
Access Control¶
Requires del_trades for manager/dealer sessions. The target 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 | ID of the closed trade order to restore |
| charge_missed_swaps | bool | No | If true, preserves the existing last_swap_time so missed swaps can be charged on the next rollover. If omitted or false, resets last_swap_time to the restore time so swaps are not charged for the closed period. |
| __access | object | Yes | Access object containing manager, admin, or dealer session information |
Request Example¶
{
"order": 1001234,
"charge_missed_swaps": false,
"__access": {
"type": 3
}
}
Response Semantics¶
If the request is accepted:
- the restore request passed validation
- the order was accepted into runtime processing
- final restore application is resolved asynchronously
- if
charge_missed_swapsis omitted orfalse, the swap checkpoint is reset to the restore time - if
charge_missed_swapsistrue, the previous swap checkpoint is preserved
The response should be treated as an acknowledgment object.
Response Parameters¶
| Name | Type | Description |
|---|---|---|
| accepted | bool | Always true on successful acknowledgment |
| order | int | Order identifier being restored |
| state | int | Accepted request state, typically TS_RESTORE_REQUEST |
Response Example¶
{
"accepted": true,
"order": 1001234,
"state": 13
}
Lifecycle Notes¶
- The immediate response is an acknowledgment, not a final restore report.
- The trade should be tracked by
order. - Final resulting state is resolved later in runtime processing.
- The final restored trade state is expected to become
TS_OPEN_RESTORED. - Swap charging for the period while the trade was closed depends on
charge_missed_swaps.