Skip to main content

Test New Order

Description

Test connectivity and symbol validity for order placement. This endpoint does not count toward order rate limits and does not actually execute the order.

Limited validation

The current implementation only validates that symbol refers to a tradeable market (-1121 otherwise). All other parameters — quantity, price, type, filters, margin — are not checked. A request that passes here can still be rejected by POST /fapi/v1/order.

HTTP Request

POST /fapi/v1/order/test (HMAC SHA256)

Request Parameters

Same as New Order interface — but note that only symbol is actually validated (see above).

Response Example

{}

If the test passes, the response is an empty object; if the symbol is unknown or not tradeable, error -1121 is returned.

Code Examples

cURL

API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
BODY='{"symbol":"BTCUSDT","side":"BUY","type":"LIMIT","timeInForce":"GTC","quantity":"0.01","price":"60000"}'
SIGNATURE=$(echo -n "timestamp=${TIMESTAMP}${BODY}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $2}')

curl -s -X POST \
-H "X-MBX-APIKEY: ${API_KEY}" \
-H "Content-Type: application/json" \
-d "${BODY}" \
"https://api.prex.world/fapi/v1/order/test?timestamp=${TIMESTAMP}&signature=${SIGNATURE}"

Python

import time, hmac, hashlib, requests, json

API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api.prex.world"

def sign(msg: str) -> str:
return hmac.new(API_SECRET.encode(), msg.encode(), hashlib.sha256).hexdigest()

def signed_post(path, body={}):
ts = int(time.time() * 1000)
qs = f"timestamp={ts}"
body_str = json.dumps(body, separators=(',', ':'))
sig = sign(qs + body_str)
return requests.post(
f"{BASE_URL}{path}?timestamp={ts}&signature={sig}",
data=body_str,
headers={"X-MBX-APIKEY": API_KEY, "Content-Type": "application/json"},
)

# Test a LIMIT BUY order for BTCUSDT (not actually executed)
resp = signed_post("/fapi/v1/order/test", body={
"symbol": "BTCUSDT",
"side": "BUY",
"type": "LIMIT",
"timeInForce": "GTC",
"quantity": "0.01",
"price": "60000",
})
print(resp.json()) # {}