Create collateral OCO order
Create a collateral OCO (one-cancels-the-other) order combining limit and stop-limit via the V4 API.
Authorizations
The public WhiteBIT API key.
Base64-encoded JSON request body.
HMAC-SHA512 signature of the payload, hex-encoded. Computed as hex(HMAC-SHA512(payload, api_secret)).
Body
Order direction. Use buy to open or increase a long position and sell to open or increase a short position.
buy, sell "buy"
Amount of stock currency for both legs of the OCO order. Minimum and step values are market-dependent — query the market info endpoint for constraints.
"0.001"
"{{request}}"
"{{nonce}}"
Custom order identifier. Must be unique and contain only letters, numbers, dashes, dots, or underscores.
"order1987111"
When true, both legs of the OCO order can only reduce or close an existing position — neither leg can increase the position or open a new one. If the order amount exceeds the current position size, the system reduces the order to match — the response returns the adjusted amount. The API returns error code 116 if no open position exists or the order side matches the position direction. See reduce-only.
false
Position direction. Optional at the request layer but functionally required when hedge mode is enabled. See positionSide. Both legs of the OCO inherit the value.
- One-way mode (default account mode): the field is ignored. Orders always use
BOTH, and the response returnspositionSide: "BOTH"on each leg whether the field is sent or omitted. - Hedge mode: the field MUST be
LONGorSHORT. SendingBOTH, omitting the field, or sending a value that does not match the account's mode causes the trade service to reject the order with error code114(Hedge mode position side does not match).
LONG, SHORT, BOTH "LONG"