POST

/api/v1/terminal/order

Permission: SMART_TRADES_WRITESecurity: SIGNED

Creates a new trade. This endpoint supports creating market and limit trades, including optional conditional triggers, trailing stops, timeouts, and leverage settings (for OKX Futures).

Request Parameters

9
account_idinteger required

ID of the exchange account. Use GET /api/v1/accounts to retrieve available accounts.

pairstring required

Trading pair in format like USDT_BTC or BTC_ETH.

orderobject required

Details of the trade order.

unitsobject required

Amount to buy or sell in base currency units.

priceobject

Price settings, required for limit orders.

conditionalobject required

Optional conditional order configuration.

trailingobject required

Optional trailing stop configuration.

timeoutobject required

Optional timeout for conditional trades.

leverageobject

Optional leverage configuration (OKX Futures only).

Example Trade Types

create_trade_market_buy.json
POST /quentrade/trades
{
  "account_id": 1,
  "pair": "USDT_BTC",
  "order": {
    "type": "market",
    "side": "buy"
  },
  "units": {
    "value": "1.0"
  },
  "conditional": {
    "enabled": false
  },
  "trailing": {
    "enabled": false
  },
  "timeout": {
    "enabled": false
  }
}

Example Responses

If successful, the response includes trade ID, current status, and execution metadata.

create_trade_201.json
201 Created
{
  "trade": {
    "uuid": "a6f1c3d2-9d1a-4db7-9ad4-f7a8e2f98765",
    "account_id": 1,
    "pair": "USDT_BTC",
    "order": {
      "type": "market",
      "side": "buy"
    },
    "units": {
      "value": "1.0"
    },
    "status": {
      "value": "to_process",
      "error": null
    },
    "filled": {
      "units": "0.0",
      "total": "0.0",
      "price": null
    },
    "created_at": 1727871936,
    "closed_at": null,
    "price": {
      "value": null
    },
    "conditional": {
      "enabled": false,
      "value": null,
      "price": {
        "value": null,
        "type": null
      }
    },
    "trailing": {
      "enabled": false,
      "value": null,
      "percent": null
    },
    "timeout": {
      "enabled": false,
      "value": null
    }
  }
}