Rest API for ACEX
Introduction
This document details the use of ACEX’s REST API for spot exchange. Our REST API is organized into publicly accessible endpoints (market data), and private authenticated endpoints (trading, funding) which require requests to be signed.
API Key Setup
- Some endpoints will require an API Key. Please refer to this page regarding API key creation.
- Never share your API key/secret key to ANYONE. If the API keys were accidentally shared, please delete them immediately and create a new key.
Contact Us
- ACEX Email
- Please email us at
[email protected]
- Please email us at
General API Information
- The base endpoint is:
https://api.acex.market
- All endpoints return either a JSON object or array.
HTTP Return Status
- HTTP
200
return codes are used for success; - HTTP
302
return codes are used for validaion errors; the issue is on the sender's side. - HTTP
400
return codes are used for malformed requests; the issue is on the sender's side. - HTTP
403
return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP
5XX
return codes are used for internal errors; the issue is on ACEX's side. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success.
Error Codes and Messages
Sample Payload below:
{
"status": 302,
"message": "Invalid pair symbol."
}
- If there is an error, the API will return an error with a message of the reason.
- Specific error status and messages defined in Error status.
- Any endpoint can return an ERROR
General Information on Endpoints
- For
GET
endpoints, parameters must be sent as aquery string
. - Parameters may be sent in any order.
- If a parameter sent in both the
query string
andrequest body
, thequery string
parameter will be used.
GET API Endpoints
- Available pairs GET
- Tickers Pairs GET
- Single Ticker Pair Details GET
- Order Book GET
- Trade History GET
https://api.acex.market/v1/trade/available-pairs
https://api.acex.market/v1/trade/tickers
https://api.acex.market/v1/trade/tickers/BTC_USDT
https://api.acex.market/v1/trade/order_book/BTC_USDT
https://api.acex.market/v1/trade/trade_history/BTC_USDT
POST API Endpoints
Buy order
POST /api/v1/order/create/buy-order
curl --location --request POST 'https://api.acex.market/v1/order/create/buy-order'
--body parames {
"api_key": "your api_key",
"secret_key": "your api secret_key",
"from_currency_price": "1.00000000",
"to_currency_price": "3.00000000",
"total": "3.00000000",
"order": "limit",
"pair": "BTC/USDT",
"type": "buy"
}
Response:
{
"status": "200",
"message": "buy order placed successfully",
"details":{
"orderId": "QnEwVit3b2ZjVW1WNVUyL2lHOHdIUT09",
"pair": "BTC/USDT",
"orderDate": "timestamp",
"orderStatus": "active",
}
}
Place in a new buy order.
Body Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
api_key | STRING | YES | |
secret_key | STRING | YES | |
from_currency_price | DECIMAL | YES | |
to_currency_price | DECIMAL | YES | |
total | DECIMAL | YES | multiply of from & to currency(1.0*3.0) |
order | STRING | YES | limit or stoporder |
pair | STRING | YES | |
type | STRING | YES | buy |
Additional mandatory parameters based on type
:
Type | Additional mandatory parameters |
---|---|
limit |
from_currency_price , to_currency_price ,total |
stoporder |
from_currency_price , to_currency_price ,total |
Sell order
POST /api/v1/order/create/sell-order
curl --location --request POST 'https://api.acex.market/v1/order/create/sell-order'
--body parames {
"api_key": "your api_key",
"secret_key": "your api secret_key",
"from_currency_price": "1.00000000",
"to_currency_price": "3.00000000",
"total": "3.00000000",
"order": "limit",
"pair": "BTC/USDT",
"type": "sell"
}
Response:
{
"status": "200",
"message": "sell order placed successfully",
"details":{
"orderId": "QnEwVit3b2ZjVW1WNVUyL2lHOHdIUT09",
"pair": "BTC/USDT",
"orderDate": "timestamp",
"orderStatus": "active",
}
}
Place in a new sell order.
Body Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
api_key | STRING | YES | |
secret_key | STRING | YES | |
from_currency_price | DECIMAL | YES | |
to_currency_price | DECIMAL | YES | |
total | DECIMAL | YES | multiply of from & to currency(1.0*3.0) |
order | STRING | YES | limit or stoporder |
pair | STRING | YES | |
type | STRING | YES | sell |
Additional mandatory parameters based on type
:
Type | Additional mandatory parameters |
---|---|
limit |
from_currency_price , to_currency_price ,total |
stoporder |
from_currency_price , to_currency_price ,total |
Current open orders
POST /api/v1/order/open-orders
curl --location --request POST 'https://api.acex.market/v1/order/open-orders'
--body parames {
"api_key": "your api_key",
"secret_key": "your api secret_key",
"pair": "BTC/USDT",
}
Response:
{
"status": "200",
"message": "Success",
"active_orders":[
{
"pair": "BTC/USDT",
"datetime": "timestamp",
"type": "Buy",
"from_currency_price": "1.00000000",
"to_currency_price": "1.00000000",
"total": "1.00000000",
"orderid": "MWhtUlM0SEpMOE5VV2wrakY5VmFudz09",
},
{
"pair": "BTC/USDT",
"datetime": "timestamp",
"type": "Sell",
"from_currency_price": "2.00000000",
"to_currency_price": "1.00000000",
"total": "1.00000000",
"orderid": "QnEwVit3b2ZjVW1WNVUyL2lHOHdIUT09",
},...etc,
}
Get all open orders on a symbol.
Body Parameters:
Name | Type | Mandatory | |
---|---|---|---|
api_key | STRING | YES | |
secret_key | STRING | YES | |
pair | STRING | YES |
Cancel order
POST /api/v1/order/cancel
curl --location --request POST 'https://api.acex.market/v1/order/cancel'
--body parames {
"api_key": "your api_key",
"secret_key": "your api secret_key",
"tradeid": "Q3lsQzJ4eUJ2ZmRrcisvL0pLL2xuZz09",
}
Response:
{
"status": "200",
"message": "Order cancelled successfully",
"details":{
"orderId": "QnEwVit3b2ZjVW1WNVUyL2lHOHdIUT09",
"pair": "BTC/USDT",
"type": "Buy",
"status": "cancelled",
"date": "timestamp",
}
}
Cancel order for given orderId.
Body Parameters:
Name | Type | Mandatory |
---|---|---|
api_key | STRING | YES |
secret_key | STRING | YES |
tradeid | STRING | YES |
My Trades History
POST /api/v1/order/my-history
curl --location --request POST 'https://api.acex.market/v1/order/my-history'
--body parames {
"api_key": "your api_key",
"secret_key": "your api secret_key",
"pair": "BTC/USDT",
}
Response:
{
"status": "200",
"message": "Success",
"my_history":[
{
"pair": "BTC/USDT",
"datetime": "timestamp",
"type": "Buy",
"from_currency_price": "1.00000000",
"to_currency_price": "1.00000000",
"total": "1.00000000",
"status": "Cancelled",
},
{
"pair": "BTC/USDT",
"datetime": "timestamp",
"type": "Sell",
"from_currency_price": "2.00000000",
"to_currency_price": "1.00000000",
"total": "1.00000000",
"status": "Filled",
},...etc,
}
Get trades for a specific pair.
Body Parameters:
Name | Type | Mandatory |
---|---|---|
api_key | STRING | YES |
secret_key | STRING | YES |
pair | STRING | YES |
Account Endpoints
Fund details
GET /v1/user
curl --location --request POST 'https://api.acex.market/v1/user/funds'
--body parames {
"api_key": "your api_key",
"secret_key": "your api secret_key",
}
Response:
{
"status": "200",
"message": "Success",
"asset":[
{
"asset": "btc",
"balance": "2.00123452",
},
{
"asset": "bnb",
"balance": "10.00123452",
},.....etc
]
}
Get fund details for current account.
Body Parameters:
Name | Type | Mandatory |
---|---|---|
api_key | String | Yes |
secret_key | String | YES |