logo

REST API

GET /api/v2/public/markets/{market }/order-book

Get current OrderBook snapshot.

Params

paramtypedesc
marketstringmarket id (query param)
limitintegerlimit for amount of price levels per side
limitintegerlimit for amount of price levels per side

Responses

codedescription
200Success
400Bad request, make sure the JSON syntax of your request is correct
422Invalid request, make sure every mandatory fields are present
500Internal Server Error

Example

curl 'localhost:8080/api/v2/public/markets/btcusd/order-book?limit=2'
{"asks":[["1","3"]],"bids":[["0.5","1"],["0.4","14"]]}

POST /api/v2/market/orders

Submit a new order to finex api. Notice that while the response from the server is ok, the order can still be rejected by the matching engine. You should wait the confirmation from the websocket to be sure that your order has been added to the orderbook.

Params

paramtypedesc
marketstringmarket id
sidestringbuy or sell
amountdecimalvalid decimal value
typestringmarket, limit, post_only
pricedecimalvalid decimal value

Responses

codedescription
201Your order was submitted and awaits for processing
400Bad request, make sure the JSON syntax of your request is correct
422Invalid request, make sure every mandatory fields are present
500Internal Server Error

Example

curl -X POST localhost:8080/api/v2/market/orders \
  --data '{"market":"btcusd", "amount":"1.0","type":"limit", "side":"sell", "price":"1"}' \
  -H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
{"uuid":"b436163d-5c73-11ea-be71-1831bf9834b0","side":"sell","type":"limit","market_id":"btcusd","volume":"1","price":"1","state":"pending","created_at":1583146260

POST /api/v2/market/orders/cancel/{id|uuid }

Submit cancel request, cancels order from orderbook.

Responses

codedescription
201Your cancel request was submitted and awaits for processing
422Invalid request, make sure every mandatory fields are present
500Internal Server Error

Example

curl -X POST localhost:8080/api/v2/market/orders/cancel/1 \
  -H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
curl -X POST localhost:8080/api/v2/market/orders/cancel/b47d2527-5a0c-11ea-822c-1831bf9834b0 \
  -H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"

POST /api/v2/market/orders/cancel

Submit cancel request, cancels all your orders from orderbook.

Params

paramtypedesc
marketstringmarket id
sidestringbuy or sell

Responses

codedescription
200Your cancel request was submitted and awaits for processing
422Invalid request, make sure every mandatory fields are present
500Internal Server Error

Example

curl -X POST localhost:8080/api/v2/market/orders/cancel \
  -H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"

POST /api/v2/market/bulk/orders

Bulk api to create a list of orders in one request. The default limit is set to 100 orders for one request, this might be configured by the administrator with the finex parameter api.bulk_limit

Params

paramtypedesc
[][]objectarray of order params (refer to create order params)

Responses

codedescription
201Your order was submitted and awaits for processing
422Invalid request, make sure every mandatory fields are present
413Request entity too large. Your request contains too much orders.
500Internal Server Error

Example

curl -X POST localhost:8080/api/v2/market/bulk/orders \
--data '[{"market":"btcusd", "amount":"1.0","type":"limit", "side":"sell", "price":"1"}, {"market":"btcusd", "amount":"1.0","type":"limit", "side":"sell", "price":"1"}]' \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
[{"uuid":"b76aef45-5c73-11ea-be71-1831bf9834b0","side":"sell","type":"limit","market_id":"btcusd","volume":"1","price":"1","state":"pending","created_at":1583146265},{"uuid":"b76afa8b-5c73-11ea-be71-1831bf9834b0","side":"sell","type":"limit","market_id":"btcusd","volume":"1","price":"1","state":"pending","created_at":1583146265}]

DELETE /api/v2/market/bulk/orders

Bulk api to cancel orders.

Params

paramtypedesc
[][]stringOrder UUIDs to cancel

Responses

codedescription
200Your cancel requests were submitted and await for processing
422Invalid request, make sure every mandatory fields are present
413Request entity too large. Your request contains too much orders.
500Internal Server Error

Example

curl -X DELETE localhost:8080/api/v2/market/bulk/orders \
--data '["580d891d-5c8b-11ea-a012-1831bf9834b0", "580d891d-5c8b-11ea-a012-1831bf9834b0"]' \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
"orders.cancel.accepted"

DELETE /api/v2/market/bulk/orders_by_id

Bulk api to cancel orders.

Params

paramtypedesc
[][]integerArray of ids to cancel

Responses

codedescription
200Your cancel requests were submitted and await for processing
422Invalid request, make sure every mandatory fields are present
413Request entity too large. Your request contains too much orders.
500Internal Server Error

Example

curl -X DELETE localhost:8080/api/v2/market/bulk/orders_by_id \
--data '[1, 2, 3, 4]' \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
"orders.cancel.accepted"

POST /api/v2/admin/orders/cancel/{id|uuid }

Submit cancel request, cancels order from orderbook.

Responses

codedescription
201Your cancel request was submitted and awaits for processing
422Invalid request, make sure every mandatory fields are present
500Internal Server Error

Example

curl -X POST localhost:8080/api/v2/admin/orders/cancel/1 \
  -H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
curl -X POST localhost:8080/api/v2/admin/orders/cancel/b47d2527-5a0c-11ea-822c-1831bf9834b0 \
  -H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"

POST /api/v2/admin/orders/cancel

Submit cancel request, cancels all orders from orderbook.

NOTE: Only UID is supported now. Market and side are ignored, if UID is not provided, cancels ALL orders.

Params

paramtypedesc
marketstringmarket id
sidestringbuy or sell
uidstringmember uid

Responses

codedescription
200Your cancel request was submitted and awaits for processing
422Invalid request, make sure every mandatory fields are present
500Internal Server Error

Example

curl -X POST localhost:8080/api/v2/admin/orders/cancel \
  -H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"