---
title: "private/order"
method: POST
path: "/private/order"
tags: ["Orderbook"]
---

# private/order

`POST /private/order`

## Request

- Base URL: `https://api.derive.xyz/v3`
- URL: `https://api.derive.xyz/v3/private/order`
- Auth: API key in header `X-DeriveWallet` and API key in header `X-DeriveTimestamp` and API key in header `X-DeriveSignature`

Submits a signed limit or market order for a subaccount, specifying instrument, direction, amount, limit price and max fee, plus optional flags like time-in-force, reduce-only, post-only and MMP. The same endpoint also creates trigger orders (via trigger_type/trigger_price) and algo orders (via algo_type), though the two cannot be combined in one request. Requires a signed order payload and Orderbook trade scope for the instrument's asset; returns the created order with its assigned id and current status.

## Request body

- CreateOrderRequest: `private/order` params.
  - `algo_duration_sec` integer, nullable
  - `algo_num_slices` integer, nullable
  - `algo_type` 'twap', nullable
  - `amount` string, decimal, required: Order amount in units of the base, as a decimal string (e.g. `"1.5"`) or a JSON number.
  - `client` string, nullable
  - `direction` 'buy' | 'sell', required
  - `extra_fee` string, decimal, nullable: Optional builder fee for the whole order, in USDC, as a decimal string or JSON number. Each fill pays its pro-rata share. Defaults to zero.
  - `instrument_name` string, required
  - `is_atomic_signing` boolean, nullable
  - `label` string, nullable
  - `limit_price` string, decimal, required: Limit price in quote currency, as a decimal string (e.g. `"3100.5"`) or a JSON number.
  - `max_fee` string, decimal, required: Max fee per unit of volume in quote currency, as a decimal string or a JSON number.
  - `mmp` boolean, nullable: Tags the order for market maker protection. Only tagged orders are cancelled by cancel on disconnect.
  - `nonce` string, required
  - `order_type` 'limit' | 'market'
  - `reduce_only` boolean, nullable
  - `referral_code` string, nullable
  - `reject_post_only` boolean, nullable
  - `reject_timestamp` integer, nullable
  - `signature` string, required
  - `signature_expiry_sec` integer, required
  - `signer` string, required
  - `subaccount_id` integer, required
  - `time_in_force` 'gtc' | 'post_only' | 'fok' | 'ioc'
  - `trigger_price` string, decimal, nullable: Trigger price as a decimal string or JSON number; omit for non-trigger orders.
  - `trigger_price_type` 'mark' | 'index', nullable
  - `trigger_type` 'stoploss' | 'takeprofit', nullable

## Response `200`

Success

- OrderCreatedResponse
  - `order` Order, required
    - `algo_duration_sec` integer, nullable
    - `algo_num_slices` integer, nullable
    - `algo_slices_completed` integer, nullable
    - `algo_type` 'twap', nullable
    - `amount` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `average_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `cancel_reason` '' | 'user_request' | 'mmp_trigger' | 'insufficient_margin' | 'signed_max_fee_too_low' | 'cancel_on_disconnect' | 'ioc_or_market_partial_fill' | 'session_key_deregistered' | 'subaccount_withdrawn' | 'compliance' | 'trigger_failed' | 'validation_failed' | 'algo_completed' | 'max_crossed_orders'
    - `creation_timestamp` integer, required
    - `direction` 'buy' | 'sell', required
    - `extra_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `filled_amount` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `instrument_name` string, required
    - `is_transfer` boolean, required
    - `label` string
    - `last_update_timestamp` integer, required
    - `limit_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `max_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `mmp` boolean, required
    - `nonce` string, required
    - `order_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `order_id` string, required
    - `order_status` 'open' | 'filled' | 'rejected' | 'cancelled' | 'expired' | 'untriggered' | 'algo_active', required
    - `order_type` 'limit' | 'market', required
    - `quote_id` string, uuid, nullable, required: Optional UUID v4 string
    - `replaced_order_id` string, uuid, nullable, required: Optional UUID v4 string
    - `signature` string, required
    - `signature_expiry_sec` integer, required
    - `signed_limit_price` string, decimal, nullable, required: Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
    - `signer` string, required
    - `subaccount_id` integer, required
    - `time_in_force` 'gtc' | 'post_only' | 'fok' | 'ioc', required
    - `trigger_price` string, decimal, nullable, required: Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
    - `trigger_price_type` 'mark' | 'index', nullable
    - `trigger_reject_message` string, nullable
    - `trigger_type` 'stoploss' | 'takeprofit', nullable
  - `trades` Trade[], required
    - `batch_status` 'Batching' | 'Executing' | 'Da' | 'Proving' | 'Settling' | 'Settled' | 'BatchingError' | 'ExecutingError' | 'DaError' | 'ProvingError' | 'SettlingError' | 'SettledError', nullable: Batch lifecycle status — the single source of lifecycle truth for every operation in the batch (individual ops carry no status of their own). Each stage has a healthy variant and a corresponding `...Error` variant meaning that stage failed. Serialized as the variant name (string) in API responses.
    - `block_trade_id` string, uuid, nullable, required: Optional UUID v4 string
    - `direction` 'buy' | 'sell', required
    - `expected_rebate` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `extra_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `index_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `instrument_name` string, required
    - `is_transfer` boolean, required
    - `label` string
    - `liquidity_role` 'maker' | 'taker', required
    - `mark_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `op_uuid` string, required
    - `order_id` string, required
    - `quote_id` string, uuid, nullable, required: Optional UUID v4 string
    - `realized_pnl` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `realized_pnl_excl_fees` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `rfq_id` string, uuid, nullable, required: Optional UUID v4 string
    - `subaccount_id` integer, required
    - `timestamp` integer, required
    - `trade_amount` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `trade_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `trade_id` string, required
    - `trade_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `tx_hash` string, nullable

## Other responses

- `default`: JSON-RPC error (see Error Codes)

## Changes

- **2026-11-12** `1daf38a69a7a`: 1 info
  - added the required property `trades/items/block_trade_id` to the response with the `200` status
- **2026-10-20** `0c500202be49`: 2 info
  - the endpoint scheme security `DeriveWallet AND DeriveTimestamp AND DeriveSignature` was added to the API
  - added the media type `application/json` for the response with the status `default`
- **2026-10-14** `bbc792e18f1a`: 1 warning
  - added the new `max_crossed_orders` enum value to the `order/cancel_reason` response property for the response status `200`

[Operation history](https://skmtc.dev/lyra/apis/derive-v3-api/changes/private/order/post.md)

---

[API](https://skmtc.dev/lyra/apis/derive-v3-api.md) - [All operations](https://skmtc.dev/lyra/apis/derive-v3-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lyra/apis/derive-v3-api/revisions/415f8a73b10c?raw)
