Skip to main content
POST
/
api
/
v4
/
order
/
collateral
/
oco
Create collateral OCO order
curl --request POST \
  --url https://whitebit.com/api/v4/order/collateral/oco \
  --header 'Content-Type: application/json' \
  --header 'X-TXC-APIKEY: <api-key>' \
  --data '
{
  "market": "BTC_USDT",
  "side": "buy",
  "amount": "0.001",
  "price": "40000",
  "activation_price": "41000",
  "stop_limit_price": "42000",
  "clientOrderId": "order1987111",
  "request": "{{request}}",
  "nonce": "{{nonce}}"
}
'
{
  "id": 117703764513,
  "stop_loss": {
    "orderId": 117703764514,
    "clientOrderId": "",
    "market": "BTC_USDT",
    "side": "buy",
    "type": "stop limit",
    "timestamp": 1594605801.49815,
    "dealMoney": "0",
    "dealStock": "0",
    "amount": "2.241379",
    "takerFee": "0.001",
    "makerFee": "0.001",
    "left": "2.241379",
    "dealFee": "0",
    "post_only": false,
    "mtime": 1662478154.941582,
    "price": "19928.79",
    "activation_price": "29928.79",
    "activation_condition": "gte",
    "activated": 0,
    "status": "FILLED",
    "stp": "no",
    "positionSide": "LONG"
  },
  "take_profit": {
    "orderId": 117703764515,
    "clientOrderId": "",
    "market": "BTC_USDT",
    "side": "buy",
    "type": "limit",
    "timestamp": 1662478154.941582,
    "dealMoney": "0",
    "dealStock": "0",
    "amount": "0.635709",
    "takerFee": "0.001",
    "makerFee": "0.001",
    "left": "0.635709",
    "dealFee": "0",
    "post_only": false,
    "mtime": 1662478154.941582,
    "price": "9928.79",
    "status": "FILLED",
    "stp": "no",
    "positionSide": "LONG"
  }
}

Authorizations

X-TXC-APIKEY
string
header
required

API Key authentication for private endpoints.

Required headers:

  • X-TXC-APIKEY: API key
  • X-TXC-PAYLOAD: Base64 encoded JSON payload
  • X-TXC-SIGNATURE: HMAC SHA512 signature

Body

application/json
market
string
required
Example:

"BTC_USDT"

side
enum<string>
required
Available options:
buy,
sell
Example:

"buy"

amount
string
required
Example:

"0.001"

price
string
required
Example:

"40000"

activation_price
string
required
Example:

"41000"

stop_limit_price
string
required
Example:

"42000"

request
string
required
Example:

"{{request}}"

nonce
string
required
Example:

"{{nonce}}"

clientOrderId
string
Example:

"order1987111"

Response

Successful response - OCO order created

id
integer

OCO order identifier

Example:

117703764513

stop_loss
object

Stop loss order details

take_profit
object

Take profit order details