Yellow BoxTrading APIv1 · pre-release

Trade

DELETEClose all open positions (TRADE)

API Description

Closes every open position on the account, optionally filtered to one symbol. Pending orders are not cancelled — use DELETE /v1/order for those.

HTTP Request

HTTP
DELETE /v1/allOpenPositions

Request Weight

5 (1 against ORDERS, regardless of how many positions close)

Request Parameters

Name Type Mandatory Description
login LONG YES
symbol STRING NO Close only this symbol's positions. Exact, case-sensitive.
newClientOrderId STRING NO Idempotency key for the whole sweep.
recvWindow, timestamp, signature

The sweep snapshots the open positions at the moment it runs and closes those. A position opened after the snapshot is not closed. It is not a "keep the account flat" mode.

Response Example

Response — one entry per position it attempted to close.

JSON
{
  "login": 100123,
  "clientOrderId": "bot-flatten-1",
  "requested": 2,
  "status": "ACCEPTED",
  "transactTime": 1789012700100,
  "positions": [
    {"positionId": 44412345, "symbol": "XAUUSD", "volume": "0.10", "status": "ACCEPTED"},
    {"positionId": 44412360, "symbol": "BTCUSD", "volume": "0.05", "status": "ACCEPTED"}
  ]
}
Field Type Description
requested INT Positions found in the snapshot. 0 with an empty positions array when the account is already flat — this is a success, not an error.
status ENUM ACCEPTED once every close is queued. Per-position outcomes arrive on the user data stream.
positions[].status ENUM Per-position status, same values as a single close.