Skip to main content
POST
/
api
/
v4
/
order
/
market
Create market order
curl --request POST \
  --url https://whitebit.com/api/v4/order/market \
  --header 'Content-Type: application/json' \
  --header 'X-TXC-APIKEY: <api-key>' \
  --header 'X-TXC-PAYLOAD: <api-key>' \
  --header 'X-TXC-SIGNATURE: <api-key>' \
  --data '
{
  "market": "BTC_USDT",
  "side": "buy",
  "amount": "100",
  "request": "{{request}}",
  "nonce": "{{nonce}}",
  "client_order_id": "order1987111",
  "stp": "no"
}
'
{
  "order_id": 4180284841,
  "client_order_id": "order1987111",
  "market": "BTC_USDT",
  "side": "buy",
  "type": "limit",
  "timestamp": 1595792396.165973,
  "deal_money": "0",
  "deal_stock": "0",
  "amount": "0.01",
  "left": "0.001",
  "deal_fee": "0",
  "price": "40000",
  "postOnly": false,
  "ioc": false,
  "status": "FILLED",
  "stp": "no",
  "positionSide": "LONG",
  "rpi": true,
  "activated": 0,
  "activationCondition": "lte",
  "activation_price": "40000"
}

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 market. Example: BTC_USDT

Example:

"BTC_USDT"

side
enum<string>
required

Order type. Variables: 'buy' / 'sell' Example: 'buy'

Available options:
buy,
sell
Example:

"buy"

amount
string
required

Amount of money currency to buy or amount in stock currency to sell. Example: '5 USDT' for buy (min total) and '0.001 BTC' for sell (min amount).

Example:

"100"

request
string
required
Example:

"{{request}}"

nonce
string
required
Example:

"{{nonce}}"

client_order_id
string

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

Example:

"order1987111"

stp
enum<string>

Self trade prevention mode. Variables: 'no' / 'cancel_both' / 'cancel_new' / 'cancel_old'. Example: 'no'.

Available options:
no,
cancel_both,
cancel_new,
cancel_old
Example:

"no"

Response

Order created successfully

order_id
integer

Order ID

Example:

4180284841

client_order_id
string

Custom client order ID; empty string if not specified

Example:

"order1987111"

market
string

Deal market

Example:

"BTC_USDT"

side
string

Order side

Example:

"buy"

type
string

Order type

Example:

"limit"

timestamp
number

Timestamp of order creation

Example:

1595792396.165973

deal_money
string

If order finished - amount in money currency that is finished

Example:

"0"

deal_stock
string

If order finished - amount in stock currency that is finished

Example:

"0"

amount
string

Amount

Example:

"0.01"

left
string

If order not finished - rest of the amount that must be finished

Example:

"0.001"

deal_fee
string

Fee in money currency when order is filled

Example:

"0"

price
string

Price

Example:

"40000"

postOnly
boolean

PostOnly flag

Example:

false

ioc
boolean

IOC flag

Example:

false

status
string

Order status

Example:

"FILLED"

stp
string

Self trade prevention mode

Example:

"no"

positionSide
string

Position side (for collateral orders)

Example:

"LONG"

rpi
boolean

Indicates Retail Price Improvement (RPI) mode for the order.

Example:

true

activated
integer

Activation status of the stop order. 0 = not yet triggered (waiting for the activation_price condition to be met). 1 = triggered (the stop condition has been met and the order is now active).

Example:

0

activationCondition
enum<string>

Condition that triggers the stop order. "lte" = activate when the market price falls to or below activation_price. "gte" = activate when the market price rises to or above activation_price.

Available options:
lte,
gte
Example:

"lte"

activation_price
string

The trigger price for the stop order. Always equals the activation_price value submitted in the request.

Example:

"40000"