Skip to main content

Query Order

Description

Retrieve the current state of a single order. Returns 404 if the order does not exist or belongs to a different user — the same response in both cases, so callers cannot probe for the existence of other users' orders.

HTTP Request

GET /spot/orders/:id (JWT or API Key)

Weight

0 — order endpoints are not subject to per-IP weight limits.

Request Parameters

NameTypeRequiredDescription
idSTRING (path)YESUUID of the order to query. Returned as id by New Order.

Response Example

200 OK

{
"id": "9f2a1c4e-5b67-4d8a-bf93-2e1f4a6c8d10",
"symbol": "DFUSDT",
"side": "buy",
"type": "limit",
"tif": "gtc",
"price": "0.5000",
"quantity": "100",
"quote_quantity": null,
"filled_qty": "100",
"avg_fill_price": "0.4990",
"status": "filled",
"reject_reason": null,
"created_at": 1778400000,
"updated_at": 1778400090
}
FieldNotes
idServer-generated UUID for this order.
statusSee Order Status. Terminal states: filled / canceled / rejected.
filled_qtyCumulative base quantity matched across all fills.
avg_fill_priceVolume-weighted average price across all fills. "0" if not yet filled.
quote_quantitySet only for market BUY (mirrors the original request); null otherwise.
reject_reasonNon-null only for status=rejected; contains the rejection error code string.
created_at, updated_atUnix seconds.

Note: Unlike New Order, this response does not include a fills array. Use Account Trades to retrieve individual fill records for an order.

Error Responses

HTTPerrorWhen
400invalid id:id is not a valid UUID.
404ORDER_NOT_FOUNDOrder does not exist, or belongs to a different user.
500DB_ERRORServer fault.

Full list: Error Codes.

Code Examples

cURL (JWT)

JWT="your_jwt_token"
ORDER_ID="9f2a1c4e-5b67-4d8a-bf93-2e1f4a6c8d10"

curl -s "https://api-sepolia.p99.world/api/v1/spot/orders/${ORDER_ID}" \
-H "Authorization: Bearer ${JWT}"

cURL (HMAC API Key)

API_KEY="your_api_key"
API_SECRET="your_api_secret"
ORDER_ID="9f2a1c4e-5b67-4d8a-bf93-2e1f4a6c8d10"
TIMESTAMP=$(date +%s%3N)
PAYLOAD="timestamp=${TIMESTAMP}"
SIGNATURE=$(echo -n "${PAYLOAD}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $2}')

curl -s \
-H "X-MBX-APIKEY: ${API_KEY}" \
"https://api-sepolia.p99.world/api/v1/spot/orders/${ORDER_ID}?timestamp=${TIMESTAMP}&signature=${SIGNATURE}"

Python

import time, hmac, hashlib, requests

API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api-sepolia.p99.world/api/v1"

def signed_get(path: str) -> dict:
ts = int(time.time() * 1000)
payload = f"timestamp={ts}"
sig = hmac.new(API_SECRET.encode(), payload.encode(), hashlib.sha256).hexdigest()
r = requests.get(
f"{BASE_URL}{path}?timestamp={ts}&signature={sig}",
headers={"X-MBX-APIKEY": API_KEY},
timeout=5,
)
r.raise_for_status()
return r.json()

order_id = "9f2a1c4e-5b67-4d8a-bf93-2e1f4a6c8d10"
order = signed_get(f"/spot/orders/{order_id}")
print(order["id"], order["status"], order["filled_qty"], "/", order["quantity"])

# Poll until terminal
import time as time_module
while order["status"] not in ("filled", "canceled", "rejected"):
time_module.sleep(1)
order = signed_get(f"/spot/orders/{order_id}")
print(f" status={order['status']} filled={order['filled_qty']}")