# order

## POST /exchange

> Place an order(s).

```json
{"openapi":"3.1.1","info":{"title":"Hyperliquid API - exchange/order","version":"1.0.0"},"tags":[{"name":"order"}],"servers":[{"url":"https://api.hyperliquid.xyz","description":"Mainnet"},{"url":"https://api.hyperliquid-testnet.xyz","description":"Testnet"}],"paths":{"/exchange":{"post":{"tags":["order"],"description":"Place an order(s).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"object","properties":{"type":{"description":"Type of action.","enum":["order"]},"orders":{"type":"array","items":{"type":"object","properties":{"a":{"type":"integer","minimum":0,"description":"Asset ID."},"b":{"type":"boolean","description":"Position side (`true` for long, `false` for short)."},"p":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Price."},"s":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Size (in base currency units)."},"r":{"type":"boolean","description":"Is reduce-only?"},"t":{"anyOf":[{"type":"object","properties":{"limit":{"type":"object","properties":{"tif":{"enum":["Gtc","Ioc","Alo","FrontendMarket","LiquidationMarket"],"description":"Time-in-force.\n- `\"Gtc\"`: Remains active until filled or canceled.\n- `\"Ioc\"`: Fills immediately or cancels any unfilled portion.\n- `\"Alo\"`: Adds liquidity only.\n- `\"FrontendMarket\"`: Similar to Ioc, used in Hyperliquid UI.\n- `\"LiquidationMarket\"`: Similar to Ioc, used in Hyperliquid UI."}},"required":["tif"],"description":"Limit order parameters."}},"required":["limit"]},{"type":"object","properties":{"trigger":{"type":"object","properties":{"isMarket":{"type":"boolean","description":"Is market order?"},"triggerPx":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Trigger price."},"tpsl":{"enum":["tp","sl"],"description":"Indicates whether it is take profit or stop loss."}},"required":["isMarket","triggerPx","tpsl"],"description":"Trigger order parameters."}},"required":["trigger"]}],"description":"Order type."},"c":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":34,"maxLength":34,"description":"Client Order ID."}},"required":["a","b","p","s","r","t"],"description":"Place order parameters."},"description":"Array of order parameters."},"grouping":{"enum":["na","normalTpsl","positionTpsl"],"description":"Order grouping strategy:\n- `na`: Standard order without grouping.\n- `normalTpsl`: TP/SL order with fixed size that doesn't adjust with position changes.\n- `positionTpsl`: TP/SL order that adjusts proportionally with the position size."},"builder":{"type":"object","properties":{"b":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":42,"maxLength":42,"description":"Builder address."},"f":{"type":"integer","minimum":0,"description":"Builder fee in 0.1bps (1 = 0.0001%)."}},"required":["b","f"],"description":"Builder fee."}},"required":["type","orders"],"description":"Action to perform."},"nonce":{"type":"integer","minimum":0,"description":"Nonce (timestamp in ms) used to prevent replay attacks."},"signature":{"type":"object","properties":{"r":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":66,"maxLength":66,"description":"First 32-byte component."},"s":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":66,"maxLength":66,"description":"Second 32-byte component."},"v":{"enum":[27,28],"description":"Recovery identifier."}},"required":["r","s","v"],"description":"ECDSA signature components."},"vaultAddress":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":42,"maxLength":42,"description":"Vault address (for vault trading)."},"expiresAfter":{"type":"integer","minimum":0,"description":"Expiration time of the action."}},"required":["action","nonce","signature"],"description":"Place an order(s)."}}},"required":true},"responses":{"200":{"description":"Response for order placement.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"description":"Successful status.","enum":["ok"]},"response":{"type":"object","properties":{"type":{"description":"Type of response.","enum":["order"]},"data":{"type":"object","properties":{"statuses":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"resting":{"type":"object","properties":{"oid":{"type":"integer","minimum":0,"description":"Order ID."},"cloid":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":34,"maxLength":34,"description":"Client Order ID."}},"required":["oid"],"description":"Resting order status."}},"required":["resting"]},{"type":"object","properties":{"filled":{"type":"object","properties":{"totalSz":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Total size filled."},"avgPx":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Average price of fill."},"oid":{"type":"integer","minimum":0,"description":"Order ID."},"cloid":{"type":"string","pattern":"^0[xX][0-9a-fA-F]+$","minLength":34,"maxLength":34,"description":"Client Order ID."}},"required":["totalSz","avgPx","oid"],"description":"Filled order status."}},"required":["filled"]},{"type":"object","properties":{"error":{"type":"string","description":"Error message."}},"required":["error"]}]},"description":"Array of statuses or error messages."}},"required":["statuses"],"description":"Specific data."}},"required":["type","data"],"description":"Response details."}},"required":["status","response"],"description":"Response for order placement."}}}},"422":{"description":"Failed to deserialize the JSON body into the target type","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```
