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
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.
The matching engine then checks your balance. The order becomes wait (open), done (filled) or reject (for example, insufficient balance).
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.
State
Meaning
pending
Accepted, not yet processed by the engine.
wait
Open on the order book.
done
Completely filled.
cancel
Cancelled (possibly after a partial fill).
reject
Rejected 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
Name
In
Type
Description
marketrequired
body
string
Market id, e.g. btcusdt. Must be an active spot market.
siderequired
body
string
Order side. One of: buy, sell.
typerequired
body
string
Order type: limit (needs price) or market. One of: limit, market.
amountrequired
body
string
Order volume in the base currency; > 0, plain decimal notation, at most amount_precision decimals, >= min_amount.
price
body
string
Limit 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
Status
Description
201
Accepted for processing (state pending).
400
Malformed JSON or a missing/invalid field (including exponent notation): {"error":"error.bad_request"}.
401
Gateway 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"}.
422
Rejected by validation (inactive market, precision, min/max price, min amount): {"error":"error.invalid_request"}.
429
Rate limit exceeded; body is the JSON string "Too Many Requests".
Response fields
Field
Type
Description
uuid
string (UUID)
Order UUID; use it with GET /api/v2/peatio/market/orders/{uuid}.
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
Name
In
Type
Description
idrequired
path
string
Order id (integer) or order UUID.
Responses
Status
Description
200
Cancellation requested; returns the stored order record.
422
{"error":"order is not found"}, {"error":"order is already closed"} or {"error":"error.invalid_request"} (malformed id).
401
Rejected 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).
# ex5_request(): see /docs/authentication
print(ex5_request("POST", "/api/v2/finex/market/orders/cancel/5c0de1a2-ba95-11f1-aa4a-000000000001"))
// ex5Request(): see /docs/authentication
console.log(await ex5Request("POST", "/api/v2/finex/market/orders/cancel/5c0de1a2-ba95-11f1-aa4a-000000000001"));
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
Name
In
Type
Description
market
body
string
Only cancel orders in this market, e.g. btcusdt.
side
body
string
Only cancel buy or sell orders. One of: buy, sell.
Responses
Status
Description
200
The JSON string "orders.cancel.accepted".
422
Body is not valid JSON: {"error":"error.bad_request"}.
401
Rejected 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).
# ex5_request(): see /docs/authentication
print(ex5_request("POST", "/api/v2/finex/market/orders/cancel", body={"market": "btcusdt"}))
// ex5Request(): see /docs/authentication
console.log(await ex5Request("POST", "/api/v2/finex/market/orders/cancel", {"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
Name
In
Type
Description
market
query
string
Market id, e.g. btcusdt.
base_unit
query
string
Only orders whose base currency is this code, e.g. btc.
state
query
string
Filter by state. One of: pending, wait, done, cancel, reject.
ord_type
query
string
Filter by order type. One of: limit, market.
type
query
string
Filter by side. One of: buy, sell.
time_from
query
integer
Unix time in seconds; only orders created at or after this time.
time_to
query
integer
Unix time in seconds; only orders created before this time.
order_by
query
string
Sort by update time (default desc). One of: asc, desc.
limit
query
integer
Page size, 0-1000 (default 100).
page
query
integer
Page number, starting at 1 (default 1).
Responses
Status
Description
200
Array of orders.
401
Rejected 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).
# ex5_request(): see /docs/authentication
print(ex5_request("GET", "/api/v2/peatio/market/orders", params={"market": "btcusdt", "limit": "50"}))
// ex5Request(): see /docs/authentication
console.log(await ex5Request("GET", "/api/v2/peatio/market/orders", undefined, {"market":"btcusdt","limit":"50"}));
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
Name
In
Type
Description
idrequired
path
string
Order id (integer) or order UUID.
Responses
Status
Description
200
Order with trades.
401
Rejected 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).
# ex5_request(): see /docs/authentication
print(ex5_request("GET", "/api/v2/peatio/market/orders/5c0de1a2-ba95-11f1-aa4a-000000000001"))
// ex5Request(): see /docs/authentication
console.log(await ex5Request("GET", "/api/v2/peatio/market/orders/5c0de1a2-ba95-11f1-aa4a-000000000001"));
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
Name
In
Type
Description
market
query
string
Market id, e.g. btcusdt.
type
query
string
Only trades where your side was buy or sell. One of: buy, sell.
time_from
query
integer
Unix time in seconds; only trades executed at or after this time.
time_to
query
integer
Unix time in seconds; only trades executed before this time.
order_by
query
string
Sort by trade id (default desc). One of: asc, desc.
limit
query
integer
Page size, 1-1000 (default 100).
page
query
integer
Page number, starting at 1 (default 1).
Responses
Status
Description
200
Array of trades.
401
Rejected 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).