Skip to main content
Create Limit Order

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

Trading pair. Format: BASE_QUOTE (e.g., BTC_USDT). Query GET /api/v4/public/markets for available markets.

Example:

"BTC_USDT"

side
enum<string>
required

Order side. Allowed values: buy, sell.

Available options:
buy,
sell
Example:

"buy"

amount
string
required

Order quantity in base (stock) currency. Minimum and maximum values are market-dependent. Query GET /api/v4/public/markets for minAmount, minTotal, maxTotal. Precision: stockPrec.

Example:

"0.001"

price
string
required

Limit price per unit in quote (money) currency. Minimum and maximum values are market-dependent. Precision: moneyPrec.

Example:

"9800"

request
string
required
Example:

"{{request}}"

nonce
integer
required
Example:

1594297865000

clientOrderId
string

Custom client order identifier. Uniqueness is enforced only among the account's open (pending) orders on the same market — once a previous order is filled or canceled, the same identifier can be reused, including on the same market. Contains only letters, numbers, dashes, dots, or underscores.

Example:

"order1987111"

postOnly
boolean
default:false

Post-only flag. When true, the order executes only as a maker order and the system rejects the order if it would match immediately. Default: false.

Example:

false

ioc
boolean
default:false

Immediate-or-cancel (IOC) flag. When true, the matching engine executes all or part of the order immediately and cancels any unfilled portion. Default: false.

IOC does not support rpi=true because RPI uses post-only behavior by design. The API returns error code 40 when a request sets both ioc=true and rpi=true.

Refer to Order Parameter Rules for unsupported parameter combinations.

Example:

false

bboRole
enum<integer>

Best Bid/Offer (BBO) execution method. The system selects the best market price for execution. 1 = Queue method, 2 = Counterparty method. Use method 2 with the ioc flag.

Available options:
1,
2
stp
enum<string>
default:no

Self-trade prevention mode. Allowed values: no (self-trades allowed), cb (cancel both the new and the existing order), cn (cancel the new order, keep the existing), co (cancel the existing order, place the new one). Default: no.

Legacy values cancel_both, cancel_new, cancel_old are deprecated: the API accepts the legacy values with identical behavior until a deprecation deadline is announced, then rejects the legacy values. Responses always return the abbreviated form, regardless of which variant the request used.

See Self-Trade Prevention.

Available options:
no,
cb,
cn,
co
Example:

"no"

rpi
boolean
default:false

Enables Retail Price Improvement (RPI) mode. Default: false.

RPI orders use post-only behavior by design. An RPI order does not support ioc=true. The API returns error code 40 when a request sets both rpi=true and ioc=true. RPI orders do not appear in public order book feeds (depth, bookTicker). RPI orders are visible only in private active orders and in the exchange UI order book (web/mobile). RPI executions may apply custom fees or rebates, especially when trading via sub-accounts. Use Query Market Fees to verify effective fees.

Refer to Order Parameter Rules for unsupported parameter combinations.

Example:

true

retail
boolean
default:false

Retail-source taker flag. When true, the order is eligible to match against orders submitted by RPI makers and may receive price improvement at execution. Default: false.

The Retail flag must be enabled on the account before a private-API request can set retail=true. Contact the account manager to enable the Retail flag.

The Retail flag cannot be combined with rpi. The API returns error code 41 when a request sets both retail=true and rpi=true.

The flag has no effect on a postOnly=true order. Post-only orders are makers; only takers carry the retail designation.

Refer to Retail flag and Order Parameter Rules for unsupported parameter combinations.

Example:

false

Response

Order created successfully

orderId
integer

Unique identifier assigned to the order by the matching engine.

Example:

4180284841

clientOrderId
string

Custom client order identifier supplied in the request. Returns an empty string when not specified.

Example:

"order1987111"

market
string

Trading pair for the order. Format: BASE_QUOTE (e.g., BTC_USDT).

Example:

"BTC_USDT"

side
string

Order side. Possible values: buy, sell.

Example:

"buy"

type
string

Order type. Possible values: limit, market, stock market, stop limit, stop market.

Example:

"limit"

timestamp
number

Unix timestamp in seconds (UTC) of order creation, with microsecond precision.

Example:

1595792396.165973

dealMoney
string

Filled amount in quote currency. Returns "0" while the order remains unfilled.

Example:

"0"

dealStock
string

Filled amount in base currency. Returns "0" while the order remains unfilled.

Example:

"0"

amount
string

Order quantity in base currency for limit and stop-limit orders, or in quote currency for buy market orders.

Example:

"0.01"

left
string

Remaining unfilled quantity. Equals amount for new orders and "0" for fully filled orders.

Example:

"0.001"

dealFee
string

Cumulative trading fee charged for filled portions, denominated in the fee asset.

Example:

"0"

price
string

Limit price per unit in quote currency. Returns "0" for market orders.

Example:

"40000"

postOnly
boolean

Post-only flag. When true, the order executes only as a maker order and is rejected if it would match immediately. Default: false.

Example:

false

ioc
boolean

Immediate-or-cancel flag. When true, the order executes available quantity immediately and cancels the unfilled remainder. Default: false.

Example:

false

status
string

Order lifecycle status. NEW — accepted, not yet matched. FILLED — fully executed. CANCELED — canceled before execution. PARTIAL_FILLED — partially executed, remainder still active. PARTIAL_CANCELED — partially filled, remainder canceled. CANCELED_TAKER_BAND — partially filled up to the taker band limit, remainder canceled to protect against excessive order book slippage. AUTO_CANCELED_REDUCE_ONLY — pending reduce-only order auto-canceled because the associated position was closed. AUTO_CANCELED_LIQUIDATION — pending order auto-canceled because the associated position was force-liquidated. CANCELED_STP — order canceled by Self-Trade Prevention.

Example:

"FILLED"

stp
string

Self-trade prevention mode applied to the order. Possible values: no, cb, cn, co. The response always returns the abbreviated form, even when the request used a legacy value. Default: no.

Example:

"no"

positionSide
string

Position side (for collateral orders)

Example:

"LONG"

rpi
boolean

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

Example:

true

retail
boolean

Retail-source taker flag. The field is present only when the order was placed with retail=true. See Retail flag.

Example:

true

reduceOnly
boolean

Reduce-only flag. When true, the order can only reduce or close an existing position. See reduce-only.

Example:

false

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>

Trigger condition for the stop order. Response-only — not accepted in the request body, and cannot be overridden. Derived from side:

  • side = buygte. The order activates when the market price rises to or above activation_price.
  • side = selllte. The order activates when the market price falls to or below 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"