NAV Navbar

Tokocrypto API V1

The Tokocrypto APIs are designed to allow access to the features of the Tokocrypto platform, subject to you complying with the API Terms of Service. The end goal is to allow people to potentially recreate the entire platform on their own.

Overview

Example programming for authenticated Endpoints http://bit.ly/tokoApiExample

Authentication

Authentication is done using an API key and a secret. The authentication procedure is as follows:

The payload is the parameters object, first JSON encoded, and then encoded into Base64 payload = parameters-object -> JSON encode -> base64

The signature is the hex digest of an HMAC-SHA384 hash where the message is your payload, and the secret key is your API secret. signature = HMAC-SHA384(payload, api-secret).digest('hex')

send (api-key, payload, signature)

These are encoded as HTTP headers named:

Rate limit

If an IP address exceeds 60 of requests per minute to a REST API endpoint, the JSON response {"err_str": "limit exceeded"} will be returned. Please note the exact logic and handling for such DDoS defenses may change over time to further improve reliability.

Authenticated Endpoint

You use your API key and secret

Transaction History

Respon:

{
  "success": true,
  "message_code": "get_transaction_success",
  "data": [
    {
      "Id": "cadae930-7238-11e9-af4a-552e8d7df1be",
      "Side": "Buy",
      "Currency": "ETH",
      "Amount": 20.21,
      "Status": "Success",
      "DateTime": "2019-05-09T08:59:45.859Z"
    },
  ]
}

HTTP Request

GET https://api.tokocrypto.com/v1/history/transaction

Header Description
X-TC-APIKEY dcf223c0f96891db2da3099675e8bdfabead1e53e88fa4997576dc2e5b51b060
X-TC-PAYLOAD eyJjdXJyZW5jeSI6ImJ0YyIsImFtb3VudCI6MTAwMDAwLCJzaWRlIjoiYnV5Iiwibm9uY2UiOjM1fQ==
X-TC-SIGNATURE cadf4c61bcb00c82f82506f9182835878226cae4f3ecf22c06aeb52e2ea7fe01e6af652dff3d4a63f540055dd9189495

Deposit History

Respon:

{
  "success": true,
  "message_code": "get_deposit_success",
  "data": [
    {
      "Id": "7a7e3c0e-987e-48ea-9182-754401d9efba",
      "TxId": "04b3fc515b261754dc12dcb19272662266aabda6faf2e4445475f3be080948eb",
      "Currency": "BTC",
      "Type": "Deposit",
      "Status": "Success",
      "Amount": 0.049,
      "DateTime": "2018-10-24T11:47:17.649Z"
    },
    {
      "Id": "7a7e3c0e-15oe-48ea-9182-754401d9e123",
      "TxId": null,
      "Currency": "IDR",
      "Type": "Deposit",
      "Status": "Success",
      "Amount": 10000000,
      "DateTime": "2018-08-04T02:57:57.940Z"
    }
  ]
}

HTTP Request

GET https://api.tokocrypto.com/v1/history/deposit

Header Description
X-TC-APIKEY 78760b20b5de6f884abd01b24eaaf91642beaef598a04a329b51fe8ce8303de9
X-TC-PAYLOAD eyJjdXJyZW5jeSI6InhycCIsImFtb3VudCI6MTAwMDAwLCJzaWRlIjoiYnV5Iiwibm9uY2UiOjQwfQ==
X-TC-SIGNATURE b6a5263a826f484d9f70e6ecaf1355c93d6c3c9616347c38c7148f284cb6b68937047d8ed5a9345aab25737cca23422a

Withdraw History

Respon:

{
  "success": true,
  "message_code": "get_withdraw_success",
  "data": [
    {
      "Id": "912f9e1e-05f5-48ac-a15f-e459f015aadd",
      "Fee": 0,
      "Type": "Withdraw",
      "Status": "Pending",
      "Currency": "IDR",
      "Amount": 500000,
      "TxId": null,
      "BankDetails": "{\"UpdatedAt\":\"2019-05-15T03:16:14.354Z\",\"UserId\":\"321d2d31-2742-4e92-9b5b-a43a6a77518f\",\"City\":\"Malang\",\"AccountNumber\":\"1213456\",\"BankAccountId\":\"7f38e27d-79c7-4e76-9cfb-3968a392dceb\",\"BankName\":\"BRI\",\"BankAccountType\":\"Withdraw\",\"Status\":\"Active\",\"CreatedAt\":\"2019-05-15T03:16:14.354Z\"}",
      "DateTime": "2019-05-15T03:16:36.849Z"
    },
    {
      "Id": "edafbc31-578c-4d22-b85c-5f3edef95900",
      "Fee": 0.0005,
      "Type": "Withdraw",
      "Status": "Pending",
      "Currency": "BTC",
      "Amount": 0.05,
      "TxId": null,
      "BankDetails": null,
      "DateTime": "2019-05-15T03:15:51.457Z"
    }
  ]
}

HTTP Request

GET https://api.tokocrypto.com/v1/history/withdraw?

Header Description
X-TC-APIKEY dcf223c0f96891db2da3099675e8bdfabead1e53e88fa4997576dc2e5b51b060
X-TC-PAYLOAD eyJub25jZSI6MjV9
X-TC-SIGNATUR E9e1ba1acafaeec8e2b9e1128c3617c3e2618b7c7064614d672b85339bac32c574e07bdf981ea9f1b01f4a5bf99339153

STP (deprecated)

Request Body:

{
    "currency": "btc", // crypto currency that you want to trade. Currently we only support btc, eth, xrp, and dgx
    "amount": 100000, // for buying request, this amount must be in Rupiah. for selling request, amount must be in crypto
    "side": "buy", // this is for action of transaction. "buy" or "sell"
    "nonce": 190287765 // increment integer
}

Respon:

{
  "success": true,
  "message_code": "create_conversion_success",
  "data": {
    "ConversionId": "204624d0-d819-11e8-b025-e1c17a4ca947",
    "DateTime": "2018-10-25T05:45:06.485Z",
    "Side": "Buy",
    "Price": 99986300,
    "Amount": 0.00099513,
    "Currency": "BTC"
  }
}

HTTP Request

POST https://api.tokocrypto.com/v1/stp

Header Description
X-TC-APIKEY dcf223c0f96891db2da3099675e8bdfabead1e53e88fa4997576dc2e5b51b060
X-TC-PAYLOAD eyJjdXJyZW5jeSI6InhycCIsImFtb3VudCI6MTAwMDAwLCJzaWRlIjoiYnV5Iiwibm9uY2UiOjQwfQ==
X-TC-SIGNATUR be11c95cd703ca7be609315cc05e43da05da5f63cd18a9956d5437d598f594603783a3cf02169c214cb1b923fb17d9c0

Account

Respon:

{
  "success": true,
  "message_code": "get_account_success",
  "data": {
    "Balance": [
      {
        "Amount": 10000000000000008,
        "AvailableBalance": 10000000000000008,
        "Status": "active",
        "Currency": "BTC"
      },
      ...
    ]
  }
}

HTTP Request

GET https://api.tokocrypto.com/v1/account

Header Description
X-TC-APIKEY 6486e79b47f3abdef691fd2738d6708ad1abfaae800a70e121a1de4acfd194ec
X-TC-PAYLOAD eyJjdXJyZW5jeSI6InhycCIsImFtb3VudCI6MTAwMDAwLCJzaWRlIjoiYnV5Iiwibm9uY2UiOjM4fQ==
X-TC-SIGNATUR 553a61293e297d07037bab3ddd957ade680a72dbc7be7a783a8abd4eab13686279d8ca406f32db2d1eb700975e7376ee

Order

create an order and cancel order

Request Body Create Order:

{
  "side": "sell", // sell or buy
  "quantity": 0.6, // amount you want to trade
  "type": "limit", // limit or market
  "price": 1500000, // price in IDR
  "currency": "eth", // currency
  "nonce": 49, // nonce, must be increase number
  "submission": "1" 
}

Request Body Cancle Order:

{
  "nonce": 49,
  "submission": "2",
  "orderId": 40
}

Request Body Cancle All Order:

{
  "nonce": 49,
  "submission": "3"
}

Request Body Cancel by Selected Orders:

{
  "nonce": 49,
  "submission": "4",
  "orders": [123, 567] // order Id in array of Integer
}

Respon:

{
  "success": true,
  "message_code": "cancel_all_order_success",
  "data": "All orders cancled successfully"
}

HTTP Request

POST https://api.tokocrypto.com/v1/order

Header Description
X-TC-APIKEY ed20fff474dca6a42bc3003737e99d152b30998ac8213cf550d89642ca2bce0b
X-TC-PAYLOAD eyJvcmRlcklkIjo0MSwic2lkZSI6InNlbGwiLCJxdWFudGl0eSI6MC41LCJ0eXBlIjoibGltaXQiLCJwcmljZSI6NzAwMDAwLCJjdXJyZW5jeSI6ImV0aCIsIm5vbmNlIjoxMzEsInN1Ym1pc3Npb24iOiJjYW5jZWwgYWxsIn0=
X-TC-SIGNATURE 553a61293e297d07037bab3ddd957ade680a72dbc7be7a783a8abd4eab13686279d8ca406f32db2d1eb700975e7376ee

List active orders

Respon:

{
  "success": true,
  "message_code": "get_all_active_order_success",
  "data": [
    {
      "orderId": 42,
      "type": "limit",
      "side": "sell",
      "currencyPair": "ETHIDR",
      "quantity": 12,
      "availableQuantity": 12,
      "postOnly": false,
      "price": 50000,
      "Status": "active",
      "Match": null,
      "dateTime": "2019-03-08T06:48:25.000Z"
    }
  ]
}

HTTP Request

GET https://api.tokocrypto.com/v1/order/list

Header Description
X-TC-APIKEY e31d705743dcd4c85f0af1cb3fb59836583f2cda8ab90d6e4996dff564eea3f9
X-TC-PAYLOAD eyJub25jZSI6OX0=
X-TC-SIGNATUR 1b2cc2f82f9f088601601ec1f063437e373a6681b5af6456f9aae401335663903928e53af97e4365df0bf617b47d210a

Detail Order

Respon:

{
  "success": true,
  "message_code": "get_detail_order_success",
  "data": {
    "orderId": 518580,
    "type": "limit",
    "currencyPair": "BTCIDR",
    "quantity": 1,
    "side": "sell",
    "availableQuantity": 1,
    "postOnly": false,
    "price": 145000000,
    "status": "fulfilled",
    "dateTime": "2019-09-06T02:36:21.000Z"
  }
}

HTTP Request

GET https://api.tokocrypto.com/v1/order/get

Header Description
X-TC-APIKEY 63cf79203b141fab70354d3f4664f2749d8436469a168ce77d5ebb4278914ed0
X-TC-PAYLOAD eyJub25jZSI6MTIsIm9yZGVySWQiOjUxODU4MH0=
X-TC-SIGNATUR 469f748d4d8ded57ebc5117159ce7d834b8b65f3a35d51a5d32b2e371f08b6ddfc8272b08adae423039f3475f1111d43

Public Endpoint

All Public Endpoints use GET requests

rates

Respon:

{
  "success": true,
  "message_code": "get_rates_success",
  "data": [
    {
      "currencyPair": "XRPIDR",
      "buy": 7200,
      "sell": 7100
    },
    {
      "currencyPair": "BTCIDR",
      "buy": 102676100,
      "sell": 101726900
    },
    {
      "currencyPair": "ETHIDR",
      "buy": 3262000,
      "sell": 3232500
    }
  ]
}

HTTP Request

POST https://api.tokocrypto.com/v1/rates

Showing current rate for all available crypto

Ticker

Respon:

{
  "success": true,
  "message_code": "get_ticker_success",
  "data": {
    "Name": "XRPIDR",
    "Close": 5454,
    "Low": 5428,
    "High": 5513,
    "Open": 5464,
    "Volume": 251653454,
    "Buy": 5559,
    "Sell": 5348,
    "DateTime": "2019-05-23"
  }
}

HTTP Request

GET https://api.tokocrypto.com/v1/rates/ticker?currencyPair=dgxidr&type=days

The ticker is a high level overview of the state of the market. It shows you the current best bid and ask, as well as the last trade price. It also includes information such as daily volume and how much the price has moved over the last day.

Params Description
currencyPair dgxidr -- btcidr, xrpidr, ttcidr, gusdidr, usdtidr, tusdidr, paxidr, ethidr, dgxidr,usdcidr
type days -- there are 2 types, "hours" and "days"

Orderbook

Respon:

{
  "bids": [
    [
      50000,
      14.998
    ],
    [
      30000,
      6
    ],
    [
      10000,
      10
    ],
    [
      112,
      1
    ]
  ],
  "asks": [
    [
      70000,
      50
    ],
    [
      80000,
      55
    ],
    [
      90000,
      60
    ]
  ],
  "timestamp": 1550676264034
}

HTTP Request

GET https://api.tokocrypto.com/v1/orderbook/btcidr

/v1/orderbook/{currencyPair}

btcidr, dgxidr, ethidr, xrpidr, ttcidr, tusdidr, paxidr, usdtidr, gusdidr, usdcidr [price, volume]

can add page for pagination example: https://api.tokocrypto.com/v1/orderbook/eth?page=0 *page is starting from 0

Get All Tickers

Respon:

{
  "success": true,
  "message_code": "get_tickers_success",
  "data": [
    {
      "Name": "BTCIDR",
      "Close": 117000000,
      "Low": 117000000,
      "High": 123899500,
      "Open": 123881000,
      "Volume": 4808471,
      "Buy": 117000000,
      "Sell": 117000000,
      "DateTime": "2019-06-17"
    },
    {
      "Name": "ETHIDR",
      "Close": 4053840,
      "Low": 3845500,
      "High": 4417928,
      "Open": 3916000,
      "Volume": 119675,
      "Buy": 4064000,
      "Sell": 4043680,
      "DateTime": "2019-06-17"
    },
    ...
  ]
}

HTTP Request

GET https://api.tokocrypto.com/v1/rates/tickers

Errors

The Kittn API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The kitten requested is hidden for administrators only.
404 Not Found -- The specified kitten could not be found.
405 Method Not Allowed -- You tried to access a kitten with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The kitten requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.