Skip to main content
POST
Create collateral OCO order

Authorizations

X-TXC-APIKEY
string
header
required

The public WhiteBIT API key.

X-TXC-PAYLOAD
string
header
required

Base64-encoded JSON request body.

X-TXC-SIGNATURE
string
header
required

HMAC-SHA512 signature of the payload, hex-encoded. Computed as hex(HMAC-SHA512(payload, api_secret)).

Body

application/json
market
string
required

Available margin market. Example: BTC_USDT

Example:

"BTC_USDT"

side
enum<string>
required

Order direction. Use buy to open or increase a long position and sell to open or increase a short position.

Available options:
buy,
sell
Example:

"buy"

amount
string
required

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.

Example:

"0.001"

price
string
required

Limit order price in money currency for the take-profit leg.

Example:

"40000"

activation_price
string
required

Trigger price in money currency for the stop-loss leg. The stop-limit order activates when the market price reaches the specified value.

Example:

"41000"

stop_limit_price
string
required

Execution price in money currency for the stop-loss leg. After activation, the stop-loss leg places a limit order at the specified price.

Example:

"42000"

request
string
required
Example:

"{{request}}"

nonce
string
required
Example:

"{{nonce}}"

client_order_id
string

Custom order identifier. Must be unique and contain only letters, numbers, dashes, dots, or underscores.

Example:

"order1987111"

reduceOnly
boolean
default:false

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.

Example:

false

Response

Successful response - OCO order created

id
integer

OCO order identifier

Example:

117703764513

reduceOnly
boolean

Reduce-only flag

Example:

false

stop_loss
object

Stop loss order details

take_profit
object

Take profit order details