Skip to main content
POST
/
api
/
v4
/
orders
Query unexecuted(active) orders
curl --request POST \
  --url https://whitebit.com/api/v4/orders \
  --header 'Content-Type: application/json' \
  --header 'X-TXC-APIKEY: <api-key>' \
  --data '
{
  "market": "BTC_USDT",
  "order_id": 3134995325,
  "client_order_id": "customId11",
  "offset": 0,
  "limit": 50,
  "request": "{{request}}",
  "nonce": "{{nonce}}"
}
'
import requests

url = "https://whitebit.com/api/v4/orders"

payload = {
    "market": "BTC_USDT",
    "order_id": 3134995325,
    "client_order_id": "customId11",
    "offset": 0,
    "limit": 50,
    "request": "{{request}}",
    "nonce": "{{nonce}}"
}
headers = {
    "X-TXC-APIKEY": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'X-TXC-APIKEY': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    market: 'BTC_USDT',
    order_id: 3134995325,
    client_order_id: 'customId11',
    offset: 0,
    limit: 50,
    request: '{{request}}',
    nonce: '{{nonce}}'
  })
};

fetch('https://whitebit.com/api/v4/orders', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://whitebit.com/api/v4/orders",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'market' => 'BTC_USDT',
    'order_id' => 3134995325,
    'client_order_id' => 'customId11',
    'offset' => 0,
    'limit' => 50,
    'request' => '{{request}}',
    'nonce' => '{{nonce}}'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "X-TXC-APIKEY: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://whitebit.com/api/v4/orders"

	payload := strings.NewReader("{\n  \"market\": \"BTC_USDT\",\n  \"order_id\": 3134995325,\n  \"client_order_id\": \"customId11\",\n  \"offset\": 0,\n  \"limit\": 50,\n  \"request\": \"{{request}}\",\n  \"nonce\": \"{{nonce}}\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-TXC-APIKEY", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://whitebit.com/api/v4/orders")
  .header("X-TXC-APIKEY", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"market\": \"BTC_USDT\",\n  \"order_id\": 3134995325,\n  \"client_order_id\": \"customId11\",\n  \"offset\": 0,\n  \"limit\": 50,\n  \"request\": \"{{request}}\",\n  \"nonce\": \"{{nonce}}\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://whitebit.com/api/v4/orders")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-TXC-APIKEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"market\": \"BTC_USDT\",\n  \"order_id\": 3134995325,\n  \"client_order_id\": \"customId11\",\n  \"offset\": 0,\n  \"limit\": 50,\n  \"request\": \"{{request}}\",\n  \"nonce\": \"{{nonce}}\"\n}"

response = http.request(request)
puts response.read_body
[
  {
    "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
  }
]
{
  "code": 30,
  "message": "Validation failed",
  "errors": {}
}
{
  "code": 30,
  "message": "Validation failed",
  "errors": {}
}

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

Available market. Example: BTC_USDT

Example:

"BTC_USDT"

order_id
integer

Available order_id. Example: 3134995325

Example:

3134995325

client_order_id
string

Available client_order_id. Example: customId11

Example:

"customId11"

offset
integer
default:0

Starting line index (OFFSET). Default: 0, Min: 0

Example:

0

limit
integer
default:50

LIMIT is a special clause used to limit records a particular query can return. Default: 50, Min: 1, Max: 100

Required range: x <= 100
Example:

50

request
string
Example:

"{{request}}"

nonce
string
Example:

"{{nonce}}"

Response

List of active orders

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