Trade
Security Type: TRADE
Endpoints under Trade require an API-key and signature.
New Order
POST https://openapi.xxx.xx/sapi/v1/margin/order
Rate Limit: 100times/2s
Headers
Name | Type | Description |
X-CH-API | String | Your API-key |
X-CH-TS | String | timestamp |
X-CH-SIGN | String | Sign |
Request Body
Name | Type | Description |
type | String | Type of the order, LIMIT/MARKET |
recwindow | String | Time window |
price | number | Order price, REQUIRED for LIMIT orders |
newClientOrderId | String |
Unique order ID generated by users to mark their orders, Cannot exceed 32 characters |
side | String | Side of the order, BUY/SELL |
volume | number |
Order vol. For MARKET BUY orders, vol=amount. |
symbol | String | Symbol Name. E.g. BTCUSDT |
200:OK
{
'symbol': 'LXTUSDT',
'orderId': '494736827050147840',
'clientOrderId': '157371322565051',
'transactTime': '1573713225668',
'price': '0.005452',
'origQty': '110',
'executedQty': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'SELL'
}
weight(ID/UID):5
Query Order
GET https://openapi.xxx.xx/sapi/v1/margin/order
Rate Limit: 20times/2s
Query Parameters
Name | Type | Description |
orderId | String | Order ID |
newClientOrderId | String | Client Order Id, Unique order ID generated by users to mark their orders. E.g. 3534444heihieddada |
symbol | String | Symbol Name.E.g BTCUSDT header |
Headers
Name | Type | Description |
X-CH-API | String | Your API-key |
X-CH-TS | String | timestamp |
X-CH-SIGN | String | Sign |
200:OK
{
'orderId': '499890200602846976',
'clientOrderId': '157432755564968',
'symbol': 'BHTUSDT',
'price': '0.01',
'origQty': '50',
'executedQty': '0',
'avgPrice': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'BUY',
'transactTime': '1574327555669'
}
weight(ID/UID):5
Cancel Order
POST https://openapi.xxx.xx/sapi/v1/margin/cancel
Rate Limit: 100times/2s
Headers
Name | Type | Description |
X-CH-SIGN | String | Sign |
X-CH-TS | String | timestamp |
X-CH-APIKEY | String | Your API-key |
Request Body
Name | Type | Description |
newClientOrderId | String | Symbol Name. E.g. BTCUSDT Responses200GET |
symbol | String | Client Order Id, Unique order ID generated by users to mark their orders. E.g. 354444heihieddada |
orderId | String | Order ID |
200:OK
{
'symbol': 'BHTUSDT',
'clientOrderId': '0',
'orderId': '499890200602846976',
'status': 'CANCELED'
}
weight(IP/UID):5
Current Open Orders
GET https://openapi.xxx.xx/sapi/v1/margin/openOrders
Rate Limit: 20times/2s
Query Parameters
Name | Type | Description |
symbol | String | Symbol Name.E.g. BTCUSDT |
limit | String | Default 100; Max 1000 |
Headers
Name | Type | Description |
X-CH-SIGN | String | Sign |
X-CH-TS | String | timestamp |
X-CH-APIKEY | String | Your API-key |
200:OK
[
{
'orderId': '499902955766523648',
'symbol': 'BHTUSDT',
'price': '0.01',
'origQty': '50',
'executedQty': '0',
'avgPrice': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'BUY',
'time': '1574329076202'
},...
]
weight(IP/UID):1
Trades
GET https://openapi.xxx.xx/sapi/v1/margin/myTrades
Query Parameters
Name | Type | Description |
symbol | String | Symbol Name.E.g. BTCUSDT |
limit | String | Default 100; Max 1000 |
fromId | String | Trade Id to fetch from |
Headers
Name | Type | Description |
X-CH-SIGN | String | Sign |
X-CH-TS | String | timestamp |
X-CH-APIKEY | String | Your API-key |
200:OK
[
{
"symbol": "ETHBTC",
"id": 100211,
"bidId": 150695552109032492,
"askId": 150695552109032493,
"price": "4.00000100",
"qty": "12.00000000",
"time": 1499865549590,
"isBuyer": true,
"isMaker": false,
"feeCoin": "ETH",
"fee":"0.001"
},...
]
weight(IP/UID):1