API DOCUMENTATION

Overview

COIN ASSET provide REST API allow you to programmatically performs actions with our exchange system. Our API return all data in JSON format.

The base endpoint is: https://api.coinasset.co.th

Public API

Ticker

Return all Markets data

Request
GET https://api.coinasset.co.th/api/v1/tickers
Response
{
    "DASH-BTC": {
        "symbol": "DASH-BTC",
        "lastPrice": 0.053,
        "highestBid": 0.051,
        "lowestAsk": 0.055,
        "low24Hr": 0.0501,
        "high24Hr": 0.59,
        "volume24Hr": 24.15528009,
        "change24Hr": 4.07
    },
    "ETH-BTC": {
        "symbol": "ETH-BTC",
        "lastPrice": 0.0601,
        "highestBid": 0.0597,
        "lowestAsk": 0.0602,
        "low24Hr": 0.0512,
        "high24Hr": 0.0689,
        "volume24Hr": 1072.5197235,
        "change24Hr": -3.56
    }
}

Order Books

Return all order book for a symbol pairing.

Request
GET https://api.coinasset.co.th/api/v1/order-books
Parameter Type Mandatory Description
symbol String Yes
limit int No Default 100, Range 1-1000
Example
GET https://api.coinasset.co.th/api/v1/order-books?symbol=ETH-BTC&limit=10
Response
{
    "bids": [
        [
            0.57284299,
            0.83770657465043
        ],
        [
            0.55152984,
            0.98423405882073
        ],
        ],
    "asks": [
        [
            0.58017604,
            0.4466535404297
        ],
        [
            0.593305143,
            0.57021353
        ],
    ],
}

Recent Trades

Get recent trades (up to last 1,000).

Request
GET https://api.coinasset.co.th/api/v1/trades
Parameter Type Mandatory Description
symbol String Yes
limit int No Default 100, Range 1-1000
Example
GET https://api.coinasset.co.th/api/v1/trades?symbol=ETH-BTC&limit=10
Response
[
    {
        "type": "SELL",
        "price": 0.05863602,
        "qty": 0.49907416,
        "amount": 0.29263722,
        "time": 1516111338,
        "reference_id": 1
    },
    {
        "type": "BUY",
        "price": 0.05850379,
        "qty": 0.04070871,
        "amount": 0.00238161,
        "time": 1516528732,
        "reference_id": 2
    },
]

Private API

In order to use private API, you will need to create an API key for your account.

All request to the private API are sent via HTTP POST to https://api.coinasset.co.th and must contain the following parameters via either queryString or in postBody:

  • api_key Your API Key.
  • signature A HMAC SHA256 signatures signed by your API Key and secret. A PHP code example hash_hmac('sha256', $api_key, $secret)

  • timestamp Timestamp is a "nonce" parameter, an integer which must always be greater than the previous nonce used.

Create Order

Request Buy Order
POST https://api.coinasset.co.th/api/v1/buy-order
Request Sell Order
POST https://api.coinasset.co.th/api/v1/sell-order
Parameter Type Mandatory Description
pair_id String Yes
quantity Number Yes
price Number Yes
note string optional Additional note for order
Response
{
        "success": true,
        "order_id": "a53644d0-330a-11e8-9d89-a1317b3c09e8"
}
Response (error)
{
        "success": false,
        "message": "Error message will show here"
}

Cancel Order

Request
POST https://api.coinasset.co.th/api/v1/cancel-order
Parameter Type Mandatory Description
order_id String Yes
Response
{
        "success": true
}
Response (error)
{
        "success": false,
        "message": "Error message will show here"
}

Opened Orders

Request
POST https://api.coinasset.co.th/api/v1/order
Response
[{
    "order_id": "abeb08e0-b1aa-11e8-a952-6798475d01c4",
    "pair_id": "ETH-BTC",
    "quantity": 1,
    "price": 0.038,
    "datetime": "2018-09-10 08:00:03"
  }, {
    "order_id": "abec1a00-b1aa-11e8-9a6b-218f9c192e53",
    "pair_id": "BTC-THB",
    "quantity": 2000,
    "price": 210000,
    "datetime": "2018-09-10 08:00:02"
  }, {
    "order_id": "abece160-b1aa-11e8-8d67-d72bb2587bfa",
    "pair_id": "XRP-THB",
    "quantity": 300,
    "price": 12,
    "datetime": "2018-09-10 08:00:01"
}]

Transaction History

Request
POST https://api.coinasset.co.th/api/v1/transaction
Parameter Type Mandatory Description
start_date date No

format Y-m-d. Ex. 2018-09-01

Default 30 days

end_date date No format Y-m-d. Ex. 2018-09-30
Response
[{
    "currency_id": "BTC",
    "type": "deposit",
    "amount": 1,
    "ending_balance": 10,
    "details": "DETAILS 1",
    "note": "NOTE 1",
    "datetime": "2018-09-30 23:59:59",
  }, {
    "currency_id": "ETH",
    "type": "withdraw",
    "amount": 2,
    "ending_balance": 6,
    "details": "DETAILS 2",
    "note": "NOTE 2",
    "datetime": "2018-09-25 08:00:01",
}]

Balance

Return all user balances for all currencies.

Request
POST https://api.coinasset.co.th/api/v1/balances
Response
{
    "BTC": {
        "total": 2.54234298,
        "available": 2.5,
        "opened": 0.04234298,
        "incoming": 0,
        "withdrawal": 0,
    },
    "ETH": {
        "total": 0,
        "available": 0,
        "opened": 0,
        "incoming": 0,
        "withdrawal": 0,
    }
}

Deposit Address

Return all user deposit addresses for all currencies.

Request
POST https://api.coinasset.co.th/api/v1/deposit-address
Response
{
    "BTC": "mi9QMpuYTqbxNktUYDhukYYAJG1pKwbTm2"
    "ETH": "0x0740d1Cde3c4Aa93b7e49c9fB027018aF03A8231"
}

Create a new deposit address.

Request
POST https://api.coinasset.co.th/api/v1/deposit-address/create
Parameter Type Mandatory Description
currency_id String Yes Currency symbol to create a deposit address for.
Response
{
    "BTC": "mi9QMpuYTqbxNktUYDhukYYAJG1pKwbTm2"
    "ETH": "0x0740d1Cde3c4Aa93b7e49c9fB027018aF03A8231"
}