Skip to main content
POST
/
api
/
v4
/
order
/
stock_market
Create buy stock market order
curl --request POST \
  --url https://whitebit.com/api/v4/order/stock_market \
  --header 'Content-Type: application/json' \
  --header 'X-TXC-APIKEY: <api-key>' \
  --data '
{
  "market": "BTC_USDT",
  "side": "buy",
  "amount": "<string>",
  "request": "<string>",
  "nonce": "<string>",
  "clientOrderId": "<string>",
  "stp": "no"
}
'
{
  "orderId": 123,
  "clientOrderId": "<string>",
  "market": "<string>",
  "side": "<string>",
  "type": "<string>",
  "timestamp": 123,
  "dealMoney": "<string>",
  "dealStock": "<string>",
  "amount": "<string>",
  "left": "<string>",
  "dealFee": "<string>",
  "price": "<string>",
  "postOnly": true,
  "ioc": true,
  "status": "<string>",
  "stp": "<string>",
  "positionSide": "<string>",
  "rpi": true
}

Authorizations

X-TXC-APIKEY
string
header
required

API Key authentication for private endpoints.

Required headers:

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

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
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).

request
string
required
nonce
string
required
clientOrderId
string

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

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

Response

Order created successfully

orderId
integer

Order ID

clientOrderId
string

Custom client order ID; empty string if not specified

market
string

Deal market

side
string

Order side

type
string

Order type

timestamp
number

Timestamp of order creation

dealMoney
string

If order finished - amount in money currency that is finished

dealStock
string

If order finished - amount in stock currency that is finished

amount
string

Amount

left
string

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

dealFee
string

Fee in money that you pay if order is finished

price
string

Price

postOnly
boolean

PostOnly flag

ioc
boolean

IOC flag

status
string

Order status

stp
string

Self trade prevention mode

positionSide
string

Position side (for collateral orders)

rpi
boolean

RPI order flag - indicates whether Retail Price Improvement was enabled for this order

Example:

true