$EX5 pre-sale is open — Seed tier · 500M fixed supply · 50% burn · KYC via EX5 ExchangeJOIN →
EX5 API · REST & WEBSOCKET

Trading

Place and cancel orders through the order-entry API, and read your orders and trades through the history endpoints. All trading endpoints need a signed API key; placing orders needs account level 2.

Order lifecycle

  1. POST /api/v2/finex/market/orders answers 201 with state pending and a uuid. This means the order was accepted for processing, not that it is on the book.
  2. The matching engine then checks your balance. The order becomes wait (open), done (filled) or reject (for example, insufficient balance).
  3. Follow it with GET /api/v2/peatio/market/orders/{uuid} or the private order WebSocket stream. Right after creation the lookup can briefly return 404 while the order is being recorded.
StateMeaning
pendingAccepted, not yet processed by the engine.
waitOpen on the order book.
doneCompletely filled.
cancelCancelled (possibly after a partial fill).
rejectRejected by the engine, for example for insufficient balance.

Prices and amounts must respect each market's price_precision, amount_precision, min_price, max_price and min_amount from GET /api/v2/peatio/public/markets; the order API answers only a generic error.invalid_request when a value breaks these rules, so validate before sending.

Create an order

POST/api/v2/finex/market/ordersAPI key

Submits a new order to the matching engine. The body must be JSON. Write amounts and prices as plain decimal strings (e.g. "0.00007", never 7e-05) that respect the market's amount_precision, price_precision, min_amount, min_price and max_price (GET /api/v2/peatio/public/markets). HTTP 201 means the order was accepted for processing, not that it is on the book: the engine checks your balance afterwards and may reject it. Follow the order with GET /api/v2/peatio/market/orders/{uuid} or the private order WebSocket stream.

  • Requires account level 2 (verified phone number).
  • Rate limit: 50 requests per 10 seconds per account, shared by create, cancel and cancel-all. Excess requests return 429.
  • A market buy order reserves your entire available quote-currency balance until it completes.
  • Use this endpoint for order entry: POST /api/v2/peatio/market/orders is not available to regular accounts.

Parameters

NameInTypeDescription
marketrequiredbodystringMarket id, e.g. btcusdt. Must be an active spot market.
siderequiredbodystringOrder side. One of: buy, sell.
typerequiredbodystringOrder type: limit (needs price) or market. One of: limit, market.
amountrequiredbodystringOrder volume in the base currency; > 0, plain decimal notation, at most amount_precision decimals, >= min_amount.
pricebodystringLimit price in the quote currency. Required for limit orders, ignored for market orders. At most price_precision decimals, between min_price and max_price.

Responses

StatusDescription
201Accepted for processing (state pending).
400Malformed JSON or a missing/invalid field (including exponent notation): {"error":"error.bad_request"}.
401Gateway authentication failure (see Authentication errors), or account not allowed to trade: {"error":"order.action_level.not_permitted"} (level < 2) / {"error":"order.action_role.not_permitted"}.
422Rejected by validation (inactive market, precision, min/max price, min amount): {"error":"error.invalid_request"}.
429Rate limit exceeded; body is the JSON string "Too Many Requests".

Response fields

FieldTypeDescription
uuidstring (UUID)Order UUID; use it with GET /api/v2/peatio/market/orders/{uuid}.
sidestring"buy" or "sell".
typestringOrder type as sent.
marketstringMarket id.
origin_volumestring (decimal)Requested amount.
remaining_volumestring (decimal)Equals origin_volume at creation.
executed_volumestring (decimal)"0" at creation.
pricestring (decimal)Limit price ("0" for market orders).
statestringAlways "pending" in this response.
trades_countinteger0 at creation.
created_atinteger (unix seconds)Acceptance time.

Example response

JSON
{
  "uuid": "5c0de1a2-ba95-11f1-aa4a-000000000001",
  "side": "buy",
  "type": "limit",
  "market": "btcusdt",
  "origin_volume": "0.01",
  "remaining_volume": "0.01",
  "executed_volume": "0",
  "price": "84000",
  "state": "pending",
  "trades_count": 0,
  "created_at": 1790530000
}

Example request

KID="your-api-key-id"; SECRET="your-api-secret"
NONCE=$(date +%s%3N)   # Unix time in milliseconds (GNU date)
SIG=$(printf '%s' "$NONCE$KID" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')
curl -s -X POST "https://exchange.ex5.com/api/v2/finex/market/orders" \
  -H "X-Auth-Apikey: $KID" -H "X-Auth-Nonce: $NONCE" -H "X-Auth-Signature: $SIG" \
  -H "Content-Type: application/json" -d '{"market":"btcusdt","side":"buy","type":"limit","amount":"0.01","price":"84000"}'

Cancel an order

POST/api/v2/finex/market/orders/cancel/{id}API key

Requests cancellation of one of your open orders, identified by numeric id or UUID. Cancellation is asynchronous: confirm the final state with GET /api/v2/peatio/market/orders/{id} or the private order stream. A 200 body is the engine's internal order record (see FinexOrderRecord); do not rely on fields other than id and uuid.

  • The response is the engine's internal order record (side is OrderBid/OrderAsk, state is numeric, 100 = wait). Read the order with GET /api/v2/peatio/market/orders/{id} for the standard representation.

Parameters

NameInTypeDescription
idrequiredpathstringOrder id (integer) or order UUID.

Responses

StatusDescription
200Cancellation requested; returns the stored order record.
422{"error":"order is not found"}, {"error":"order is already closed"} or {"error":"error.invalid_request"} (malformed id).
401Rejected by the API gateway: missing/invalid API-key headers, nonce outside the 5 s window, bad signature, inactive key, 2FA disabled on the account, or no permission for this path. Body {"errors":["authz.<reason>"]} (Content-Type is text/plain).
429Rate limit exceeded ("Too Many Requests").

Response fields

FieldTypeDescription
idintegerOrder id.
uuidstring (UUID)Order UUID.
sidestring"OrderBid" (buy) or "OrderAsk" (sell).
typestringOrder type.
market_idstringMarket id.
stateinteger0 pending, 100 wait, 200 done, -100 cancel, -200 reject.
pricestring (decimal)Price.
volumestring (decimal)Remaining amount.
origin_volumestring (decimal)Original amount.
lockedstring (decimal)Funds currently reserved.
created_atinteger (unix seconds)Creation time.
othervariousmember_uid, member_id, ask, bid, remote_id, MarketType, Notional, origin_locked, funds_received, maker_fee, taker_fee, trades_count, username.

Example response

JSON
{
  "id": 444677012,
  "uuid": "5c0de1a2-ba95-11f1-aa4a-000000000001",
  "remote_id": {
    "String": "",
    "Valid": false
  },
  "member_uid": "ID1234567890",
  "username": "",
  "member_id": 1001,
  "ask": "btc",
  "bid": "usdt",
  "side": "OrderBid",
  "type": "limit",
  "MarketType": "",
  "price": "84000",
  "volume": "0.01",
  "origin_volume": "0.01",
  "Notional": "0",
  "market_id": "btcusdt",
  "state": 100,
  "locked": "840",
  "origin_locked": "840",
  "funds_received": "0",
  "maker_fee": "0.002",
  "taker_fee": "0.002",
  "created_at": 1790530000,
  "trades_count": 0
}

Example request

KID="your-api-key-id"; SECRET="your-api-secret"
NONCE=$(date +%s%3N)   # Unix time in milliseconds (GNU date)
SIG=$(printf '%s' "$NONCE$KID" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')
curl -s -X POST "https://exchange.ex5.com/api/v2/finex/market/orders/cancel/5c0de1a2-ba95-11f1-aa4a-000000000001" \
  -H "X-Auth-Apikey: $KID" -H "X-Auth-Nonce: $NONCE" -H "X-Auth-Signature: $SIG"

Cancel all orders

POST/api/v2/finex/market/orders/cancelAPI key

Requests cancellation of all your open orders, optionally only in one market and/or on one side. Send {} (or an empty body) to cancel everything. Asynchronous; the response only confirms the request was queued.

Parameters

NameInTypeDescription
marketbodystringOnly cancel orders in this market, e.g. btcusdt.
sidebodystringOnly cancel buy or sell orders. One of: buy, sell.

Responses

StatusDescription
200The JSON string "orders.cancel.accepted".
422Body is not valid JSON: {"error":"error.bad_request"}.
401Rejected by the API gateway: missing/invalid API-key headers, nonce outside the 5 s window, bad signature, inactive key, 2FA disabled on the account, or no permission for this path. Body {"errors":["authz.<reason>"]} (Content-Type is text/plain).
429Rate limit exceeded ("Too Many Requests").

Example response

JSON
"orders.cancel.accepted"

Example request

KID="your-api-key-id"; SECRET="your-api-secret"
NONCE=$(date +%s%3N)   # Unix time in milliseconds (GNU date)
SIG=$(printf '%s' "$NONCE$KID" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')
curl -s -X POST "https://exchange.ex5.com/api/v2/finex/market/orders/cancel" \
  -H "X-Auth-Apikey: $KID" -H "X-Auth-Nonce: $NONCE" -H "X-Auth-Signature: $SIG" \
  -H "Content-Type: application/json" -d '{"market":"btcusdt"}'

List your orders

GET/api/v2/peatio/market/ordersAPI key

Returns your orders, most recently updated first by default. Paginated with Page and Per-Page headers (this endpoint does not send Total). Time filters apply to the creation time.

Parameters

NameInTypeDescription
marketquerystringMarket id, e.g. btcusdt.
base_unitquerystringOnly orders whose base currency is this code, e.g. btc.
statequerystringFilter by state. One of: pending, wait, done, cancel, reject.
ord_typequerystringFilter by order type. One of: limit, market.
typequerystringFilter by side. One of: buy, sell.
time_fromqueryintegerUnix time in seconds; only orders created at or after this time.
time_toqueryintegerUnix time in seconds; only orders created before this time.
order_byquerystringSort by update time (default desc). One of: asc, desc.
limitqueryintegerPage size, 0-1000 (default 100).
pagequeryintegerPage number, starting at 1 (default 1).

Responses

StatusDescription
200Array of orders.
401Rejected by the API gateway: missing/invalid API-key headers, nonce outside the 5 s window, bad signature, inactive key, 2FA disabled on the account, or no permission for this path. Body {"errors":["authz.<reason>"]} (Content-Type is text/plain).
403Account level below 1: {"errors":["market.trade.not_permitted"]}.
422Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.

Response fields

FieldTypeDescription
idintegerOrder id (assigned by the engine).
uuidstring (UUID)Order UUID (returned by the create call).
sidestring"buy" or "sell".
ord_typestring"limit" or "market".
pricestring (decimal) | nullLimit price; null for market orders.
avg_pricestring (decimal)Average execution price ("0.0" until filled).
statestring"pending" (accepted, not yet on the book), "wait" (open), "done" (filled), "cancel", "reject".
marketstringMarket id.
market_typestring"spot".
created_atstring (ISO 8601 datetime, UTC)Creation time.
updated_atstring (ISO 8601 datetime, UTC)Last update time.
origin_volumestring (decimal)Original amount (base currency).
remaining_volumestring (decimal)Amount still open.
executed_volumestring (decimal)Amount filled.
maker_feestring (decimal)Maker fee rate as a fraction (e.g. "0.002" = 0.2%).
taker_feestring (decimal)Taker fee rate as a fraction.
trades_countintegerNumber of trades.
tradesarray<Trade>Only in GET /market/orders/{id}.

Example response

JSON
[
  {
    "id": 444677012,
    "uuid": "5c0de1a2-ba95-11f1-aa4a-000000000001",
    "side": "buy",
    "ord_type": "limit",
    "price": "84000.0",
    "avg_price": "0.0",
    "state": "wait",
    "market": "btcusdt",
    "market_type": "spot",
    "created_at": "2026-09-27T17:07:34Z",
    "updated_at": "2026-09-27T17:07:34Z",
    "origin_volume": "0.01",
    "remaining_volume": "0.01",
    "executed_volume": "0.0",
    "maker_fee": "0.002",
    "taker_fee": "0.002",
    "trades_count": 0
  }
]

Example request

KID="your-api-key-id"; SECRET="your-api-secret"
NONCE=$(date +%s%3N)   # Unix time in milliseconds (GNU date)
SIG=$(printf '%s' "$NONCE$KID" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')
curl -s "https://exchange.ex5.com/api/v2/peatio/market/orders?market=btcusdt&limit=50" \
  -H "X-Auth-Apikey: $KID" -H "X-Auth-Nonce: $NONCE" -H "X-Auth-Signature: $SIG"

Get one order

GET/api/v2/peatio/market/orders/{id}API key

Returns one of your orders by numeric id or UUID (the UUID is returned when you create an order), including its trades.

Parameters

NameInTypeDescription
idrequiredpathstringOrder id (integer) or order UUID.

Responses

StatusDescription
200Order with trades.
401Rejected by the API gateway: missing/invalid API-key headers, nonce outside the 5 s window, bad signature, inactive key, 2FA disabled on the account, or no permission for this path. Body {"errors":["authz.<reason>"]} (Content-Type is text/plain).
403Account level below 1: {"errors":["market.trade.not_permitted"]}.
404Record not found: {"errors":["record.not_found"]}.
422Malformed id: {"errors":["market.order.invaild_id_or_uuid"]}.

Response fields

FieldTypeDescription
idintegerOrder id (assigned by the engine).
uuidstring (UUID)Order UUID (returned by the create call).
sidestring"buy" or "sell".
ord_typestring"limit" or "market".
pricestring (decimal) | nullLimit price; null for market orders.
avg_pricestring (decimal)Average execution price ("0.0" until filled).
statestring"pending" (accepted, not yet on the book), "wait" (open), "done" (filled), "cancel", "reject".
marketstringMarket id.
market_typestring"spot".
created_atstring (ISO 8601 datetime, UTC)Creation time.
updated_atstring (ISO 8601 datetime, UTC)Last update time.
origin_volumestring (decimal)Original amount (base currency).
remaining_volumestring (decimal)Amount still open.
executed_volumestring (decimal)Amount filled.
maker_feestring (decimal)Maker fee rate as a fraction (e.g. "0.002" = 0.2%).
taker_feestring (decimal)Taker fee rate as a fraction.
trades_countintegerNumber of trades.
tradesarray<Trade>Only in GET /market/orders/{id}.

Example response

JSON
{
  "id": 444677012,
  "uuid": "5c0de1a2-ba95-11f1-aa4a-000000000001",
  "side": "buy",
  "ord_type": "limit",
  "price": "84000.0",
  "avg_price": "84000.0",
  "state": "done",
  "market": "btcusdt",
  "market_type": "spot",
  "created_at": "2026-09-27T17:07:34Z",
  "updated_at": "2026-09-27T17:07:34Z",
  "origin_volume": "0.01",
  "remaining_volume": "0.0",
  "executed_volume": "0.01",
  "maker_fee": "0.002",
  "taker_fee": "0.002",
  "trades_count": 1,
  "trades": [
    {
      "id": 5131106,
      "price": "84000.0",
      "amount": "0.01",
      "total": "840.0",
      "fee_currency": "btc",
      "fee": "0.002",
      "fee_amount": "0.00002",
      "market": "btcusdt",
      "market_type": "spot",
      "created_at": "2026-09-27T17:10:02Z",
      "taker_type": "buy",
      "side": "buy",
      "order_id": 444677012
    }
  ]
}

Example request

KID="your-api-key-id"; SECRET="your-api-secret"
NONCE=$(date +%s%3N)   # Unix time in milliseconds (GNU date)
SIG=$(printf '%s' "$NONCE$KID" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')
curl -s "https://exchange.ex5.com/api/v2/peatio/market/orders/5c0de1a2-ba95-11f1-aa4a-000000000001" \
  -H "X-Auth-Apikey: $KID" -H "X-Auth-Nonce: $NONCE" -H "X-Auth-Signature: $SIG"

List your trades

GET/api/v2/peatio/market/tradesAPI key

Returns your executed trades, newest first by default, with the fee you paid. side is your side of the trade; taker_type is the taker's side. Paginated with Page and Per-Page headers (no Total).

Parameters

NameInTypeDescription
marketquerystringMarket id, e.g. btcusdt.
typequerystringOnly trades where your side was buy or sell. One of: buy, sell.
time_fromqueryintegerUnix time in seconds; only trades executed at or after this time.
time_toqueryintegerUnix time in seconds; only trades executed before this time.
order_byquerystringSort by trade id (default desc). One of: asc, desc.
limitqueryintegerPage size, 1-1000 (default 100).
pagequeryintegerPage number, starting at 1 (default 1).

Responses

StatusDescription
200Array of trades.
401Rejected by the API gateway: missing/invalid API-key headers, nonce outside the 5 s window, bad signature, inactive key, 2FA disabled on the account, or no permission for this path. Body {"errors":["authz.<reason>"]} (Content-Type is text/plain).
403Account level below 1: {"errors":["market.trade.not_permitted"]}.
422Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.

Response fields

FieldTypeDescription
idintegerTrade id.
pricestring (decimal)Price.
amountstring (decimal)Amount (base currency).
totalstring (decimal)price x amount (quote currency).
fee_currencystringCurrency the fee was charged in (the currency you received).
feestring (decimal)Fee rate applied, as a fraction.
fee_amountstring (decimal)Fee charged.
marketstringMarket id.
market_typestring"spot".
created_atstring (ISO 8601 datetime, UTC)Execution time.
taker_typestringSide of the taker order.
sidestringYour side: "buy" or "sell".
order_idintegerYour order id.

Example response

JSON
[
  {
    "id": 5131106,
    "price": "84420.55",
    "amount": "0.01",
    "total": "844.2055",
    "fee_currency": "btc",
    "fee": "0.002",
    "fee_amount": "0.00002",
    "market": "btcusdt",
    "market_type": "spot",
    "created_at": "2026-09-27T17:10:02Z",
    "taker_type": "buy",
    "side": "buy",
    "order_id": 444677012
  }
]

Example request

KID="your-api-key-id"; SECRET="your-api-secret"
NONCE=$(date +%s%3N)   # Unix time in milliseconds (GNU date)
SIG=$(printf '%s' "$NONCE$KID" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')
curl -s "https://exchange.ex5.com/api/v2/peatio/market/trades?market=btcusdt&limit=50" \
  -H "X-Auth-Apikey: $KID" -H "X-Auth-Nonce: $NONCE" -H "X-Auth-Signature: $SIG"