Information
- The base endpoint is https://api.tas.getprimex.com
- All endpoints return JSON object or array
- All time and timestamp related fields are in milliseconds.
- All time and timestamp used UTC.
HTTP 4XXreturn codes are used for invalid requests, the issue is on the client side.HTTP 429return codes is used for request rate limitHTTP 5XXreturn codes are used for internal errors, the issue is on the server side.- Any endpoint can return an ERROR, the error payload is as follows:
{
"code": 20001,
"msg": "Invalid API key or secret."
}
- Specific error codes and messages defined all methods inside.
- For
GETendpoints, parameters must be sent as aquerystring - For
POST,PUT,DELETEendpoints, parameters send bothquerystringor/andbody. If you send both of them we choicebodyparameters value.
Limits
- A
HTTP 429will be returned when either rate limit is violated. - When a
HTTP 429is recieved, it`s your obligation as an API to back off and not spam the API.
Security
- Signed Security
A signed endpoint require signature parameter
Endpoints use HMAC SHA256 signatures. Use your apiSecret as the key and all parameters signed.
- Timestamp Security
A signed endpoint require timestamp parameter.
An additional parameter windowSize, IF sent to specify the number of milliseconds after timestamp the request is valid for. If windowSize is not sent, it defaults to 10000.
serverTime and timestamp parameter difference bigger than windowSize the request is invalid.
let windowSize = 10000;
if (serverTime - timestamp <= windowSize) {
//accept request
} else {
// reject request with code: "20004"
}
- Example Signed Request
a signed request request example is as follows:
| Key | Value |
|---|---|
| apiKey | 21d5513bf73f16798002f615a3293c66a450113a |
| apiSecret | 3f03ca9ea806d6e9d3d6e65f2f5e42fe07a67a0c |
- Get Time
[linux]$ date +%s"
1702901757
Linux date output is second. We always used milliseconds. So you must multiply output 1000
HMAC signature:
[linux]$ echo -n "timestamp=1702901757000" | openssl dgst -sha256 -hmac "3f03ca9ea806d6e9d3d6e65f2f5e42fe07a67a0c"
(stdin)= c197c1d80c684532dc066394e88278227b0dd194b28ae1e58b890fdf6911c143
- Signed Test Request:
[linux]$ curl -H "X-APNK-APIKEY: 21d5513bf73f16798002f615a3293c66a450113a" -X POST "https://api.tast.getprimex.com/v3/api/auth-api-test?timestamp=1702901757000&windowSize=1000&signature=c197c1d80c684532dc066394e88278227b0dd194b28ae1e58b890fdf6911c143"
{
//Response
"code":"00000"
}
General Endpoints
Connectivity Test
Connectivity test to the REST API.
- Method
GET
- Parameters
NONE
- Request
v3/api/ping
{
//Response
"code":"00000",
"data":"PONG"
}
- Example
curl https://api.tas.getprimex.com/v3/api/ping
Check Server Time
Get the current server time
- Method
GET
- Parameters
NONE
- Request
v3/api/time
{
//request
"code":"00000",
"data":1702902046489
}
- Example
curl https://api.tas.getprimex.com/v3/api/time
API Authentication Test
API Authentication test method.
- Method
POST
- Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| x-apnk-apikey | STRING | YES | Private API key Must be Request Header |
| timestamp | LONG | YES | Request datetime timestamp(ms) |
| signature | STRING | YES | Request hashed signature with API secret |
| windowSize | INT | NO | Allowable client and server time diff |
- Request
v3/api/auth-api-test
{
//Response
"code":"00000",
}
- Example
[linux]$ curl -H "X-APNK-APIKEY: 21d5513bf73f16798002f615a3293c66a450113a" -X POST "https://api.taas.getprimex.com/v3/api/auth-api-test?timestamp=1702901757000&windowSize=1000&signature=790e8e78a273f1e755f2e07d0c10e6034b6f653daf086755d9b31f40c9bfc689"
Websocket Data Streams
- The base endpoint is wss://api.tas.getprimex.com
- Streams can be access either in a single raw stream or a combined stream
- All symbols for streams are UPPERCASE
All messages should be send STRINGIFY
The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams.
Subscribe a stream
Subscription specific message for symbol
- Request
{ method: "SUBSCRIBE", params: [ { type: "allTickers" } ] }
- Response
{ "method":"SUBSCRIBE", "status":"success", "type":"allTickers" }
Unsubscribe a stream
Unsubscription specific message for symbol
- Request
{ method: "UNSUBSCRIBE", params: [ { type: "allTickers" } ] }
- Response
{ "method":"UNSUBSCRIBE", "status":"success", "type":"allTickers" }
Listing Subscriptions
Listing all active subscriptions
- Request
{ "method":"LIST_SUBSCRIPTIONS" }
- Response
{ "method":"LIST_SUBSCRIPTIONS", "status":"success", "result":[ { "type":"orderBook", "symbol":"BTCUSDT" }, { "type":"depth", "symbol":"BTCUSDT" }, ... ] }
Market Endpoints
Create New Market
Create a new market(pair)
- Method:
POST
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| name | STRING | YES |
| firstSymbol | STRING | YES |
| secondSymbol | STRING | YES |
| firstSymbolMaxLength | INTEGER | YES |
| secondSymbolMaxLength | INTEGER | YES |
| totalMaxLength | INTEGER | YES |
| minAmount | INTEGER | YES |
| maxAmount | INTEGER | YES |
| commissionTaker | FLOAT | YES |
| commissionMaker | FLOAT | YES |
| commissionFactor | FLOAT | YES |
| enable | BOOL | YES |
| orderEnable | BOOL | YES |
| cancelEnable | BOOL | YES |
| liquidity | INTEGER | YES |
- Parameters: Parameters must send with body
- Request
v3/api/market/new
{
//Response
{
"code":"00000",
"info":{
"symbol":"BTCUSD",
"firstSymbol":"BTC",
"secondSymbol":"USD",
"firstSymbolMaxLength":6,
"secondSymbolMaxLength":0,
"minTradeTotal":10,
"minAmount":0.000001,
"commissionFactor":1,
"enable":"true",
"cancelEnable":"true",
"orderEnable":"true",
"commissionTaker":0.2,
"commissionMaker":0.2,
"commissionPercentage":true,
"commissionTierBased":false,
"liquidity":0,
"precision":{
"price":0,
"amount":6,
"total":0
}
}
}
}
- Example
curl https://api.tas.getprimex.com/v3/api/market/new
- Possible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10001 | Pair already exist |
| 10002 | İnvalid symbol |
| 10003 | İnvalid name |
| 10004 | İnvalid firstSymbol |
| 10005 | İnvalid secondSymbol |
| 10006 | İnvalid liquidity provider |
| 90000 | Unexpected Error |
- Update Market
curl https://api.tas.getprimex.com/v3/api/market/update
Get All Markets 24h
Get all available markets last 24h statistics
- Method:
GET
- Parameters:
NONE
- Request
v3/api/market/markets
{
//Response
"code":"00000",
"markets":
[
{
"symbol": "BTCUSD",
"name": "Bitcoin",
"firstSymbol": "BTC",
"secondSymbol": "USD",
"changeAmount": 498,
"changePercent": 0.83,
"last": 60000,
"firstBid": 59999,
"firstAsk": 60001,
"open": 59502,
"high": 61000,
"low": 59000,
"avg": 60002,
"volume": 2,
"openTime": 1577738760005,
"tradeCount": 23
}
]
}
- Example
curl https://api.tas.getprimex.com/v3/api/market/markets
- Possible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 90000 | Unexpected Error |
Get Symbol 24h Statistics
Get symbol market last 24h statistics
- Method
GET
- Parameters
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
- Request
v3/api/market/24h
{
//Response
"code": "00000",
"market": {
"symbol": "BTCUSD",
"changeAmount": 498,
"changePercent": 0.83,
"last": 60000,
"firstBid": 59999,
"firstAsk": 60001,
"open": 59502,
"high": 61000,
"low": 59000,
"avg": 60002,
"volumeQty": 2,
"volume": 120004,
"openTime": 1577738760005,
"tradeCount": 23
}
}
Example
curl https://api.tas.getprimex.com/v3/api/market/24h?symbol=BTCUSDPossible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10037 | Invalid symbol |
| 90000 | Unexpected Error |
Get Symbol Detailed Info
Get actual order book for a symbol
- Method
GET
- Parameters
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
- Request
v3/api/market/info
{
//Response
{
"code":"00000",
"info":{
"symbol":"BTCUSD",
"firstSymbol":"BTC",
"secondSymbol":"USD",
"firstSymbolMaxLength":6,
"secondSymbolMaxLength":0,
"minTradeTotal":10,
"minAmount":0.000001,
"commission":0.2,
"enable":"true",
"cancelEnable":"true",
"orderEnable":"true",
"commissionTaker":0.2,
"commissionMaker":0.2,
"commissionPercentage":true,
"commissionTierBased":false,
"precision":{
"price":0,
"amount":6,
"total":0
}
}
}
}
Example
curl https://api.tas.getprimex.com/v3/api/market/info?symbol=BTCUSDPossible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10037 | Invalid symbol |
| 90000 | Unexpected Error |
Get Symbol Candlestick Data
Get selected markets candle
- Method:
GET
- Parameters:
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| startDate | LONG | NO |
| endDate | LONG | NO |
| interval | STRING | NO |
- Request
v3/api/market/candles
{
//Response
"code":"00000",
"candles":
[
{
"open": 48657,
"low": 48000,
"high": 48999,
"close": 48980,
"volume": 2,
"openTime": 1577738760005,
"closetime": 1577738820005
},
]
}
- Example
curl https://api.tas.getprimex.com/v3/api/market/candles?symbol=BTCTRY&interval=m1
- Possible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10037 | Invalid symbol |
| 90000 | Unexpected Error |
- Intervals
| m1 |
| m3 |
| m5 |
| m15 |
| m30 |
| h1 |
| h2 |
| h4 |
| d1 |
Get Symbol Orderbook
Get actual order book first buy and sell order for a symbol
- Method
GET
- Parameters
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
- Request
v3/api/market/orderbook
{
//Response
"code":"00000",
"book":
{
"bids":
[
{
"price": 47002,
"amount": 0.0446
}
],
"asks":
[
{
"price": 47003,
"amount": 0.23
}
]
}
}
- Example
curl https://api.tas.getprimex.com/v3/api/market/orderbook?symbol=BTCTRY
- Possible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10037 | Invalid symbol |
| 90000 | Unexpected Error |
Get Symbol Order Depth
Get actual order book first buy and sell order for a symbol
- Method
GET
- Parameters
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
- Request
v3/api/market/depth
{
//Response
"code":"00000",
"book":
{
"bids":
[
{
"price": 47002,
"amount": 0.0446,
"count": 4,
},
{
"price": 47001,
"amount": 0.012,
"count": 5,
},
{
"price": 47000,
"amount": 0.012,
"count": 2,
}
...
],
"asks":
[
{
"price": 47003,
"amount": 0.23,
"count": 2,
},
{
"price": 47004,
"amount": 0.0123,
"count": 2,
}{
"price": 47005,
"amount": 0.017,
"count": 2,
}
...
]
}
}
Example
curl https://api.tas.getprimex.com/v3/api/market/depth?symbol=BTCTRYPossible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10037 | Invalid symbol |
| 90000 | Unexpected Error |
Get Symbol Trade History
Get last trades for a symbol
- Method
GET
- Parameters
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
- Request
v3/api/market/trades
{
//Response
"code":"00000",
"trades":
[
{
"price": 47003,
"amount": 0.23,
"time": 1577891201415,
"type": 0 //BUYER IS MAKER
}
]
}
- Example
curl https://api.tas.getprimex.com/v3/api/market/trades?symbol=BTCTRY
- Possible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10037 | Invalid symbol |
| 90000 | Unexpected Error |
Get Symbol Trade History All
Get all trades for a symbol
- Method
GET
- Parameters
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| startDate | LONG | YES |
| endDate | LON | YES |
| page | INTEGER | NOW |
- Request
v3/api/market/history
{
//Response
"code":"00000",
"history":
[
{
"price": 47003,
"amount": 0.23,
"time": 1577891201415,
"type": 0 //BUYER IS MAKER
"buyerId": 9f8dfb6ab8358e42ecc7abd564dc49c0603dc49aff194932f9ad4fa707e7949bebb37028,
"sellerId": 9dd4ad6cbb638e1fec9bfb8238dc49923b6dc4c3a7464132fbff4ea702e7c092ebb32b2e,
"buyerCommission": 0.01,
"buyerCommissionSymbol": BTC,
"sellerCommission": 4.15,
"sellerCommissionSymbol": TRY,
"liquidity": 0,
},
{
"price": 47003,
"amount": 0.23,
"time": 1577891201415,
"type": 0 //BUYER IS MAKER
"buyerId": 9f8dfb6ab8358e42ecc7abd564dc49c0603dc49aff194932f9ad4fa707e7949bebb37028,
"sellerId": 9dd4ad6cbb638e1fec9bfb8238dc49923b6dc4c3a7464132fbff4ea702e7c092ebb32b2e,
"buyerCommission": 0.01,
"buyerCommissionSymbol": BTC,
"sellerCommission": 4.15,
"sellerCommissionSymbol": TRY,
"liquidity": 0,
}
],
"pagination": //Default offset 100 items.
{
"currentPage": 1,
"totalItems": 2,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
- Example
curl https://api.tas.getprimex.com/v3/api/market/history?symbol=BTCTRY&startDate=1502902046489&endDate=1702902046489
- Possible Return Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10037 | Invalid symbol |
| 90000 | Unexpected Error |
Market Data Streams
All Tickers 24H Statistics
Handling all market updates with 24h statistics, you can subscribe allTickers channel.
- This updates period, if available
2000 ms - When subscribe All Tickers you can handle all market changes.
- This message only send if a market any value has changed.
We send only updated market statistic. If you need all markets data you can use our REST services.
Subscription Request
{ method: "SUBSCRIBE", params: [ { type: "allTickers" } ] }
- Subscription Response
{ "method":"SUBSCRIBE", "status":"success", "type":"allTickers" }
{
//Example allTickers payload
"type":"allTickers",
"symbol":"BTCUSD",
"changeAmount":1,
"changePercent":0.0018,
"firstBid":54500,
"firstAsk":54501,
"open":54500,
"high":54501,
"low":54500,
"avg":54500.5,
"last":54501,
"volume":54501,
"volumeQty":1,
"openTime":1587923986290,
"tradeCount":2
}
Market 24H Statistics
Handling specific market updates with 24h statistics, you can subscribe ticker channel.
- This updates period, if available
2000 ms - When subscribe a market ticker, you can handle market all changes.
- This message only send if market any value has changed.
We send only subscription market statistic. If you need all markets updates you can subscribe
allTickersservices or or you can use our REST services.Subscription Request
{ method: "SUBSCRIBE", params: [ { type: "ticker", symbol: "BTCUSD" } ] }
- Subscription Response
{ "method":"SUBSCRIBE", "status":"success", "type":"ticker", "symbol":"BTCUSD" }
{
//Example allTickers payload
"type":"ticker",
"symbol":"BTCUSD",
"changeAmount":0,
"firstBid":54500,
"firstAsk":54501,
"open":54500,
"high":54500,
"low":54500,
"avg":54500,
"last":54500,
"volume":54500,
"volumeQty":1,
"tradeCount":1
}
Market Candlestick Updates
Handling market candlestick updates, you can subscribe candles channel for a specific market.
- This updates period, if available
1000 ms - When subscribe Candles you can handle market candlestick data updates.
- This message only send if a candlestick close price has changed.
We send only actual candlestick data for interval. If you need more candlestick data you can use our REST services.
Subscription Request
{ method: "SUBSCRIBE", params: [ { type: "candles",symbol: "BTCTRY","interval": "m5" } ] }
- Subscription Response
{ "method":"SUBSCRIBE", "status":"success", "type":"candles", "symbol":"BTCTRY", "interval":"m5", }
- Available Intervals
| m1 |
| m3 |
| m5 |
| m15 |
| m30 |
| h1 |
| h2 |
| h4 |
| d1 |
{
//Example candles payload
"type":"candles",
"symbol":"BTCTRY",
"interval":"m5",
"kline":{
"openTime":1588010100000,
"open":54500,
"low":54500,
"high":54500,
"close":54500,
"volume":0.0005,
"closeTime":1588010323000
}
}
Market Order Book Updates
Handling market first buy and sell price/amount updates, you can subscribe orderBook channel for a specific market.
- This updates period, if available
250 ms - When subscribe order book you can handle markets first buy and first sell price and amount data.
- This message only send if market first buy or sell order amount or price has changed.
If you need more depth data you can subscribe
depthservices or you can use our REST services.Subscription Request
{ method: "SUBSCRIBE", params: [ { type: "orderBook",symbol: "BTCTRY" } ] }
- Subscription Response
{ "method":"SUBSCRIBE", "status":"success", "type":"orderBook", "symbol":"BTCTRY", }
{
//Example orderBook payload
"type":"orderBook",
"symbol":"BTCTRY",
"bidPrice":54500,
"bidAmount":0.001,
"askPrice":54501,
"askAmount":0.001
}
Market Depth Updates
Handling market depth updates, you can subscribe depth channel for a specific market.
- This updates period, if available
500 ms - When subscribe Depth you can handle market depth data updates.
This message only send if a depth has changed.
Subscription Request
{ method: "SUBSCRIBE", params: [ { type: "depth",symbol: "BTCTRY" } ] }
- Subscription Response
{ "method":"SUBSCRIBE", "status":"success", "type":"depth", "symbol":"BTCTRY", }
{
//Example depth payload
"type":"depth",
"symbol":"BTCTRY",
"depth":{
"bids":[
{"price":54500,"amount":0.001,"count":1},
{"price":54499,"amount":0.001,"count":1},
{"price":54498,"amount":0.001,"count":1}
...],
"asks":[
{"price":54501,"amount":0.001,"count":1},
{"price":54502,"amount":0.001,"count":1},
{"price":54503,"amount":0.001,"count":1}
...]
}
}
Market Trade Updates
Handling specific market trades, you can subscribe trade channel.
- This updates period
REAL-TIME - When subscribe a market trade, you can handle market trades.
We send only subscription market actual trades. If you need more trade data you can use our REST services.
Subscription Request
{ method: "SUBSCRIBE", params: [ { type: "trade", symbol: "BTCTRY" } ] }
- Subscription Response
{ "method":"SUBSCRIBE", "status":"success", "type":"trade", "symbol":"BTCTRY" }
- Trade Type Reference
| Value | Meaning |
|---|---|
| 0 | Buyer is maker |
| 1 | Buyer is taker |
{
//Example allTickers payload
"type":"trade",
"symbol":"BTCTRY",
"amount":0.0005,
"price":54500,
"tradeType":1,
"time":1588010323279
}
Signed Market Endpoints
New Limit Buy Order
Create new limit buy order
- Method:
POST
Parameters:
Parameters must send with body
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| price | FLOAT | YES |
| amount | FLOAT | YES |
- Request
v3/api/market/limit-buy
{
//Response
"code": "00000",
"order":{
"status": "NEW",
"orderId": "ce82ac3aed3e8b1cecc6fcd36ddc49936866c49bfa4f4f32fbfc12a005e995c9b3b52e2b",
"market":"BTCUSDT",
"orderType": "LIMIT",
"side": "BUY",
"price": 9500,
"amount": 0.001,
"filledAmount": 0,
"time": 1578405048608
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10031 | Insufficient balance |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10062 | Buy Price is not lower than %40 |
| 20000 | Authorization required |
| 20007 | Price must be float and higher than 0 |
| 20009 | Amount must be float and higher than 0 |
| 90000 | Unexpected Error |
| 00000 | Success |
New Limit Sell Order
Create new limit sell order
- Method:
POST
Parameters:
Parameters must send with body
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| price | FLOAT | YES |
| amount | FLOAT | YES |
- Request
v3/api/market/limit-sell
{
//Response
"code": "00000",
"order":{
"status": "NEW",
"orderId": "ce82ac3aed3e8b1cecc6fcd36ddc49936866c49bfa4f4f32fbfc12a005e995c9b3b52e2b",
"market":"BTCUSDT",
"orderType": "LIMIT",
"side": "SELL",
"price": 9500,
"amount": 0.001,
"filledAmount": 0,
"time": 1578405048608
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10031 | Insufficient balance |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10061 | Sell Price is not higher than %250 |
| 20000 | Authorization required |
| 20007 | Price must be float and higher than 0 |
| 20009 | Amount must be float and higher than 0 |
| 90000 | Unexpected Error |
| 00000 | Success |
New Market Buy Order
Create new market buy order
- Method:
POST
Parameters:
Parameters must send with body
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| amount | FLOAT | YES |
- Request
v3/api/market/market-buy
{
//Response
"code": "00000",
"order":{
"status": "FILLED",
"market":"BTCUSDT",
"orderType": "MARKET",
"side": "BUY",
"amount": 0.001,
"filledAmount": 0.001,
"time": 1578405048608
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10031 | Insufficient balance |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10042 | Market order not available |
| 20000 | Authorization required |
| 20009 | Amount must be float and higher than 0 |
| 90000 | Unexpected Error |
| 00000 | Success |
New Market Sell Order
Create new market sell order
- Method:
POST
Parameters:
Parameters must send with body
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| amount | FLOAT | YES |
- Request
v3/api/market/market-sell
{
//Response
"code": "00000",
"order":{
"status": "FILLED",
"market":"BTCUSDT",
"orderType": "MARKET",
"side": "SELL",
"amount": 0.001,
"filledAmount": 0.001,
"time": 1578405048608
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10031 | Insufficient balance |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10042 | Market order not available |
| 20000 | Authorization required |
| 20009 | Amount must be float and higher than 0 |
| 90000 | Unexpected Error |
| 00000 | Success |
New Stop Limit Buy Order
Create new stop limit buy order
- Method:
POST
Parameters:
Parameters must send with body
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| price | FLOAT | YES |
| target | FLOAT | YES |
| amount | FLOAT | YES |
- Request
v3/api/market/stop-limit-buy
{
//Response
"code": "00000",
"order":{
"status": "NEW",
"orderId": "ce82ac3aed3e8b1cecc6fcd36ddc49936866c49bfa4f4f32fbfc12a005e995c9b3b52e2b",
"market":"BTCUSDT",
"orderType": "STOP LIMIT",
"stopType": "GREATER",
"side": "BUY",
"target": 9525,
"price": 9500,
"amount": 0.001,
"time": 1578405048608
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10031 | Insufficient balance |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10062 | Buy Price is not lower than %40 |
| 20000 | Authorization required |
| 20007 | Price must be float and higher than 0 |
| 20008 | Target must be float and higher than 0 |
| 20009 | Amount must be float and higher than 0 |
| 90000 | Unexpected Error |
| 00000 | Success |
New Stop Limit Sell Order
Create new stop limit sell order
- Method:
POST
Parameters:
Parameters must send with body
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| price | FLOAT | YES |
| target | FLOAT | YES |
| amount | FLOAT | YES |
- Request
v3/api/market/stop-limit-sell
{
//Response
"code": "00000",
"order":{
"status": "NEW",
"orderId": "ce82ac3aed3e8b1cecc6fcd36ddc49936866c49bfa4f4f32fbfc12a005e995c9b3b52e2b",
"market":"BTCUSDT",
"orderType": "STOP LIMIT",
"stopType": "LESS",
"side": "SELL",
"target": 9300,
"price": 9305,
"amount": 0.001,
"time": 1578405048608
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10031 | Insufficient balance |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10061 | Sell Price is not higher than %250 |
| 20000 | Authorization required |
| 20007 | Price must be float and higher than 0 |
| 20008 | Target must be float and higher than 0 |
| 20009 | Amount must be float and higher than 0 |
| 90000 | Unexpected Error |
| 00000 | Success |
New Fast Buy Order
Create new fast buy order
- Method:
POST
Parameters:
Parameters must send with body
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| total | FLOAT | YES |
- Request
v3/api/market/fast-buy
{
//Response
"code": "00000",
"order":{
"status": "FILLED",
"market":"BTCUSDT",
"orderType": "FAST",
"side": "BUY",
"total": 100,
"filledTotal": 100,
"time": 1578405048608
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10031 | Insufficient balance |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10060 | Fast order not available |
| 20000 | Authorization required |
| 20012 | Total must be float and higher than 0 |
| 90000 | Unexpected Error |
| 00000 | Success |
New Fast Sell Order
Create new fast sell order
- Method:
POST
Parameters:
Parameters must send with body
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| amount | FLOAT | YES |
- Request
v3/api/market/fast-sell
{
//Response
"code": "00000",
"order":{
"status": "FILLED",
"market":"BTCUSDT",
"orderType": "FAST",
"side": "SELL",
"amount": 0.001,
"filledAmount": 0.001,
"time": 1578405048608
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10031 | Insufficient balance |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10060 | Fast order not available |
| 20000 | Authorization required |
| 20009 | Amount must be float and higher than 0 |
| 90000 | Unexpected Error |
| 00000 | Success |
Get User Active Orders
Get User Active Orders
- Method:
GET
- Parameters:
NONE
- Request
v3/api/market/user-orders
{
//Response
"code": "00000",
"orders": [
{
"market": "BTCTRY",
"price": 47016,
"targetPrice": 0,
"amount": 0.42,
"filledAmount": 0,
"side": 1,
"time": 1580131799413,
"orderType": 0,
"orderId": "ce82ac3aed3e8b1cecc6fcd36ddc49936866c49bfa4f4f32fbfc12a005e995c9b3b52e2b"
}
]
}
- Side
| Value | Meaning |
|---|---|
| 0 | Buy |
| 1 | Sell |
- Order Type
| Value | Meaning |
|---|---|
| 0 | Limit |
| 1 | Market |
| 2 | Stop Loss |
| 3 | Fast |
- Stop Type
| Value | Meaning |
|---|---|
| 0 | Less |
| 1 | Greater |
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10038 | Market disabled |
| 20000 | Authorization required |
| 90000 | Unexpected Error |
| 00000 | Success |
Cancel An Active Order
Cancel An Active Order
- Method:
POST
- Parameters:
| Parameter | Type | Required |
|---|---|---|
| orderId | STRING | YES |
- Request
v3/api/market/cancel-order
{
//Response
"code":"00000"
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10075 | Order not found |
| 20000 | Authorization required |
| 90000 | Unexpected Error |
| 00000 | Success |
Get User Trades
Get User Trade History
- Method:
GET
- Parameters:
NONE
- Request
v3/api/market/user-trades
{
//Response
"code": "00000",
"trades": [
{
symbol: "BTCUSDT",
price: 9800,
amount: 0.0012,
side: 1,
orderType: 0
commission: 0.02352
commissionSymbol: "USDT"
time: 1591875237869
}
]
}
- Side
| Value | Meaning |
|---|---|
| 0 | Buy |
| 1 | Sell |
- Order Type
| Value | Meaning |
|---|---|
| 0 | Limit |
| 1 | Market |
| 2 | Stop Loss |
| 3 | Fast |
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10038 | Market disabled |
| 20000 | Authorization required |
| 90000 | Unexpected Error |
| 00000 | Success |
Signed Balance Endpoints
Get All Currencies
Get all available currencies
- Method:
GET
- Parameters:
NONE
- Request
v3/api/balance/currencies
{
//Response
"code": "00000",
"currencies": [
{
"id": "cc8dfd30b230de18ec95a88438dc49c13868c49afd484832aaae1ea70fbb92cce6b12e72",
"symbol": "EUR",
"name": "Euro"
},
]
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 20000 | Authorization required |
| 90000 | Unexpected Error |
| 00000 | Success |
Create Withdraw
Create new withdraw for a symbol
- Method:
POST
- Parameters:
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
| amount | FLOAT | YES |
| iban | STRING | YES |
- Request
v3/api/balance/create-withdraw
{
//Response
"code": "00000"
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 10026 | Identity verification required |
| 10028 | Withdraw disabled |
| 10029 | Invalid withdraw channel |
| 10030 | Amount is lower than minimum withdraw limit |
| 10031 | Insufficient balance |
| 10035 | Channel monthly limit exceeded |
| 10037 | Invalid symbol |
| 10051 | Requested action is not available for your country |
| 10054 | Step-1 verified user monthly withdraw limit exceeded |
| 10055 | Step-2 verified user monthly withdraw limit exceeded |
| 10063 | Withdraw address is not valid |
| 20000 | Authorization required |
| 90000 | Unexpected Error |
| 90001 | Invalid Request |
| 00000 | Success |
Get Last 5 Withdraw
Get last 5 withdraw actions
- Method:
GET
- Parameters:
NONE
- Request
v3/api/balance/withdraw-history'
{
//Response
"code": "00000",
"history": [
{
"id": "f50761d28ba88bb6469f4dfb6b54f43123a15fd2",
"symbol": "USD",
"maxLength": 8,
"amount":20,000.00,
"time": 1578943895994,
"state": 13,
"real":true,
"information": "POSTBANK",
"txid": "",
"explorer": ""
},
}
- Withdraw State Codes
| Value | Meaning |
|---|---|
| 11 | Pending |
| 13 | Resuming |
| 14 | Completed |
| 21 | Pending |
| 22 | Validating |
| 23 | Resuming |
| 24 | Completed |
| 98 | Rejected |
| 99 | Cancelled |
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 20000 | Authorization required |
| 90000 | Unexpected Error |
| 00000 | Success |
Get Deposit Addresses
Get available address and nodes for a symbol
- Method:
POST
- Parameters:
| Parameter | Type | Required |
|---|---|---|
| symbol | STRING | YES |
- Request
v3/api/balance/deposit
{
//Response
"code": "00000",
"currency": {
"id": "cc8dfd30b230de18ec95a88438dc49c13868c49afd484832aaae1ea70fbb92cce6b12e72",
"symbol": "EUR",
"name": "EURO",
"enable": true,
"minimumDepositAmount": 10,
"maxLength": 2,
"channels": [
{
"name": "POSTBANK",
"address": "DE89 0001 0002 0003 0004 0005 67",
"enable": true
}
]
}
}
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Mail not registered |
| 10026 | Identity verification required |
| 10027 | Deposit disabled |
| 10037 | Invalid symbol |
| 10051 | Requested action is not available for your country |
| 20000 | Authorization required |
| 90000 | Unexpected Error |
| 00000 | Success |
Get Last 5 Deposit
Get last 5 deposit actions
- Method:
GET
- Parameters:
NONE
- Request
v3/api/balance/deposit-history'
{
//Response
"code": "00000",
"history": [
{
"id": "f50761d28ba88bb6469f4dfb6b54f43123a15fd2",
"symbol": "USD",
"maxLength": 8,
"totalConfirmation": 0,
"activeConfirmation": 0,
"amount":75,000.00,
"time": 1578943895994,
"state": 3,
"real":true,
"information": "POSTBANK",
"txid": "",
"explorer": ""
},
}
- Deposit State Codes
| Value | Meaning |
|---|---|
| 11 | Pending |
| 12 | Validating |
| 13 | Resuming |
| 14 | Completed |
- Possible Return Codes
| Code | Meaning |
|---|---|
| 10010 | Account not registered |
| 20000 | Authorization required |
| 90000 | Unexpected Error |
| 00000 | Success |
User Data Streams
Binding User Data Streams
- Binding user streams you need to
apiKeyandapiSecret. - User data stream payloads are not guaranteed to be in order during heavy periods.
Starting User Data Stream
- Before use
USER_STREAMSmethod you should hashedapiKeywith yourapiSecretand namedsignature. USER_STREAMSmethods payload has two parameters.Parameters:
| Parameter | Type | Required |
|---|---|---|
| apiKey | STRING | YES |
| signature | STRING | YES |
When you generate your signature, using apiKey and apiSecret you can send USER_STREAMS request.
- Signature Example
apiKey: 21d5513bf73f16798002f615a3293c66a450113a apiSecret: 3f03ca9ea806d6e9d3d6e65f2f5e42fe07a67a0c
[linux]$ echo -n "21d5513bf73f16798002f615a3293c66a450113a" | openssl dgst -sha256 -hmac "3f03ca9ea806d6e9d3d6e65f2f5e42fe07a67a0c"
(stdin)= d36256b4002dc7d604e739651ef8506e0fbdc9c03dffe17124f32e0c8e63ff02
- Request
{ "method": "USER_STREAMS", "signature": "d36256b4002dc7d604e739651ef8506e0fbdc9c03dffe17124f32e0c8e63ff02", "apiKey": "21d5513bf73f16798002f615a3293c66a450113a" }
- Response
{ "method":"USER_STREAMS", "status":"success" }
If
statusis not equalsuccessyou can handle errormessagepayload parameter.Failed Response Example
{ "method":"USER_STREAMS", "status":"failed", "message":"Unauthorized Access" }
User Available Balance Update
- This updates period
REAL-TIME - When successfully bind user data streams you can handle your available balance updates.
- When your available balance is changed we send a payload with
typeparameter valuebalanceUpdate.
{
//Example balanceUpdate payload
"type":"balanceUpdate",
"symbol":"BTC",
"available": 0.01245
}
User Reserved Balance Update
- This updates period
REAL-TIME - When successfully bind user data streams you can handle your reserved balance updates.
- When your reserved balance is changed we send a payload with
typeparameter valuereservedUpdate.
{
//Example reservedUpdate payload
"type":"reservedUpdate",
"symbol":"BTC",
"reserved": 0.01245
}
Error Codes
| Code | Meaning |
|---|---|
| 00000 | Success |
| 10001 | Pair already exist |
| 10002 | İnvalid symbol |
| 10003 | İnvalid name |
| 10004 | İnvalid firstSymbol |
| 10005 | İnvalid secondSymbol |
| 10006 | İnvalid liquidity provider |
| 10010 | Account not registered |
| 10026 | Identity verification required |
| 10028 | Withdraw disabled |
| 10029 | Invalid withdraw channel |
| 10030 | Amount is lower than minimum withdraw limit |
| 10031 | Insufficient balance |
| 10035 | Channel monthly limit exceeded |
| 10037 | Invalid symbol |
| 10038 | Market disabled |
| 10039 | Order total is under limit |
| 10040 | Order amount is under limit |
| 10041 | Wash trading cancelled |
| 10042 | Market order not available |
| 10051 | Requested action is not available for your country |
| 10054 | Step-1 verified user monthly withdraw limit exceeded |
| 10055 | Step-2 verified user monthly withdraw limit exceeded |
| 10060 | Fast order not available |
| 10061 | Sell Price is not higher than %250 |
| 10062 | Buy Price is not lower than %40 |
| 20000 | Authorization required |
| 20001 | Invalid API key or secret |
| 20002 | Unauthorized IP |
| 20003 | Timestamp parameter is missing |
| 20004 | Timestamp difference limit exceeded |
| 20005 | Missing parameters |
| 20006 | Invalid Symbol |
| 20007 | Price must be float and higher than 0 |
| 20008 | Target must be float and higher than 0 |
| 20009 | Amount must be float and higher than 0 |
| 20010 | Address can not be empty |
| 20011 | API is not allowed to this action |
| 20012 | Total must be float and higher than 0 |
| 90000 | Unexpected Error |
| 90001 | Invalid Request |