Placing Orders
Create a market order
Section titled “Create a market order”TypeScript / JavaScript
const body = { symbol: "BTC-USD", side: "buy", type: "market", size: "0.01" };
const res = await fetch(`${process.env.API_BASE}/v1/orders`, { method: "POST", headers: { "Content-Type": "application/json", "X-API-Key": process.env.API_KEY!, "Idempotency-Key": crypto.randomUUID() }, body: JSON.stringify(body)});console.log(await res.json());Python
import os, requests, uuidAPI_BASE, API_KEY = os.getenv("API_BASE"), os.getenv("API_KEY")
payload = {"symbol":"BTC-USD","side":"buy","type":"market","size":"0.01"}r = requests.post(f"{API_BASE}/v1/orders", headers={"X-API-Key": API_KEY, "Content-Type": "application/json", "Idempotency-Key": str(uuid.uuid4())}, json=payload)print(r.json())Test Placing Orders
Section titled “Test Placing Orders”# Create a market order (BTC-USD)curl -X POST "$API_BASE/v1/orders" \ -H "Content-Type: application/json" \ -H "X-API-Key: $API_KEY" \ -d '{ "symbol": "BTC-USD", "side": "buy", "type": "market", "quantity": "0.01", "client_order_id": "demo-$(date +%s)" }'Tip: Replace $API_BASE and $API_KEY with your environment values.
Check fills with GET /v1/orders/{order_id} or listen for the order.filled webhook.
Verify
Section titled “Verify”202 Accepted→ order accepted into the matching engine200 OKwith{ "order_id": "...", "status": "filled" | "partial" }- Webhook
order.filledconfirms settlement flow