Prepare order
prepare_orderValidate an order against risk limits and estimate fill price and fees. With dry_run: true nothing else happens. Otherwise returns typed_data to sign and a prepared_id for submit_signed_order (valid 120 s). Use when you sign transactions yourself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| size | No | Base-asset size. Give this or notional_usd. | |
| type | No | market (default) or limit | |
| market | Yes | Market symbol, e.g. BTC, ETH, SOL (see get_markets) | |
| dry_run | No | true: only validate and estimate costs | |
| stop_loss | No | Market orders on perps: reduce-only stop-loss that closes this position when the mark price crosses trigger_price | |
| limit_price | No | Required for limit orders | |
| market_type | No | perp (default) or spot; spot only for markets get_markets lists as spot | |
| reduce_only | No | ||
| take_profit | No | Market orders on perps: reduce-only take-profit that closes this position when the mark price crosses trigger_price | |
| notional_usd | No | Order value in USD. Give this or size. | |
| slippage_bps | No | Market orders: max slippage vs mid in basis points (default 50) | |
| time_in_force | No | Limit orders: gtc (default), ioc, alo (post-only) | |
| idempotency_key | No | Optional. Reuse the same value when retrying the same operation so it is not executed twice. | |
| builder_approval | No | Signed builder-fee approval; needed once before the first real order |