Get current OrderBook snapshot.
param | type | desc |
---|
market | string | market id (query param) |
limit | integer | limit for amount of price levels per side |
limit | integer | limit for amount of price levels per side |
code | description |
---|
200 | Success |
400 | Bad request, make sure the JSON syntax of your request is correct |
422 | Invalid request, make sure every mandatory fields are present |
500 | Internal Server Error |
curl 'localhost:8080/api/v2/finex/public/markets/btcusd/order-book?limit=2'
{"asks":[["1","3"]],"bids":[["0.5","1"],["0.4","14"]]}
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.
param | type | desc |
---|
market | string | market id |
side | string | buy or sell |
amount | decimal | valid decimal value |
type | string | market, limit, post_only |
price | decimal | valid decimal value |
quote_amount | decimal | [OPTIONAL] Only for market buy orders, allows to set how much you are willing to spend to buy a currency |
code | description |
---|
201 | Your order was submitted and awaits for processing |
400 | Bad request, make sure the JSON syntax of your request is correct |
422 | Invalid request, make sure every mandatory fields are present |
500 | Internal Server Error |
curl -X POST localhost:8080/api/v2/finex/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
Submit cancel request, cancels order from orderbook.
code | description |
---|
201 | Your cancel request was submitted and awaits for processing |
422 | Invalid request, make sure every mandatory fields are present |
500 | Internal Server Error |
curl -X POST localhost:8080/api/v2/finex/market/orders/cancel/1 \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
curl -X POST localhost:8080/api/v2/finex/market/orders/cancel/b47d2527-5a0c-11ea-822c-1831bf9834b0 \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
Submit cancel request, cancels all your orders from orderbook.
param | type | desc |
---|
market | string | market id |
side | string | buy or sell |
code | description |
---|
200 | Your cancel request was submitted and awaits for processing |
422 | Invalid request, make sure every mandatory fields are present |
500 | Internal Server Error |
curl -X POST localhost:8080/api/v2/finex/market/orders/cancel \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
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
param | type | desc |
---|
[] | []object | array of order params (refer to create order params) |
code | description |
---|
201 | Your order was submitted and awaits for processing |
422 | Invalid request, make sure every mandatory fields are present |
413 | Request entity too large. Your request contains too much orders. |
500 | Internal Server Error |
curl -X POST localhost:8080/api/v2/finex/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}]
Bulk api to cancel orders.
param | type | desc |
---|
[] | []string | Order UUIDs to cancel |
code | description |
---|
200 | Your cancel requests were submitted and await for processing |
422 | Invalid request, make sure every mandatory fields are present |
413 | Request entity too large. Your request contains too much orders. |
500 | Internal Server Error |
curl -X DELETE localhost:8080/api/v2/finex/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"
Bulk api to cancel orders.
param | type | desc |
---|
[] | []integer | Array of ids to cancel |
code | description |
---|
200 | Your cancel requests were submitted and await for processing |
422 | Invalid request, make sure every mandatory fields are present |
413 | Request entity too large. Your request contains too much orders. |
500 | Internal Server Error |
curl -X DELETE localhost:8080/api/v2/finex/market/bulk/orders_by_id \
--data '[1, 2, 3, 4]' \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
"orders.cancel.accepted"
Submit cancel request, cancels order from orderbook.
code | description |
---|
201 | Your cancel request was submitted and awaits for processing |
422 | Invalid request, make sure every mandatory fields are present |
500 | Internal Server Error |
curl -X POST localhost:8080/api/v2/finex/admin/orders/cancel/1 \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
curl -X POST localhost:8080/api/v2/finex/admin/orders/cancel/b47d2527-5a0c-11ea-822c-1831bf9834b0 \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"
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.
param | type | desc |
---|
market | string | market id |
side | string | buy or sell |
uid | string | member uid |
code | description |
---|
200 | Your cancel request was submitted and awaits for processing |
422 | Invalid request, make sure every mandatory fields are present |
500 | Internal Server Error |
curl -X POST localhost:8080/api/v2/finex/admin/orders/cancel \
-H 'Content-Type: application/json' -H "Authorization: Bearer ${JWT}"