Skip to content

Latest commit

 

History

History
1264 lines (1113 loc) · 39.4 KB

restful-api.md

File metadata and controls

1264 lines (1113 loc) · 39.4 KB

RESTful API for Bitkub (2024-07-25)

Announcement

  • Public API Secure endpoint V3 released on 29 November 2023. This came along with the new API management page on Bitkub website. We encourage you to move these new secure endpoints because the old secure endpoints will be deprecated.
  • The Secure Endpoint Secure Endpoint V1,V2 will be deprecated on 25 July 2024. Please move to use new secure endpoints Secure ENdpoint V3

Change log

Table of contents

Base URL

Endpoint types

Non-secure endpoints

All non-secure endpoints do not need authentication and use the method GET.

Secure endpoints V3

All secure endpoints require authentication.

User Endpoint Method Trade Deposit Withdraw
/api/v3/user/trading-credits POST
/api/v3/user/limits POST
Market Endpoint Method Trade Deposit Withdraw
/api/v3/market/wallet POST
/api/v3/market/balances POST
/api/v3/market/place-bid POST
/api/v3/market/place-ask POST
/api/v3/market/cancel-order POST
/api/v3/market/wstoken POST
/api/v3/market/my-open-orders GET
/api/v3/market/my-order-history GET
/api/v3/market/order-info GET
Crypto Endpoint Method Trade Deposit Withdraw
/api/v3/crypto/internal-withdraw POST
/api/v3/crypto/addresses POST
/api/v3/crypto/withdraw POST
/api/v3/crypto/deposit-history POST
/api/v3/crypto/withdraw-history POST
/api/v3/crypto/generate-address POST
Fiat Endpoint Method Trade Deposit Withdraw
/api/v3/fiat/accounts POST
/api/v3/fiat/withdraw POST
/api/v3/fiat/deposit-history POST
/api/v3/fiat/withdraw-history POST

Constructing the request

GET/POST request

  • GET requests require parameters as query string in the URL (e.g. ?sym=THB_BTC&lmt=10).
  • POST requests require JSON payload (application/json).

Request headers (Secure Endpoints)

Authentication requires API KEY and API SECRET. Every request to the server must contain the following in the request header:

  • Accept: application/json
  • Content-type: application/json
  • X-BTK-APIKEY: {YOUR API KEY}
  • X-BTK-TIMESTAMP: {Timestamp i.e. 1699376552354 }
  • X-BTK-SIGN: Signature

Payload (POST)

The payload is always JSON.

Signature

Generate the signature from the timestamp, the request method, API path, query parameter, and JSON payload using HMAC SHA-256. Use the API Secret as the secret key for generating the HMAC variant of JSON payload. The signature is in hex format. The user has to attach the signature via the Request Header You must get a new timestamp in millisecond from /api/v3/servertime. The old one is in second.

Example string for signing a signature:

//Example for Get Method
1699381086593GET/api/v3/market/my-order-history?sym=BTC_THB

// Example for Post Method
1699376552354POST/api/v3/market/place-bid{"sym":"thb_btc","amt": 1000,"rat": 10,"typ": "limit"}

Example cURL:

curl --location 'https://api.bitkub.com/api/v3/market/place-bid' \
--header 'X-BTK-TIMESTAMP: 1699381086593' \
--header 'X-BTK-APIKEY: e286825bda3497ae2d03aa3a30c420d603060cb4edbdd3ec711910c86966e9ba' \
--header 'X-BTK-SIGN: f5884963865a6e868ddbd58c9fb9ea4bd013076e8a8fa51d38b86c38d707cb8a' \
--header 'Content-Type: application/json' \
--data '{
	"sym": "thb_btc",
	"amt": 1000,
	"rat": 10,
	"typ": "limit",
}'
curl --location 'https://api.bitkub.com/api/v3/market/my-open-orders?sym=BTC_THB' \
--header 'X-BTK-TIMESTAMP: 1699381086593' \
--header 'X-BTK-APIKEY: e286825bda3497ae2d03aa3a30c420d603060cb4edbdd3ec711910c86966e9ba' \
--header 'X-BTK-SIGN: f5884963865a6e868ddbd58c9fb9ea4bd013076e8a8fa51d38b86c38d707cb8a'

API documentation

Refer to the following for description of each endpoint

GET /api/status

Description:

Get endpoint status. When status is not ok, it is highly recommended to wait until the status changes back to ok.

Query:

  • n/a

Response:

[
  {
    "name": "Non-secure endpoints",
    "status": "ok",
    "message": ""
  },
  {
    "name": "Secure endpoints",
    "status": "ok",
    "message": ""
  }
]

GET /api/servertime

Description:

Get server timestamp. This can't use with secure endpoint V3. Please use /api/v3/servertime.

Query:

  • n/a

Response:

1707220534359

GET /api/v3/servertime

Description:

Get server timestamp.

Query:

  • n/a

Response:

1701251212273

GET /api/market/symbols

Description:

List all available symbols.

Query:

  • n/a

Response:

{
  "error": 0,
  "result": [
    {
      "id": 1,
      "symbol": "THB_BTC",
      "info": "Thai Baht to Bitcoin"
    },
    {
      "id": 2,
      "symbol": "THB_ETH",
      "info": "Thai Baht to Ethereum"
    }
  ]
}

GET /api/market/ticker

Description:

Get ticker information.

Query:

  • sym string The symbol (optional)
    • e.g. thb_btc

Response:

{
  "THB_BTC": {
    "id": 1,
    "last": 216415.00,
    "lowestAsk": 216678.00,
    "highestBid": 215000.00,
    "percentChange": 1.91,
    "baseVolume": 71.02603946,
    "quoteVolume": 15302897.99,
    "isFrozen": 0,
    "high24hr": 221396.00,
    "low24hr": 206414.00
  },
  "THB_ETH": {
    "id": 2,
    "last": 11878.00,
    "lowestAsk": 12077.00,
    "highestBid": 11893.00,
    "percentChange": -0.49,
    "baseVolume": 455.17839270,
    "quoteVolume": 5505664.42,
    "isFrozen": 0,
    "high24hr": 12396.00,
    "low24hr": 11645.00
  }
}

GET /api/market/trades

Description:

List recent trades.

Query:

  • sym string The symbol (e.g. thb_btc)
  • lmt int No. of limit to query recent trades

Response:

{
  "error": 0,
  "result": [
    [
      1529516287, // timestamp
      10000.00, // rate
      0.09975000, // amount
      "BUY" // side
    ]
  ]
}

GET /api/market/bids

Description:

List open buy orders.

Query:

  • sym string The symbol (e.g. thb_btc)
  • lmt int No. of limit to query open buy orders

Response:

{
  "error": 0,
  "result": [
    [
      "1", // order id
      1529453033, // timestamp
      997.50, // volume
      10000.00, // rate
      0.09975000 // amount
    ]
  ]
}

GET /api/market/asks

Description:

List open sell orders.

Query:

  • sym string The symbol (e.g. thb_btc)
  • lmt int No. of limit to query open sell orders

Response:

{
  "error": 0,
  "result": [
    [
      "680", // order id
      1529491094, // timestamp
      997.50, // volume
      10000.00, // rate
      0.09975000 // amount
    ]
  ]
}

GET /api/market/books

Description:

List all open orders.

Query:

  • sym string The symbol (e.g. thb_btc)
  • lmt int No. of limit to query open orders

Response:

{
  "error": 0,
  "result": {
    "bids": [
      [
        "1", // order id
        1529453033, // timestamp
        997.50, // volume
        10000.00, // rate
        0.09975000 // amount
      ]
    ],
    "asks": [
      [
        "680", // order id
        1529491094, // timestamp
        997.50, // volume
        10000.00, // rate
        0.09975000 // amount
      ]
    ]
  }
}

GET /tradingview/history

Description:

Get historical data for TradingView chart.

Query:

  • symbol string The symbol (e.g. BTC_THB)
  • resolution string Chart resolution (1, 5, 15, 60, 240, 1D)
  • from int Timestamp of the starting time (e.g. 1633424427)
  • to int Timestamp of the ending time (e.g. 1633427427)

Response:

{
  "c": [
    1685000,
    1680699.95,
    1688998.99,
    1692222.22
  ],
  "h": [
    1685000,
    1685000,
    1689000,
    1692222.22
  ],
  "l": [
    1680053.22,
    1671000,
    1680000,
    1684995.07
  ],
  "o": [
    1682500,
    1685000,
    1680100,
    1684995.07
  ],
  "s": "ok",
  "t": [
    1633424400,
    1633425300,
    1633426200,
    1633427100
  ],
  "v": [
    4.604352630000001,
    8.530631670000005,
    4.836581560000002,
    2.8510189200000022
  ]
}

GET /api/market/depth

Description:

Get depth information.

Query:

  • sym string The symbol (e.g. thb_btc)
  • lmt int Depth size

Response:

{
  "asks": [
    [
      262600,
      0.61905798
    ],
    [
      263000,
      0.00210796
    ],
    [
      263200,
      0.89555545
    ],
    [
      263422.5,
      0.03796183
    ],
    [
      263499,
      0.4123439
    ]
  ],
  "bids": [
    [
      262510,
      0.38038703
    ],
    [
      262100.01,
      1.22519999
    ],
    [
      262100,
      0.00381533
    ],
    [
      262024.88,
      0.00352718
    ],
    [
      262001,
      0.09999961
    ]
  ]
}

POST /api/v3/market/wallet

Description:

Get user available balances (for both available and reserved balances please use POST /api/v3/market/balances).

Query:

  • n/a

Response:

{
  "error": 0,
  "result": {
    "THB": 188379.27,
    "BTC": 8.90397323,
    "ETH": 10.1
  }
}

POST /api/v3/user/trading-credits

Description:

Check trading credit balance.

Query (URL):

Response:

{
   "error": 0,
   "result": 1000
}

POST /api/v3/market/place-bid

Description:

Create a buy order.

Body:

  • sym string The symbol you want to trade (e.g. btc_thb).
  • amt float Amount you want to spend with no trailing zero (e.g. 1000.00 is invalid, 1000 is ok)
  • rat float Rate you want for the order with no trailing zero (e.g. 1000.00 is invalid, 1000 is ok)
  • typ string Order type: limit or market (for market order, please specify rat as 0)
  • client_id string your id for reference ( not required )
  • post_only bool Postonly flag: true or false ( not required )

Response:

{
  "error": 0,
  "result": {
    "id": "1", // order id
    "hash": "fwQ6dnQWQPs4cbatF5Am2xCDP1J", // order hash
    "typ": "limit", // order type
    "amt": 1000, // spending amount
    "rat": 15000, // rate
    "fee": 2.5, // fee
    "cre": 2.5, // fee credit used
    "rec": 0.06666666, // amount to receive
    "ts": "1707220636" // timestamp
    "ci": "input_client_id" // input id for reference
  }
}

POST /api/v3/market/place-ask

Description:

Create a sell order.

Body:

  • sym string The symbol. The symbol you want to trade (e.g. btc_thb).
  • amt float Amount you want to sell with no trailing zero (e.g. 0.10000000 is invalid, 0.1 is ok)
  • rat float Rate you want for the order with no trailing zero (e.g. 1000.00 is invalid, 1000 is ok)
  • typ string Order type: limit or market (for market order, please specify rat as 0)
  • client_id string your id for reference ( not required )
  • post_only bool Postonly flag: true or false ( not required )

Response:

{
  "error": 0,
  "result": {
    "id": "1", // order id
    "hash": "fwQ6dnQWQPs4cbatFGc9LPnpqyu", // order hash
    "typ": "limit", // order type
    "amt": 1.00000000, // selling amount
    "rat": 15000, // rate
    "fee": 37.5, // fee
    "cre": 37.5, // fee credit used
    "rec": 15000, // amount to receive
    "ts": "1533834844" // timestamp
    "ci": "input_client_id" // input id for reference
  }
}

POST /api/v3/market/cancel-order

Description:

Cancel an open order.

Body:

  • sym string The symbol. Please note that the current endpoint requires the symbol thb_btc. However, it will be changed to btc_thb soon and you will need to update the configurations accordingly for uninterrupted API functionality.
  • id string Order id you wish to cancel
  • sd string Order side: buy or sell
  • hash string Cancel an order with order hash (optional). You don't need to specify sym, id, and sd when you specify order hash.

Response:

{
  "error": 0
}

POST /api/v3/market/balances

Description:

Get balances info: this includes both available and reserved balances.

Query:

  • n/a

Response:

{
  "error": 0,
  "result": {
    "THB":  {
      "available": 188379.27,
      "reserved": 0
    },
    "BTC": {
      "available": 8.90397323,
      "reserved": 0
    },
    "ETH": {
      "available": 10.1,
      "reserved": 0
    }
  }
}

GET /api/v3/market/my-open-orders

Description:

List all open orders of the given symbol.

Query:

  • sym string The symbol (e.g. btc_thb)

Response:

{
  "error": 0,
  "result": [
    { // Example of sell order
      "id": "2", // order id
      "hash": "fwQ6dnQWQPs4cbatFSJpMCcKTFR", // order hash
      "side": "sell", // order side
      "type": "limit", // order type
      "rate": "15000", // rate
      "fee": "35.01", // fee
      "credit": "35.01", // credit used
      "amount": "0.93333334", // amount of crypto quantity
      "receive": "14000", // amount of THB 
      "parent_id": "1", // parent order id
      "super_id": "1", // super parent order id
      "client_id": "client_id" // client id
      "ts": 1702543272000 // timestamp
    },
    { // Example of buy order
      "id": "278465822",
      "hash": "fwQ6dnQYKnqFPHx8sFM3z8oydmJ",
      "side": "buy",
      "type": "limit",
      "rate": "10",
      "fee": "0.25",
      "credit": "0",
      "amount": "100", // amount of THB 
      "receive": "9.975", // amount of crypto quantity
      "parent_id": "0",
      "super_id": "0",
      "client_id": "client_id",
      "ts": 1707220636000
    },
  ]
}

Note : The client_id of this API response is the input body field name client_id , was inputted by the user of APIs

GET /api/v3/market/my-order-history

Description:

List all orders that have already matched.

Query:

  • sym string The symbol (e.g. btc_thb)
  • p int Page (optional)
  • lmt int Limit (optional)
  • start int Start timestamp (optional)
  • end int End timestamp (optional)

Response:

{
  "error": 0,
  "result": [
    {
      "txn_id": "BTCSELL0021206932",
      "order_id": "241407793",
      "hash": "fwQ6dnYz5mbyeY9ssuqA74NmDej",
      "parent_order_id": "0",
      "parent_order_hash": "fwQ6dnQWQPs4cbatFGc8qWckMTH",
      "super_order_id": "0",
      "super_order_hash": "fwQ6dnQWQPs4cbatFGc8qWckMTH",
      "client_id": "",
      "taken_by_me": false,
      "is_maker": false,
      "side": "sell",
      "type": "market",
      "rate": "1525096.27",
      "fee": "0.04",
      "credit": "0",
      "amount": "0.00001", // crypto amount
      "ts": 1707221396584
    },
    {
      "txn_id": "BTCBUY0021182426",
      "order_id": "277231907",
      "hash": "fwQ6dnQYKnqFP3TPmYEajSfSbap",
      "parent_order_id": "0",
      "parent_order_hash": "fwQ6dnQWQPs4cbatF5Am2qegYs2",
      "super_order_id": "0",
      "super_order_hash": "fwQ6dnQWQPs4cbatF5Am2qegYs2",
      "client_id": "client_id",
      "taken_by_me": false,
      "is_maker": false,
      "side": "buy",
      "type": "market",
      "rate": "1497974.74",
      "fee": "0.03",
      "credit": "0",
      "amount": "11", // THB amount
      "ts": 1706775718739
    }
  ],
  "pagination": {
      "page": 2,
      "last": 3,
      "next": 3,
      "prev": 1
  }
}

GET /api/v3/market/order-info

Description:

Get information regarding the specified order.

Query:

  • sym string The symbol (e.g. btc_thb)
  • id string Order id
  • sd string Order side: buy or sell
  • hash string Lookup an order with order hash (optional). You don't need to specify sym, id, and sd when you specify order hash.

Response:

{
    "error": 0,
    "result": {
        "id": "289", // order id
        "first": "289", // first order id
        "parent": "0", // parent order id
        "last": "316", // last order id
        "client_id": "", // your id for reference
        "post_only": false, // post_only: true, false
        "amount": "4000", // order amount THB amount if it Buy side. And Crypto Amount if it sell side
        "rate": 291000, // order rate
        "fee": 10, // order fee
        "credit": 10, // order fee credit used
        "filled": 3999.97, // filled amount
        "total": 4000, // total amount
        "status": "filled", // order status: filled, unfilled, cancelled
        "partial_filled": false, // true when order has been partially filled, false when not filled or fully filled
        "remaining": 0, // remaining amount to be executed
        "history": [
            {
                "amount": 98.14848,
                "credit": 0.25,
                "fee": 0.25,
                "hash": "K9kLVGNVb9AVffm7t6U"
                "id": "289",
                "rate": 291000,
                "timestamp": 1702466375000,
                "txn_id": "BTCBUY0003372258"
            }
        ]
    }
}

POST /api/v3/crypto/addresses

Description:

List all crypto addresses.

Query (URL):

  • p int Page (optional)
  • lmt int Limit (optional)

Response:

{
   "error":0,
   "result": [
      {
         "currency": "BTC",
         "address": "3BtxdKw6XSbneNvmJTLVHS9XfNYM7VAe8k",
         "tag": 0,
         "time": 1570893867
      }
   ],
   "pagination": {
      "page": 1,
      "last": 1
   }
}

POST /api/v3/crypto/withdraw

Description:

Make a withdrawal to a trusted address.

Body:

  • cur string Currency for withdrawal (e.g. BTC, ETH)
  • amt float Amount you want to withdraw
  • adr string Address to which you want to withdraw
  • mem string (Optional) Memo or destination tag to which you want to withdraw
  • net string Cryptocurrency network to withdraw
    No default value of this field. Please find the available network from the link as follows. https://www.bitkub.com/fee/cryptocurrency

For example ETH refers to ERC-20.
For request on ERC-20, please assign the net value as ETH.
For request on BEP-20, please assign the net value as BSC.
For request on KAP-20, please assign the net value as BKC.

Response:

{
    "error": 0,
    "result": {
        "txn": "BTCWD0000012345", // local transaction id
        "adr": "4asyjKw6XScneNvhJTLVHS9XfNYM7VBf8x", // address
        "mem": "", // memo
        "cur": "BTC", // currency
        "amt": 0.1, // withdraw amount
        "fee": 0.0002, // withdraw fee
        "ts": 1569999999 // timestamp
    }
}

POST /api/v3/crypto/internal-withdraw

Description:

Make a withdraw to an internal address. The destination address is not required to be a trusted address. This API is not enabled by default, Only KYB users can request this feature by contacting us via [email protected]

Query:

  • cur string Currency for withdrawal (e.g. BTC, ETH)
  • amt float Amount you want to withdraw
  • adr string Address to which you want to withdraw
  • mem string (Optional) Memo or destination tag to which you want to withdraw
  • net string Cryptocurrency network to withdraw
    No default value of this field. Please find the available network from the link as follows. https://www.bitkub.com/fee/cryptocurrency
  • ext_ref string (Optional) External reference

Response:

{
    "error": 0,
    "result": {
        "txn": "BTCWD0000012345", // local transaction id
        "ext_ref": "XXWD0000012345", // external reference
        "adr": "4asyjKw6XScneNvhJTLVHS9XfNYM7VBf8x", // address
        "mem": "", // memo
        "cur": "BTC", // currency
        "amt": 0.1, // withdraw amount
        "fee": 0.0002, // withdraw fee
        "ts": 1569999999 // timestamp
    }
}

POST /api/v3/crypto/deposit-history

Description:

List crypto deposit history.

Query (URL):

  • p int Page (optional)
  • lmt int Limit (optional)

Response:

{
   "error": 0,
   "result": [
      {
         "hash": "XRPWD0000100276",
         "currency": "XRP",
         "amount": 5.75111474,
         "from_address": "sender address",
         "to_address": "recipient address",
         "confirmations": 1,
         "status": "complete",
         "time": 1570893867
      }
   ],
   "pagination": {
      "page": 1,
      "last": 1
   }
}

POST /api/v3/crypto/withdraw-history

Description:

List crypto withdrawal history.

Query (URL):

  • p int Page (optional)
  • lmt int Limit (optional)

Response:

{
  "error": 0,
  "result": [
    {
      "txn_id": "RDNTWD0000804050",
      "ext_ref": "XX_1111111111",
      "hash": null,
      "currency": "RDNT",
      "amount": "2.00000000",
      "fee": 4.36,
      "address": "0x8b5B4E70BFCB3784f1c1157A50bd5f103c4b0102",
      "memo": "",
      "status": "processing",
      "note": "-",
      "time": 1668485932
    },
    {
      "txn_id": "BTCWD1321312683",
      "ext_ref": "XX_1111111112",
      "hash": "0x8891b79c79f0842c9a654db47745fe0291fba222b290d22cabc93f8ae4490303",
      "currency": "BTC",
      "amount": "0.10000000",
      "fee": 0.0025,
      "address": "0x8b5B4E70BFCB3784f1c1157A50bd5f103c4b0102",
      "memo": "",
      "status": "complete",
      "note": "-",
      "time": 1711678588
    }
  ],
  "pagination": {
    "page": 1,
    "last": 1,
  }
}

POST /api/v3/crypto/generate-address

Description:

Generate a new crypto address (will replace existing address; previous address can still be used to received funds)

Query (URL):

  • sym string Symbol (e.g. THB_BTC, THB_ETH, etc.)

Response:

{
   "error": 0,
   "result": [
      {
         "currency": "ETH",
         "address": "0x520165471daa570ab632dd504c6af257bd36edfb",
         "memo": ""
      }
   ]
}

POST /api/v3/fiat/accounts

Description:

List all approved bank accounts.

Query (URL):

  • p int Page (optional)
  • lmt int Limit (optional)

Response:

{
   "error": 0,
   "result": [
      {
         "id": "7262109099",
         "bank": "Kasikorn Bank",
         "name": "Somsak",
         "time": 1570893867
      }
   ],
   "pagination": {
      "page": 1,
      "last": 1
   }
}

POST /api/v3/fiat/withdraw

Description:

Make a withdrawal to an approved bank account.

Query:

  • id string Bank account id
  • amt float Amount you want to withdraw

Response:

{
    "error": 0,
    "result": {
        "txn": "THBWD0000012345", // local transaction id
        "acc": "7262109099", // bank account id
        "cur": "THB", // currency
        "amt": 21, // withdraw amount
        "fee": 20, // withdraw fee
        "rec": 1, // amount to receive
        "ts": 1569999999 // timestamp
    }
}

POST /api/v3/fiat/deposit-history

Description:

List fiat deposit history.

Query (URL):

  • p int Page (optional)
  • lmt int Limit (optional)

Response:

{
   "error": 0,
   "result": [
      {
         "txn_id": "THBDP0000012345",
         "currency": "THB",
         "amount": 5000.55,
         "status": "complete",
         "time": 1570893867
      }
   ],
   "pagination": {
      "page": 1,
      "last": 1
   }
}

POST /api/v3/fiat/withdraw-history

Description:

List fiat withdrawal history.

Query (URL):

  • p int Page (optional)
  • lmt int Limit (optional)

Response:

{
   "error":0,
   "result": [
      {
         "txn_id": "THBWD0000012345",
         "currency": "THB",
         "amount": "21",
         "fee": 20,
         "status": "complete",
         "time": 1570893493
      }
   ],
   "pagination": {
      "page": 1,
      "last": 1
   }
}

POST /api/v3/user/limits

Description:

Check deposit/withdraw limitations and usage.

Query (URL):

Response:

{
   "error": 0,
   "result": { 
       "limits": { // limitations by kyc level
          "crypto": { 
             "deposit": 0.88971929, // BTC value equivalent
             "withdraw": 0.88971929 // BTC value equivalent
          },
          "fiat": { 
             "deposit": 200000, // THB value equivalent
             "withdraw": 200000 // THB value equivalent
          }
       },
       "usage": { // today's usage
          "crypto": { 
             "deposit": 0, // BTC value equivalent
             "withdraw": 0, // BTC value equivalent
             "deposit_percentage": 0,
             "withdraw_percentage": 0,
             "deposit_thb_equivalent": 0, // THB value equivalent
             "withdraw_thb_equivalent": 0 // THB value equivalent
          },
          "fiat": { 
             "deposit": 0, // THB value equivalent
             "withdraw": 0, // THB value equivalent
             "deposit_percentage": 0,
             "withdraw_percentage": 0
          }
       },
       "rate": 224790 // current THB rate used to calculate
    }
}

Additional

For the use of cur(currency) for any APIs request. Please be cautious of these cryptocurrency when you specified on the request.

Name Currency
Terra Classic LUNA
Terra 2.0 LUNA2

Error codes

Refer to the following descriptions:

Code Description
0 No error
1 Invalid JSON payload
2 Missing X-BTK-APIKEY
3 Invalid API key
4 API pending for activation
5 IP not allowed
6 Missing / invalid signature
7 Missing timestamp
8 Invalid timestamp
9 Invalid user
10 Invalid parameter
11 Invalid symbol
12 Invalid amount
13 Invalid rate
14 Improper rate
15 Amount too low
16 Failed to get balance
17 Wallet is empty
18 Insufficient balance
19 Failed to insert order into db
20 Failed to deduct balance
21 Invalid order for cancellation (Unable to find OrderID or Symbol.)
22 Invalid side
23 Failed to update order status
24 Invalid order for lookup
25 KYC level 1 is required to proceed
30 Limit exceeds
40 Pending withdrawal exists
41 Invalid currency for withdrawal
42 Address is not in whitelist
43 Failed to deduct crypto
44 Failed to create withdrawal record
47 Withdrawal limit exceeds
48 Invalid bank account
49 Bank limit exceeds
50 Pending withdrawal exists
51 Withdrawal is under maintenance
52 Invalid permission
53 Invalid internal address
54 Address has been deprecated
55 Cancel only mode
56 User has been suspended from purchasing
57 User has been suspended from selling
58 Transaction not found
90 Server error (please contact support)

Rate limits

If the request rate exceeds the limit in any endpoints, the request will be blocked for 30 seconds. When blocked, HTTP response is 429 Too Many Requests. The limits apply to individual user accessing the API. The rate limit is applied to each endpoint regardless the API version.

Endpoint Rate Limit
/api/market/ticker 100 req/sec
/api/market/depth 10 req/sec
/api/market/symbols 100 req/sec
/api/market/trades 100 req/sec
/api/market/bids 100 req/sec
/api/market/asks 100 req/sec
/api/market/books 100 req/sec
/api/market/order-info 100 req/sec
/api/market/my-open-orders 150 req/sec
/api/market/my-order-history 100 req/sec
/api/market/place-bid 150 req/sec
/api/market/place-ask 150 req/sec
/api/market/cancel-order 200 req/sec
/api/market/balances 150 req/sec
/api/market/wallet 150 req/sec
/api/crypto/deposit-history 20 req/sec
/api/servertime 2,000 req/10secs
/api/status 100 req/sec
/api/crypto/* 250 req/10secs
/api/fiat/* 20 req/sec
/api/user/* 20 req/sec
/tradingview/* 100 req/sec