v1
latestOpenAPI 3.0.32026-07-2613529376.3 KBCollateral Trading
Create collateral OCO order
The endpoint creates a collateral OCO (one-cancels-the-other) order using collateral balance. An OCO order combines a limit order (take-profit leg) and a stop-limit order (stop-loss leg) into a single conditional group. When one leg executes, the system cancels the other automatically.
<Warning> Rate limit: 10000 requests/10 sec. </Warning> <Accordion title="Error Codes"> - `30` - default validation error code. Also returned when `reduceOnly=true` is combined with `stopLoss` or `takeProfit` - `31` - market validation failed - `32` - amount validation failed - `33` - price validation failed - `36` - clientOrderId validation failed - `10` - insufficient balance to place the order - `111` - resulting position would exceed the market maximum - `112` - pending orders value would exceed the allowed maximum - `113` - position side cannot be changed while open positions or orders exist - `114` - hedge mode position side does not match (sent `BOTH` or omitted `positionSide` in hedge mode, or sent `LONG`/`SHORT` in one-way mode) - `115` - order would open a position in the opposite direction (one-way mode) - `116` - reduce-only validation failed (no position exists or order side matches position direction) </Accordion>post/api/v4/order/collateral/oco
Request body
Example request
{
"market": "BTC_USDT",
"side": "buy",
"amount": "0.001",
"price": "40000",
"activation_price": "41000",
"stop_limit_price": "42000",
"clientOrderId": "order1987111",
"positionSide": "LONG",
"stp": "no",
"request": "{{request}}",
"nonce": 1594297865000
}Response
Successful response - OCO order created
Example response
{
"id": 117703764513,
"stop_loss": {
"orderId": 117703764514,
"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",
"mtime": 1662478154.941582,
"price": "19928.79",
"activation_price": "29928.79",
"activation_condition": "gte",
"status": "FILLED",
"stp": "no",
"positionSide": "LONG"
},
"take_profit": {
"orderId": 117703764515,
"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",
"mtime": 1662478154.941582,
"price": "9928.79",
"status": "FILLED",
"stp": "no",
"positionSide": "LONG"
}
}