curl --request POST \
--url https://whitebit.com/api/v4/order/modify \
--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,
"orderId": 4180284841,
"clientOrderId": "order1987111",
"amount": "0.001",
"total": "100",
"price": "9800",
"activationPrice": "10000",
"stp": "no"
}
'import requests
url = "https://whitebit.com/api/v4/order/modify"
payload = {
"market": "BTC_USDT",
"request": "{{request}}",
"nonce": 1594297865000,
"orderId": 4180284841,
"clientOrderId": "order1987111",
"amount": "0.001",
"total": "100",
"price": "9800",
"activationPrice": "10000",
"stp": "no"
}
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,
orderId: 4180284841,
clientOrderId: 'order1987111',
amount: '0.001',
total: '100',
price: '9800',
activationPrice: '10000',
stp: 'no'
})
};
fetch('https://whitebit.com/api/v4/order/modify', 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/order/modify",
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,
'orderId' => 4180284841,
'clientOrderId' => 'order1987111',
'amount' => '0.001',
'total' => '100',
'price' => '9800',
'activationPrice' => '10000',
'stp' => 'no'
]),
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/order/modify"
payload := strings.NewReader("{\n \"market\": \"BTC_USDT\",\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000,\n \"orderId\": 4180284841,\n \"clientOrderId\": \"order1987111\",\n \"amount\": \"0.001\",\n \"total\": \"100\",\n \"price\": \"9800\",\n \"activationPrice\": \"10000\",\n \"stp\": \"no\"\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/order/modify")
.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 \"orderId\": 4180284841,\n \"clientOrderId\": \"order1987111\",\n \"amount\": \"0.001\",\n \"total\": \"100\",\n \"price\": \"9800\",\n \"activationPrice\": \"10000\",\n \"stp\": \"no\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/order/modify")
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 \"orderId\": 4180284841,\n \"clientOrderId\": \"order1987111\",\n \"amount\": \"0.001\",\n \"total\": \"100\",\n \"price\": \"9800\",\n \"activationPrice\": \"10000\",\n \"stp\": \"no\"\n}"
response = http.request(request)
puts response.read_bodyModify order
The endpoint modifies an existing order on spot, margin, and futures markets. There is no separate collateral path: collateral orders go through this endpoint, and the market parameter identifies which market the order belongs to.
Supported order types: limit, stop limit, stop market. On collateral markets the supported types are the collateral limit, collateral stop-limit, and collateral trigger-market orders.
Request must contain at least one of the following parameters: amount, total, price, activationPrice.
Price and amount steps: from September 18, 2026, a price or activationPrice sent in the request must be a multiple of the market tickSize, and amount a multiple of stepSize. A buy stop-market modification sends total in quote currency, which the step does not apply to. See Price and amount steps.
Rate limit: 10000 requests/10 sec.
- Use total parameter instead of amount for modify buy stop market order.
amountandtotalare mutually exclusive — a request sending both is rejected. - The request accepts exactly one identifier: either
orderIdorclientOrderId. - Sending both identifiers, or neither, returns a validation error.
- Group legs cannot be modified. An OCO or OTO leg returns error
155: cancel the group and place a new one. A TPSL leg returns error160: cancel the leg and attach a new pair.
WebSocket impact: Each call to the endpoint cancels the original order and
creates a replacement with a new orderId. Clients subscribed to the
ordersPending_update WebSocket channel will receive:
event_id=3(cancel) for the old orderevent_id=1(new) for the replacement
Update any orderId references after a successful modify response.
Use clientOrderId for stable order tracking across modifications.
curl --request POST \
--url https://whitebit.com/api/v4/order/modify \
--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,
"orderId": 4180284841,
"clientOrderId": "order1987111",
"amount": "0.001",
"total": "100",
"price": "9800",
"activationPrice": "10000",
"stp": "no"
}
'import requests
url = "https://whitebit.com/api/v4/order/modify"
payload = {
"market": "BTC_USDT",
"request": "{{request}}",
"nonce": 1594297865000,
"orderId": 4180284841,
"clientOrderId": "order1987111",
"amount": "0.001",
"total": "100",
"price": "9800",
"activationPrice": "10000",
"stp": "no"
}
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,
orderId: 4180284841,
clientOrderId: 'order1987111',
amount: '0.001',
total: '100',
price: '9800',
activationPrice: '10000',
stp: 'no'
})
};
fetch('https://whitebit.com/api/v4/order/modify', 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/order/modify",
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,
'orderId' => 4180284841,
'clientOrderId' => 'order1987111',
'amount' => '0.001',
'total' => '100',
'price' => '9800',
'activationPrice' => '10000',
'stp' => 'no'
]),
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/order/modify"
payload := strings.NewReader("{\n \"market\": \"BTC_USDT\",\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000,\n \"orderId\": 4180284841,\n \"clientOrderId\": \"order1987111\",\n \"amount\": \"0.001\",\n \"total\": \"100\",\n \"price\": \"9800\",\n \"activationPrice\": \"10000\",\n \"stp\": \"no\"\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/order/modify")
.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 \"orderId\": 4180284841,\n \"clientOrderId\": \"order1987111\",\n \"amount\": \"0.001\",\n \"total\": \"100\",\n \"price\": \"9800\",\n \"activationPrice\": \"10000\",\n \"stp\": \"no\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/order/modify")
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 \"orderId\": 4180284841,\n \"clientOrderId\": \"order1987111\",\n \"amount\": \"0.001\",\n \"total\": \"100\",\n \"price\": \"9800\",\n \"activationPrice\": \"10000\",\n \"stp\": \"no\"\n}"
response = http.request(request)
puts response.read_bodyUsed in these guides
- Copy Trading — mirror a lead trader’s orders into followers’ own accounts via OAuth-issued keys.
- Market Maker integration — bulk quoting, RPI, kill-switch, and market-data streams.
Authorizations
Body
Available market. Example: BTC_USDT
"BTC_USDT"
Amount of stock currency to buy or sell. Example: '0.001' or 0.001
"0.001"
Total of money currency to buy or sell. Example: '0.001' or 0.001
"100"
Price in money currency. Example: '9800' or 9800
"9800"
Activation price in money currency. Example: '10000' or 10000
"10000"
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.
no, cb, cn, co "no"
Response
Order modified successfully
Shared order shape returned by the order-creation, cancel, active-orders list, and modify endpoints. Field presence varies by endpoint and order type — see the per-field notes.
Order lifecycle status. FILLED — fully executed. CANCELED — canceled before execution. PARTIALLY_FILLED — partially executed, remainder still active. 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. REST returns the single-L spelling throughout; NEW and PARTIAL_FILLED are not REST values (NEW is WebSocket-only; the partially-filled state is PARTIALLY_FILLED).
"FILLED"
OTO order data. Present only when the order belongs to an OTO group — returned on the cancel, active-orders list, and modify responses.
Show child attributes
Show child attributes
Retail-source taker flag. The field is present only when the order was placed with retail=true. See Retail flag.
true
Reduce-only flag. When true, the order can only reduce or close an existing position. Returned on the cancel, active-orders list, and modify responses; spot order-creation responses do not include the field. See reduce-only.
false
Trigger condition for the stop order. Response-only — not accepted in the request body, and cannot be overridden. Derived from side:
side = buy→gte. The order activates when the market price rises to or aboveactivation_price.side = sell→lte. The order activates when the market price falls to or belowactivation_price.
lte, gte "lte"
Was this page helpful?