Developer Guide API
Overview
Tokenize provides a simple and powerful REST API to allow you to programmatically perform nearly all actions you can from our web interface. All requests use the application/json content type and go over https. All responses come with a default response object with result in status field. Always check status field with success flag to ensure your result is good.
Getting Started!
- The base endpoint is: https://api2.tokenize.exchange/public/v1
- All endpoint return either a JSON format.
- HTTP 4xx return codes are used for malformed requests. The issue is on the sender’s side.
- HTTP 5xx return codes are used for internal errors. The issue on Tokenize’s side.
- For GET endpoints, parameters must be sent as a query string.
- For POST, PUT and DELETE endpoints, the parameters may be sent as a query string or in the request body with content type application/json. You may mix parameters between both the query string and request body.
- Parameters may be sent in any order.
Endpoint Security
- Each endpoint has a security type that determines how you will interact with it.
- At first, please get a token ID and token secret key on your Setting page.
- Generate your API token with payload {id: ID} and sign your token with the secret key, you can download our CLI tool to generate this token with this command:
- java -jar generator -id ID -secret SECRET_KEY -time 365d
- API tokens are passed into REST API via X-TKX-TOKEN header.
- API tokens are case sensitive.
Security Type
None | Endpoint can access public |
Secured | Endpoint requires sending a valid API Token |
Constants definitions
Orders status
- PENDING
- COMPLETE
- CANCEL
Order/Ask types
- LIMIT
- MARKET
- STOP LIMIT
- TRAILING STOP
Public Endpoints
Market information
Used to get the open and available trading markets at Tokenize along with other metadata.
GET /market/get-markets
Response
{
"message": "",
"status": "success",
"data": [
{
"title": "BTC",
"list": [
{
"marketId": "BTC",
"marketName": "BTC-BAT",
"baseCurrency": "BTC",
"marketCurrency": "BAT",
"marketCurrencyLong": "Basic Attention Token",
"ceiling": "100.00000000",
"floor": "0.00000001"
},
{
"marketId": "BTC",
"marketName": "BTC-BCH",
"baseCurrency": "BTC",
"marketCurrency": "BCH",
"marketCurrencyLong": "Bitcoin Cash",
"ceiling": "1000.00000000",
"floor": "0.00000001"
}
]
},
{
"title": "ETH",
"list": [
{
"marketId": "ETH",
"marketName": "ETH-BAT",
"baseCurrency": "ETH",
"marketCurrency": "BAT",
"marketCurrencyLong": "Basic Attention Token",
"ceiling": "100.00000000",
"floor": "0.00000000"
},
{
"marketId": "ETH",
"marketName": "ETH-BCH",
"baseCurrency": "ETH",
"marketCurrency": "BCH",
"marketCurrencyLong": "Bitcoin Cash",
"ceiling": "1000.00000000",
"floor": "0.00000000"
}
]
}
]
}
Get the last market price
GET /market/get-last-market-price
Parameters
Name | Type | Mandatory | Description |
market | String | Yes |
Response
{
"message": "",
"status": "success",
"data": {
"market": "LTC-BTC",
"baseAsset": "LTC",
"quoteAsset": "BTC",
"price": "0.00707700"
}
}
Get ticker market
Get a ticker for a specified market
GET /market/ticker
Parameters
Name | Type | Mandatory | Description |
market | String | Yes |
Response
{
"message": "",
"status": "success",
"data": {
"symbol": "LTC-BTC",
"baseAsset": "LTC",
"quoteAsset": "BTC",
"bidPrice": "4.00000000",
"bidQty": "431.00000000",
"askPrice": "4.00000200",
"askQty": "9.00000000"
}
}
Get market summaries
Used to get the last 24-hour summary of all active markets.
GET /market/get-summaries
Response
{
"message": "",
"status": "success",
"data": [
{
"marketId": 89,
"market": "USD-TKX",
"volume": null,
"high": 0,
"low": 0,
"bidPrice": 0,
"askPrice": 0
},
{
"marketId": 88,
"market": "USD-DASH",
"volume": null,
"high": 0,
"low": 0,
"bidPrice": 0,
"askPrice": 0
},
{
"marketId": 87,
"market": "USD-ZEC",
"volume": null,
"high": 0,
"low": 0,
"bidPrice": 0,
"askPrice": 0
}
]
}
Get market buy orders
Get all currently buy orders in Tokenize specified by the market
GET /market/get-buy-orders
Parameters
Name | Type | Mandatory | Description |
market | String | Yes |
Response:
{
"message": "",
"status": "success",
"data": {
"market": "BTC-LTC",
"orders": [
{
"quantity": 3.684,
"rate": 0.03656331009,
"total": 0.13469923,
"sum": 0.13469923
},
{
"quantity": 4.44478431,
"rate": 0.0365633001,
"total": 0.16251598,
"sum": 0.29721521
}
]
}
}
Get market sell orders
Get all currently sell orders in Tokenize specified by the market
GET /market/get-sell-orders
Parameters
Name | Type | Mandatory | Description |
market | String | Yes |
Response
{
"message": "",
"status": "success",
"data": {
"market": "BTC-LTC",
"orders": [
{
"quantity": 48.83679923,
"rate": 0.03663652993,
"total": 1.78921085,
"sum": 1.78921085
},
{
"quantity": 0.09034879,
"rate": 0.0366366,
"total": 0.00331007,
"sum": 1.79252092
}
]
}
}
Current average price
Get the current average price for a specified market
GET /market/get-market-avg-price
Parameters
Name | Type | Mandatory | Description |
market | String | Yes |
Response
{
"message": "",
"status": "success",
"data": {
"market": "BTC-LTC",
"price": "0.007017"
}
}
24h Change price statistic
Get statistics to change of price of a market
GET /market/ticker/24h
Parameters
Name | Type | Mandatory | Description |
market | String | Yes |
Response
{
"message": "",
"status": "success",
"data": {
"market": "BTC-LTC",
"highPrice": 0.0078332,
"lowPrice": 0.0074534,
"lastPrice": 0.007604,
"bidPrice": 0.0077343,
"askPrice": 0.0078934,
"volume": 657002,
}
}
Order book
Allow you to keep track of the state of Tokenize order books on a price aggregated basis with customizable precision
GET /market/orderbook
Parameters
Name | Type | Mandatory | Description |
market | String | Yes | |
type | String | No | “buy”, “sell”, “both” or “” to identity the type of orderbook to return |
limit | Number | No | Limit numbers of orderbook to return |
Response
{
"status": "success",
"message": "",
"data": {
"buy": [
{
"quantity": 37.38630477,
"rate": 14637.99,
"total": 547260.35536021,
"sum": 547260.35536021
},
{
"quantity": 2,
"rate": 14636.61,
"total": 29273.22,
"sum": 576533.57536021
}
],
"sell": [
{
"quantity": 0.1,
"rate": 9225,
"total": 922.5,
"sum": 922.5
},
{
"quantity": 0.1,
"rate": 9250,
"total": 925,
"sum": 1847.5
}
]
}
}
Trades histories
Allows the retrieval of past public trades and includes details such as price, size, and time. Optional parameters can be used to limit the number of results.
GET /market/history
Parameters
Name | Type | Mandatory | Description |
market | String | Yes | |
limit | Number | No | Limit numbers of trades histories to return |
Response
{
"status": "success",
"message": "",
"data": {
{
"id": 7977621709,
"price": 13287.5,
"amount": 0.00617253,
"total": 82.017492375,
"timeStamp": 1567345561906,
"type": "buy"
},
{
"id": 7977621707,
"price": 13283.97,
"amount": 0.00390669,
"total": 51.8963527593,
"timeStamp": 1567345561906,
"type": "buy"
},
{
"id": 7977607501,
"price": 13276.72,
"amount": 2,
"total": 26553.44,
"timeStamp": 1567345356196,
"type": "buy"
}
}
}
Klines/Candlestick
The Candles endpoint provides chart candles for a specified time frame and period.
GET /market/candles
Parameters
Name | Type | Mandatory | Description |
market | String | Yes | |
resolution | string | Yes | Specify time interval with “W” is week, “D” is day, “M” is minutes.
EX: 1W, 2W, 1D, 2D, 30M |
from | number | no | timestamp for start time to get |
to | number | no | timestamp for end time to get |
Response
{
"status": "success",
"message": "",
"data": [
[
1519257600000, // Open time
12428.571428571428, // Open
13950, // Close
14875, // High
120.71428571428572, // Low
302.5646 // Volume
]
]
}
Secured Endpoint (Need API Token)
Place an order
POST /order
Parameters
Name | Type | Mandatory | Description |
market | String | Yes | |
side | String | Yes | ‘buy’ or ‘sell’ |
units | Decimal | Yes | |
price | Decimal | No | Required if type is limit |
orderType | String | Yes | Currently, it allows 2 types: “limit” and “market” |
Response
{
"message": "",
"status": "success",
"data": {
"orderId": 98332442,
"market": "BTC-LTC",
"transactTime": "1507725176595",
"price": 0.0071123,
"originUnits": 600,
"commissionPaid": 0.0004322,
"type": "market",
"status": "pending"
}
}
Place buy order
POST /order/buy
POST /order/buy will be removed in the future. (Exact date unknown). Please use POST /order instead.
Parameters
Name | Type | Mandatory | Description |
market | String | Yes | |
units | Decimal | Yes | |
price | Decimal | No | |
type | String | Yes | Currently it allows 2 type: “limit” and “market” |
Response
{
"message": "",
"status": "success",
"data": {
"orderId": 98332442,
"market": "BTC-LTC",
"transactTime": "1507725176595",
"price": 0.0071123,
"originUnits": 600,
"commissionPaid": 0.0004322,
"type": "MARKET",
"status": "PENDING"
}
}
Get Order History
GET /order
Parameters
Name | Type | Mandatory | Description |
market | String | No | |
start time | Number | No | |
end time | Number | No | |
side | bid or ask | No | |
status | pending, completed, cancelled | No | |
limit | Number, Max(1000) | No | |
page | Number | No |
Response
{
"status": "success",
"message": "",
"data": [
{
"orderId": 133481338,
"market": "SGD-TKX",
"side": "bid",
"type": "limit",
"status": "completed",
"originUnits": 425.42034625,
"price": 10.033,
"filledUnits": 425.42034625,
"commissionPaid": 12.8,
"commissionAsset": "SGD"
},
{
"orderId": 133481337,
"market": "SGD-TKX",
"side": "bid",
"type": "limit",
"status": "completed",
"originUnits": 10,
"price": 11,
"filledUnits": 10,
"commissionPaid": 1,
"commissionAsset": "SGD"
},
{
"orderId": 133430547,
"market": "SGD-TKX",
"side": "bid",
"type": "market fund",
"status": "completed",
"originUnits": 0,
"price": 0,
"filledUnits": 9.87767645,
"commissionPaid": null,
"commissionAsset": "SGD"
},
{
"orderId": 133429533,
"market": "SGD-TKX",
"side": "ask",
"type": "market",
"status": "completed",
"originUnits": 618.65081113,
"price": 9.9165,
"filledUnits": 616.7948587,
"commissionPaid": 1.85038457272017,
"commissionAsset": "SGD"
},
{
"orderId": 133429491,
"market": "SGD-TKX",
"side": "ask",
"type": "market",
"status": "completed",
"originUnits": 1237.30162226,
"price": 9.9272,
"filledUnits": 1233.5897174,
"commissionPaid": 3.70076914544034,
"commissionAsset": "SGD"
}
]
}
Check buy order
Check your buy order by specified ID.
GET /order/buy
GET /order/buy will be removed in the future (Exact date unknown). Please use GET /order/:orderId instead.
Parameter
Name | Type | Mandatory | Description |
orderId | Number | Yes |
Response
{
"status": "success",
"message": "",
"data": {
"orderId": 133481338,
"side": "bid",
"market": "SGD-TKX",
"status": "completed",
"type": "limit",
"transactTime": 1665716305753,
"originUnits": 425.42034625,
"price": 10.033,
"filledUnits": 425.42034624999997,
"commissionPaid": 12.799999999999999,
"fills": [
{
"id": 66692560,
"price": 10.033,
"units": 390.59920664,
"commission": 11.75230543,
"commissionAsset": "SGD"
},
{
"id": 66996972,
"price": 10.033,
"units": 34.82113961,
"commission": 1.04769457,
"commissionAsset": "SGD"
}
]
}
}
Current open your buy orders
Get all buy orders that you currently have opened.
GET /order/buy/open
GET /order/buy will be removed in the future (Exact date unknown). Please use GET /order instead.
Parameters
Name | Type | Mandatory | Description |
market | String | No | Get only orders match with symbol |
starttime | Long | No | Get order after this time |
endtime | Long | No | Get orders before this time |
Response
{
"message": "",
"status": "success",
"data": [
{
"orderId": 98332442,
"market": "BTC-LTC",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 500,
"commissionPaid": 0.0003422,
"type": "MARKET",
"status": "PENDING"
},
{
"orderId": 98332442,
"market": "BTC-ETH",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 500,
"commissionPaid": 0.0003422,
"type": "MARKET",
"status": "PENDING"
}
]
}
Get all your buy orders
GET /order/buy/all
GET /order/buy/all will be removed in the future (Exact date unknown).
Please use GET /order/:orderId instead.
Parameters
Name | Type | Mandatory | Description |
market | String | No | Get only orders match with symbol |
starttime | Long | No | Get order after this time |
endtime | Long | No | Get orders before this time |
Response
{
"message": "",
"status": "success",
"data": [
{
"orderId": 98332442,
"market": "BTC-ETH",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 0,
"commissionPaid": 0.0004223,
"type": "MARKET",
"status": "CANCEL"
},
{
"orderId": 98332442,
"market": "BTC-ETH",
"transactTime": "1507725176595",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 0,
"commissionPaid": 0.0004223,
"type": "MARKET",
"status": "COMPLETE"
},
{
"orderId": 98332442,
"market": "BTC-LTC",
"transactTime": "1507725176595",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 500,
"commissionPaid": 0.0004223,
"type": "MARKET",
"status": "PENDING"
},
{
"orderId": 98332442,
"market": "BTC-ETH",
"transactTime": "1507725176595",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 0,
"commissionPaid": 0.0004223,
"type": "MARKET",
"status": "PENDING"
}
]
}
Place a sell order
POST /order/sell
POST /order/sell will be removed in the future (Exact date unknown). Please use POST /order instead.
Parameters
Name | Type | Mandatory | Description |
market | String | Yes | |
units | Decimal | Yes | |
price | Decimal | Required when orderType is limit or stop limit | |
orderType | String | Yes | Currently it allows 4 types: “limit”, “market”, “stop limit”, or “trailing stop” |
timeInForce | String | Optional | Default value is “Good Till Cancelled” |
distancePrice | Number | Required when orderType is trailing stop | |
distanceType | String | Required when orderType is trailing stop | Options are “fiat” or “percent” |
Response
{
"message": "",
"status": "success",
"data": {
"orderid": 98332442,
"market": "BTC-LTC",
"price": 0.0071123,
"originUnits": 600,
"commissionPaid": 0.0004332,
"type": "MARKET",
"status": "PENDING"
}
}
Check sell order
Get your sell order by the specified ID
GET /order/sell
GET /order/sell will be removed in the future (Exact date unknown).
Please use GET /order/:orderId instead.
Parameter
Name | Type | Mandatory | Description |
orderid | Number | Yes |
Response
{
"message": "",
"status": "success",
"data": {
"orderid": 98332442,
"market": "BTC-LTC",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 600,
"commissionPaid": 0.0003442,
"type": "MARKET",
"status": "COMPLETE",
"fills": [
{
"price": 0.0071223,
"units": 200,
"commission": 12.333,
"commissionAsset": "LTC"
},
{
"price": 0.0071144,
"units": 400,
"commission": 12.333,
"commissionAsset": "LTC"
}
]
}
}
Cancel an order
Cancel your sell/buy order by specified ID
DELETE /order/:orderid
Parameter
Name | Type | Mandatory | Description |
orderid | Number | Yes |
Response
{
"message": "",
"status": "success",
"data": {
"orderid": 98332442,
"market": "BTC-ETH",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 0,
"commissionPaid": 0.0005044,
"type": "MARKET",
"status": "CANCEL"
}
}
Cancel all pending orders
To cancel all pending orders
DELETE /order
Current open sell order
Get all sell orders that you currently have opened.
GET /order/sell/open
GET /order/sell/open will be removed in the future (Exact date unknown). Please use GET order/:orderId instead.
Parameters
Name | Type | Mandatory | Description |
market | String | No | Get only ask match with symbol |
starttime | Long | No | Get ask after this time |
endtime | Long | No | Get ask before this time |
Response
{
"message": "",
"status": "success",
"data": [
{
"orderid": 98332442,
"market": "BTC-LTC",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 500,
"commissionPaid": 0.0005044,
"type": "MARKET",
"status": "PENDING"
},
{
"orderid": 98332442,
"market": "BTC-ETH",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 0,
"commissionPaid": 0.0005044,
"type": "MARKET",
"status": "PENDING"
}
]
}
Get all your sell orders
GET /order/sell/all
GET /order/sell/all will be removed in the future. (Exact date unknown).Please use GET /order instead.
Parameters
Name | Type | Mandatory | Description |
market | String | No | Get only ask match with symbol |
starttime | Long | No | Get ask after this time |
endtime | Long | No | Get ask before this time |
Response
{
"message": "",
"status": "success",
"data": [
{
"orderid": 98332442,
"market": "BTC-ETH",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 0,
"commissionPaid": 0.0005044,
"type": "MARKET",
"status": "CANCEL"
},
{
"orderid": 98332442,
"market": "BTC-ETH",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 0,
"commissionPaid": 0.0005044,
"type": "MARKET",
"status": "COMPLETE"
},
{
"orderid": 98332442,
"market": "BTC-LTC",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 500,
"commissionPaid": 0.0005044,
"type": "MARKET",
"status": "PENDING"
},
{
"orderid": 98332442,
"market": "BTC-ETH",
"price": 0.0071123,
"originUnits": 600,
"filledUnits": 0,
"commissionPaid": 0.0005044,
"type": "MARKET",
"status": "PENDING"
}
]
}
Get account information
Use to get your account information
GET /account
Response
{
"message": "",
"status": "success",
"data": {
"email": "john@tokenize.exchange",
"fullName": "John Levis",
"accountType": "personal",
"membership": "Platinum",
"referral": 5,
"rewards": ""
}
}
Get account balances
Use to retrieve all balances from your account.
GET /account/balances
Response
{
"message": "",
"status": "success",
"data": [
{
"currency": "BTC",
"balance": 40000,
"available": 40000,
"pending": 0.00000,
"address": "1MacMr6715hjds342dXuLqXcju6fgwHA31"
},
{
"currency": "LTC",
"balance": 50000,
"available": 50000,
"pending": 0.00000,
"address": "HHKkJKJKLL4422ddkkkkdfaFaaFFEWWEE"
}
]
}
Get currency balance
Use to retrieve the balance from your account for a specified currency.
GET /account/balance
Parameter
Name | Type | Mandatory | Description |
currency | String | YES |
Response
{
"message": "",
"status": "success",
"data": {
"currency": "LTC",
"balance": 50000,
"available": 50000,
"pending": 0.00000,
"address": "HHKkJKJKLL4422ddkkkkdfaFaaFFEWWEE"
}
}
Get deposit address
Use to retrieve or generate an address for a specified currency.
GET /account/deposit-address
Parameter
Name | Type | Mandatory | Description |
currency | String | YES |
Response
{
"message": "",
"status": "success",
"data": {
"currency": "LTC",
"address": "HHKkJKJKLL4422ddkkkkdfaFaaFFEWWEE"
}
}
Get daily withdrawal limit
Use to retrieve daily withdrawal limit for a specified currency.
GET /account/daily-withdrawal-limit
Parameter
Name | Type | Mandatory | Description |
currency | String | YES |
Response
{
"status": "success",
"message": "",
"data": {
"currency": "ETH",
"remaining": 225,
"used": 0,
"limit": 225,
"minLimit": 0.1
}
}
Crypto Earn API
Get the running deposits
Returns all the running deposits.
GET /earn/list-active-deposits
Response
{
"status": "string",
"message": "string",
"data": [
{
"id": 1,
"initial_amount": "10.00000000",
"available_amount": "10.00000000",
"currency_id": 18,
"currency_code": "ETH",
"currency_name": "Ethereum",
"annual_percentage_rate": 4,
"compound_interest": 1,
"profit": null,
"stake_of_currency_id": null,
"stake_currency_code": null,
"isFlexi": true,
"start_at": 1655196104492,
"end_at": 1686732104492,
"withdrawal_date": 1655395200000
},
{
"id": 2,
"initial_amount": "1.00000000",
"available_amount": "1.00000000",
"currency_id": 18,
"currency_code": "BTC",
"currency_name": "Bitcoin",
"annual_percentage_rate": 4,
"compound_interest": 1,
"profit": null,
"stake_of_currency_id": null,
"stake_currency_code": null,
"isFlexi": true,
"start_at": 1655196104492,
"end_at": 1686732104492,
"withdrawal_date": 1655395200000
}
]
}
Get the deposit history
GET /earn/deposit/:depositId/history
Parameters
Name | Type | Mandatory | Description |
depositId | Number | YES |
Response
{
"status": "success",
"message": "",
"data": [
{
"type": "withdrawal",
"amount": "0.10000000",
"time": 1655196152237,
"interest_amount": null,
"interest_time": 1655196152237,
"currency_name": "Bitcoin",
"currency_code": "BTC"
},
{
"type": "payment",
"interest_amount": "0.0044845900",
"time": 1625068800000,
"interest_time": 1626281315883,
"status": 1,
"currency_name": "Bitcoin",
"currency_code": "BTC"
},
{
"type": "payment",
"interest_amount": "0.0020000000",
"time": 1635696000000,
"interest_time": 1636728870663,
"status": 1,
"currency_name": "Bitcoin",
"currency_code": "BTC"
},
{
"type": "payment",
"interest_amount": "0.0005000000",
"time": 1638288000000,
"interest_time": 1638419033998,
"status": 1,
"currency_name": "Bitcoin",
"currency_code": "BTC"
},
{
"type": "deposit",
"amount": "0.10000000",
"time": 1601436458809,
"currency_name": "Bitcoin",
"currency_code": "BTC"
}
]
}
Get the inactive deposits
Returns all the inactive deposits.
GET /earn/list-inactive-deposits
Response
{
"status": "string",
"message": "string",
"data": [
{
"id": 1,
"initial_amount": "10.00000000",
"available_amount": "0.00000000",
"currency_id": 18,
"currency_code": "ETH",
"currency_name": "Ethereum",
"annual_percentage_rate": 4,
"compound_interest": 1,
"profit": null,
"stake_of_currency_id": null,
"stake_currency_code": null,
"isFlexi": true,
"start_at": 1655196104492,
"end_at": 1686732104492,
"withdrawal_date": 1655395200000
},
{
"id": 2,
"initial_amount": "1.00000000",
"available_amount": "0.00000000",
"currency_id": 18,
"currency_code": "BTC",
"currency_name": "Bitcoin",
"annual_percentage_rate": 4,
"compound_interest": 1,
"profit": null,
"stake_of_currency_id": null,
"stake_currency_code": null,
"isFlexi": true,
"start_at": 1655196104492,
"end_at": 1686732104492,
"withdrawal_date": 1655395200000
}
]
}
API Limit
Tokenize Xchange has a global limit of public API:
- 600 requests per minute ( including market information and trades )
- For trade requests, there’s another limit that is only one trade at a moment, no concurrency