curl --request POST \
--url https://whitebit.com/api/v4/collateral-account/positions/open \
--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",
"request": "{{request}}",
"nonce": 1594297865000
}
'import requests
url = "https://whitebit.com/api/v4/collateral-account/positions/open"
payload = {
"market": "BTC_USDT",
"request": "{{request}}",
"nonce": 1594297865000
}
headers = {
"X-TXC-APIKEY": "<api-key>",
"X-TXC-PAYLOAD": "<api-key>",
"X-TXC-SIGNATURE": "<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>',
'X-TXC-PAYLOAD': '<api-key>',
'X-TXC-SIGNATURE': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({market: 'BTC_USDT', request: '{{request}}', nonce: 1594297865000})
};
fetch('https://whitebit.com/api/v4/collateral-account/positions/open', 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/collateral-account/positions/open",
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',
'request' => '{{request}}',
'nonce' => 1594297865000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-TXC-APIKEY: <api-key>",
"X-TXC-PAYLOAD: <api-key>",
"X-TXC-SIGNATURE: <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/collateral-account/positions/open"
payload := strings.NewReader("{\n \"market\": \"BTC_USDT\",\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-TXC-APIKEY", "<api-key>")
req.Header.Add("X-TXC-PAYLOAD", "<api-key>")
req.Header.Add("X-TXC-SIGNATURE", "<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/collateral-account/positions/open")
.header("X-TXC-APIKEY", "<api-key>")
.header("X-TXC-PAYLOAD", "<api-key>")
.header("X-TXC-SIGNATURE", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"BTC_USDT\",\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/collateral-account/positions/open")
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["X-TXC-PAYLOAD"] = '<api-key>'
request["X-TXC-SIGNATURE"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"market\": \"BTC_USDT\",\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}"
response = http.request(request)
puts response.read_body[
{
"positionId": 527,
"market": "BTC_USDT",
"openDate": 1651568067.789679,
"modifyDate": 1651568067.789679,
"amount": "0.1",
"basePrice": "45658.349",
"liquidationPrice": null,
"liquidationState": "margin_call",
"pnl": "-168.42",
"pnlPercent": "-0.43",
"margin": "8316.74",
"freeMargin": "619385.67",
"funding": "0",
"unrealizedFunding": "0.0019142920201966",
"tpsl": {
"takeProfitId": 123,
"takeProfit": "50000",
"stopLossId": 124,
"stopLoss": "35000"
},
"positionSide": "LONG"
},
{
"positionId": 528,
"market": "ETH_USDT",
"openDate": 1651568067.789679,
"modifyDate": 1651568067.789679,
"amount": "0.1",
"basePrice": "5658.349",
"liquidationPrice": null,
"liquidationState": "margin_call",
"pnl": "-168.42",
"pnlPercent": "-0.43",
"margin": "8316.74",
"freeMargin": "19385.67",
"funding": "0",
"unrealizedFunding": "0.0020142920201966",
"tpsl": null,
"positionSide": "LONG"
}
]{
"code": 30,
"message": "Validation failed",
"errors": {}
}Open positions
The endpoint returns all open collateral positions for the authenticated account. Each position includes entry price, unrealized PnL, margin allocation, liquidation price, and take-profit/stop-loss configuration. Use the optional market parameter to filter results to a single trading pair.
Rate limit: 12000 requests/10 sec.
curl --request POST \
--url https://whitebit.com/api/v4/collateral-account/positions/open \
--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",
"request": "{{request}}",
"nonce": 1594297865000
}
'import requests
url = "https://whitebit.com/api/v4/collateral-account/positions/open"
payload = {
"market": "BTC_USDT",
"request": "{{request}}",
"nonce": 1594297865000
}
headers = {
"X-TXC-APIKEY": "<api-key>",
"X-TXC-PAYLOAD": "<api-key>",
"X-TXC-SIGNATURE": "<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>',
'X-TXC-PAYLOAD': '<api-key>',
'X-TXC-SIGNATURE': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({market: 'BTC_USDT', request: '{{request}}', nonce: 1594297865000})
};
fetch('https://whitebit.com/api/v4/collateral-account/positions/open', 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/collateral-account/positions/open",
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',
'request' => '{{request}}',
'nonce' => 1594297865000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-TXC-APIKEY: <api-key>",
"X-TXC-PAYLOAD: <api-key>",
"X-TXC-SIGNATURE: <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/collateral-account/positions/open"
payload := strings.NewReader("{\n \"market\": \"BTC_USDT\",\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-TXC-APIKEY", "<api-key>")
req.Header.Add("X-TXC-PAYLOAD", "<api-key>")
req.Header.Add("X-TXC-SIGNATURE", "<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/collateral-account/positions/open")
.header("X-TXC-APIKEY", "<api-key>")
.header("X-TXC-PAYLOAD", "<api-key>")
.header("X-TXC-SIGNATURE", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"BTC_USDT\",\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/collateral-account/positions/open")
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["X-TXC-PAYLOAD"] = '<api-key>'
request["X-TXC-SIGNATURE"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"market\": \"BTC_USDT\",\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}"
response = http.request(request)
puts response.read_body[
{
"positionId": 527,
"market": "BTC_USDT",
"openDate": 1651568067.789679,
"modifyDate": 1651568067.789679,
"amount": "0.1",
"basePrice": "45658.349",
"liquidationPrice": null,
"liquidationState": "margin_call",
"pnl": "-168.42",
"pnlPercent": "-0.43",
"margin": "8316.74",
"freeMargin": "619385.67",
"funding": "0",
"unrealizedFunding": "0.0019142920201966",
"tpsl": {
"takeProfitId": 123,
"takeProfit": "50000",
"stopLossId": 124,
"stopLoss": "35000"
},
"positionSide": "LONG"
},
{
"positionId": 528,
"market": "ETH_USDT",
"openDate": 1651568067.789679,
"modifyDate": 1651568067.789679,
"amount": "0.1",
"basePrice": "5658.349",
"liquidationPrice": null,
"liquidationState": "margin_call",
"pnl": "-168.42",
"pnlPercent": "-0.43",
"margin": "8316.74",
"freeMargin": "19385.67",
"funding": "0",
"unrealizedFunding": "0.0020142920201966",
"tpsl": null,
"positionSide": "LONG"
}
]{
"code": 30,
"message": "Validation failed",
"errors": {}
}Authorizations
Body
Response
Successful response - returns array of open positions
Funding fees accrued since the last position state change and not yet realized. For margin positions, the value accumulates continuously and is settled into the funding field when the position state changes (e.g., on partial or full close). For futures markets (BTC_PERP and other _PERP pairs), always "0" — futures funding is applied via periodic balance updates, not tracked per position.
"0.0019142920201966"
Was this page helpful?