Skip to main content
POST
/
api
/
v4
/
order
/
collateral
/
limit
Collateral Limit Order
curl --request POST \
  --url https://whitebit.com/api/v4/order/collateral/limit \
  --header 'Content-Type: application/json' \
  --header 'X-TXC-APIKEY: <api-key>' \
  --data '
{
  "market": "BTC_USDT",
  "side": "buy",
  "amount": "0.01",
  "price": "40000",
  "postOnly": false,
  "ioc": false,
  "clientOrderId": "order1987111",
  "stopLoss": "50000",
  "takeProfit": "30000",
  "positionSide": "LONG",
  "rpi": true,
  "request": "{{request}}",
  "nonce": "{{nonce}}"
}
'
{
  "orderId": 4180284841,
  "clientOrderId": "order1987111",
  "market": "BTC_USDT",
  "side": "buy",
  "type": "limit",
  "timestamp": 1595792396.165973,
  "dealMoney": "0",
  "dealStock": "0",
  "amount": "0.01",
  "left": "0.001",
  "dealFee": "0",
  "price": "40000",
  "postOnly": false,
  "ioc": false,
  "status": "FILLED",
  "stp": "no",
  "oto": {
    "otoId": 29457221,
    "stopLoss": "30000",
    "takeProfit": "50000"
  },
  "positionSide": "LONG",
  "rpi": true
}

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

Available margin market. Example: BTC_USDT

Example:

"BTC_USDT"

side
enum<string>
required

Order type. Variables: 'buy' / 'sell'. For open long position use buy, for short sell.

Available options:
buy,
sell
Example:

"buy"

amount
string
required

Amount of stock currency to buy or sell.

Example:

"0.01"

price
string
required

Price in money currency. Example: '9800'

Example:

"40000"

request
string
required
Example:

"{{request}}"

nonce
string
required
Example:

"{{nonce}}"

clientOrderId
string

Identifier should be unique and contain letters, dashes, numbers, dots or underscores.

Example:

"order1987111"

stopLoss
string

Stop loss price.

When provided, the system creates an OTO order with a stop loss condition.

Example:

"50000"

takeProfit
string

Take profit price.

When provided, the system creates an OTO order with a take profit condition.

Example:

"30000"

postOnly
boolean

Orders are guaranteed to be the maker order when executed.

Example:

false

ioc
boolean

An immediate or cancel order (IOC) is an order that attempts to execute all or part immediately and then cancels any unfilled portion.

Example:

false

rpi
boolean

Enables Retail Price Improvement (RPI) mode.

RPI orders are post-only by design and cannot be used with ioc=true. The API returns error code 37 when both rpi=true and ioc=true are used.

Example:

true

positionSide
enum<string>

Defines the position direction when hedge mode is enabled. See positionSide

Available options:
LONG,
SHORT,
BOTH
Example:

"LONG"

Response

Successful response - order created

orderId
integer

Unique order identifier

Example:

4180284841

clientOrderId
string

Custom client order identifier. Empty string if not specified

Example:

"order1987111"

market
string

Market name

Example:

"BTC_USDT"

side
enum<string>

Order side

Available options:
buy,
sell
Example:

"buy"

type
string

Order type

Example:

"limit"

timestamp
number

Timestamp of order creation in Unix format

Example:

1595792396.165973

dealMoney
string

Amount in money currency that is finished

Example:

"0"

dealStock
string

Amount in stock currency that is finished

Example:

"0"

amount
string

Order amount

Example:

"0.01"

left
string

Remaining amount that must be finished

Example:

"0.001"

dealFee
string

Fee in money that is paid when order is finished

Example:

"0"

price
string

Order price

Example:

"40000"

postOnly
boolean

Post-only flag

Example:

false

ioc
boolean

Immediate or cancel flag

Example:

false

status
enum<string>

Order status

Available options:
NEW,
FILLED,
PARTIALLY_FILLED,
CANCELLED
Example:

"FILLED"

stp
string

Self trade prevention mode

Example:

"no"

oto
object

OTO order data when stopLoss or takeProfit is specified

positionSide
enum<string>

Position side

Available options:
LONG,
SHORT,
BOTH
Example:

"LONG"

rpi
boolean

Retail Price Improvement flag

Example:

true