API - Cryptoa
PHP

Introduction

Introduction
https://www.cryptoa.com 

The CRYPTOA API allows you to integrate the CRYPTOA trading platform with third party applications, such as trading applications, charting programs, point of sale systems, and much more. Below you will find details on how the system functions, along with examples in common programming languages.

General

The authentication procedure is as follows:

Api Access URL : https://www.cryptoa.com/api/{method}

  • 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)

send (api-key, payload, signature)

These are encoded as HTTP headers named:

  • X-CRYPTOA-APIKEY
  • X-CRYPTOA-PAYLOAD
  • X-CRYPTOA-SIGNATURE

In order to access the parts of the API which require authentication, you must generate an API key and an API secret using this page

You can generate as many API keys as you would like, and each of those keys can be customised in a few ways.

In order to access the parts of the API which require authentication, you must generate an API key and an API secret using this page

You can generate as many API keys as you would like, and each of those keys can be customised in a few ways.

Precision

We return decimal numbers as strings to preserve full precision across platforms. We recommend you also convert your numbers to string in order to avoid undesired consequences from precision and truncation errors.

Authentication

All examples assume the following:

  • 1. You are using the provided example request object
  • 2. You use your API key and secret

Private API

Account Balance

Account Balance

              

https://www.cryptoa.com/api/getbalances

  {
      "BTC": {
          "currencyName": "Bitcoin",
          "available": "1040.50000000",
          "onOrders": "0.00000000"
      },
      "BCH": {
          "currencyName": "Bitcoin Cash",
          "available": "938.53383854",
          "onOrders": "0.00000000"
      },
      "ETH": {
          "currencyName": "Ethereum",
          "available": "1000.00000000",
          "onOrders": "0.00000000"
      }
  }
  

This endpoint returns the all currency balances.

HTTP Request

POST : /getbalances/

JSON Response Payload

Field Name Type Description Units
NULL NULL NULL NULL

Currency Balance

Currency Balance

              

https://www.cryptoa.com/api/currencybalance

{
  "BCH": {
      "currencyName": "Bitcoin Cash",
      "available": "938.53383854",
      "onOrders": "0.00000000"
  }
}

This endpoint returns the particular currency balances.

HTTP Request

POST : /currencybalance/

JSON Response Payload

Field Name Type Description Units
currency String Trade currency (BTC) Major

Trade History

Trade History

              

https://www.cryptoa.com/api/returnTradeHistory

{
    "status": "success",
    "result": [
        {
            "orderNumber": 5,
            "amount": "100.00000000",
            "rate": "0.10000000",
            "type": "sell",
            "datetime": "2018-11-22 15:59:24",
            "status": "filled"
        },
        {
            "orderNumber": 9,
            "amount": "10.00000000",
            "rate": "1.00000000",
            "type": "buy",
            "datetime": "2018-11-22 16:01:39",
            "status": "filled"
        },
        {
            "orderNumber": 10,
            "amount": "10.00000000",
            "rate": "2.00000000",
            "type": "buy",
            "datetime": "2018-11-22 16:01:39",
            "status": "filled"
        },
        {
            "orderNumber": 11,
            "amount": "10.00000000",
            "rate": "3.00000000",
            "type": "buy",
            "datetime": "2018-11-22 16:01:39",
            "status": "filled"
        }
    ]
}
            
                        
          

This endpoint returns a list of existing exchange order books and their respective order placement limits.

HTTP Request

POST : /returnTradeHistory/

JSON Response Payload

Field Name Type Description Units
pair String Trade pair (BTC_XRP) Major

Trade Details

Trade Details

              

https://www.cryptoa.com/api/TradeDetails

{
    "status": "success",
    "result": {
        "msg": {
            "orderNumber": 237,
            "amount": "0.00000046",
            "rate": "31368.30879624",
            "type": "buy",
            "datetime": "2018-11-23 17:26:15",
            "status": "filled",
            "pair": 1,
            "pair_symbol": "BCH_BTC",
            "filledAmount": 0,
            "fees": 0
        }
    }
}

                        
          

This endpoint returns a list of existing exchange order details.

HTTP Request

POST : /TradeDetails/

JSON Response Payload

Field Name Type Description Units
orderId Integer Trade Id (345) Major

Open Buy Orders

Open Buy Orders

              

https://www.cryptoa.com/api/openbuyOrders

{
    "status": "success",
    "result": [
        {
            "orderNumber": 246,
            "amount": "1.00000000",
            "rate": "100.00000000",
            "type": "buy",
            "datetime": "2018-11-23 18:44:53",
            "status": "partially"
        }
    ]
}              
          

This endpoint returns a list of existing exchange open buy order books.

HTTP Request

POST : /openbuyOrders/

JSON Response Payload

Field Name Type Description Units
pair String Trade pair (BTC_XRP) Major

Open Sell Orders

Open Buy Orders

              

https://www.cryptoa.com/api/opensellOrders

{
    "status": "success",
    "result": [
        {
            "orderNumber": 247,
            "amount": "1.00000000",
            "rate": "101.00000000",
            "type": "sell",
            "datetime": "2018-11-23 18:45:53",
            "status": "active"
        }
    ]
}                
          

This endpoint returns a list of existing exchange open sell order books.

HTTP Request

POST : /opensellOrders/

JSON Response Payload

Field Name Type Description Units
pair String Trade pair (BTC_XRP) Major

Filled Orders

Filled Orders

              

https://www.cryptoa.com/api/filledOrders

{
    "status": "success",
    "result": [
        {
            "orderNumber": 5,
            "amount": "100.00000000",
            "rate": "0.10000000",
            "type": "sell",
            "datetime": "2018-11-22 15:59:24",
            "status": "filled"
        },
        {
            "orderNumber": 9,
            "amount": "10.00000000",
            "rate": "1.00000000",
            "type": "buy",
            "datetime": "2018-11-22 16:01:39",
            "status": "filled"
        },
        {
            "orderNumber": 10,
            "amount": "10.00000000",
            "rate": "2.00000000",
            "type": "buy",
            "datetime": "2018-11-22 16:01:39",
            "status": "filled"
        }
    ]
}             
          

This endpoint returns a list of existing exchange fiiled order books and their respective order placement limits.

HTTP Request

POST : /filledOrders/

JSON Response Payload

Field Name Type Description Units
pair String Trade pair (BTC_XRP) Major

Deposit History

Deposit History

              

https://www.cryptoa.com/api/depositHistory

{
  "status": "success",
  "result": [
      {
          "txid": "f76f3a8bb9d9d8d3d61da955b3c4718d8b9dffaaebfa68da99618c4457f0aa90",
          "address": "B9adoTXb6VRgqzgo2G8BJvqUx8sUsSpVzJ",
          "amount": "50.00000000",
          "currency": "BR",
          "time": "2018-10-30 18:00:01"
      },
      {
          "txid": "a125137216bda0b049b2c7ed9da88867a108eeae56af87509f12c53309ddd6be",
          "address": "B9adoTXb6VRgqzgo2G8BJvqUx8sUsSpVzJ",
          "amount": "10.00000000",
          "currency": "BR",
          "time": "2018-10-30 17:05:01"
      },
      {
          "txid": "40877682cc3766bde2c408af9236d1acb8d0708284aae1e807eb235102c657fd",
          "address": "1QRehrnK7fAo7CwPWLch1J875gNd4cNkh",
          "amount": "83.00000000",
          "currency": "USDT",
          "time": "2018-08-27 13:19:33"
      }
  ]
}       
          

This endpoint returns a list of existing deposit history.

HTTP Request

POST : /depositHistory/

JSON Response Payload

Field Name Type Description Units
NILL NILL NILL NILL

Withdraw History

Withdraw History

              

https://www.cryptoa.com/api/withdrawHistory

{
  "status": "success",
  "result": [
      {
          "txid": "WD-H6KGZBKT",
          "amount": "0.02787640",
          "transferredAmount": "0.02759764",
          "status": "Paid",
          "time": "2018-10-27 03:14:08"
      },
      {
          "txid": "WD-QW5P1K6G",
          "amount": "0.01499599",
          "transferredAmount": "0.01484603",
          "status": "Paid",
          "time": "2018-10-25 22:46:13"
      },
      {
          "txid": "WD-8KMA7I28",
          "amount": "0.02727205",
          "transferredAmount": "0.02699933",
          "status": "Not Paid",
          "time": "2018-10-26 02:33:17"
      },
      {
          "txid": "WD-BJVZFU2F",
          "amount": "0.00268956",
          "transferredAmount": "0.00266266",
          "status": "Paid",
          "time": "2018-10-23 05:06:03"
      }
  ]
}              
    

This endpoint returns a list of existing withdraw history.

HTTP Request

POST : /withdrawHistory/

JSON Response Payload

Field Name Type Description Units
NILL NILL NILL NILL

Send History

Send History

              

https://www.cryptoa.com/api/sendHistory

{
    "status": "success",
    "result": [
        {
            "txid": "SD-S7XH5MFB",
            "email": "[email protected]",
            "currencySymbol": "BR",
            "amount": "480.00000000",
            "status": "Approved",
            "time": "2018-10-04 07:06:21"
        },
        {
            "txid": "SD-VRDNNEDL",
            "email": "[email protected]",
            "currencySymbol": "BR",
            "amount": "10.00000000",
            "status": "Approved",
            "time": "2018-10-04 07:02:32"
        }
    ]
}              
          

This endpoint returns a list of existing internal transction send history.

HTTP Request

POST : /sendHistory/

JSON Response Payload

Field Name Type Description Units
NILL NILL NILL NILL

Receive History

Receive History

              

https://www.cryptoa.com/api/receiveHistory

{
  "status": "success",
  "result": [
      {
          "txid": "RE-YRESMREW",
          "mail": "[email protected]",
          "currencySymbol": "BR",
          "amount": "485.10000000",
          "status": "Pending",
          "time": "2018-10-06 12:48:34"
      },
      {
          "txid": "RE-CDYQPTX5",
          "mail": "[email protected]",
          "currencySymbol": "BR",
          "amount": "485.10000000",
          "status": "Pending",
          "time": "2018-10-06 11:38:43"
      }
  ]
}             
          

This endpoint returns a list of existing internal transaction receive history.

HTTP Request

POST : /receiveHistory/

JSON Response Payload

Field Name Type Description Units
NILL NILL NILL NILL

Make Orders

Make Orders

              

https://www.cryptoa.com/api/createOrder

{
  "status": {
      "status": "Order placed successfully"
  },
  "result": {
      "orderNumber": 250,
      "amount": "0.10000000",
      "rate": "100.00000000",
      "Fee": "0.01000000",
      "feesper": "0.10000000",
      "type": "sell",
      "status": "active",
      "pair": "BCH_BTC",
      "filledAmount": 0,
      "fees": 0
  }
}               
    

This endpoint used to make a orders.

HTTP Request

POST : /createOrder/

JSON Response Payload

Field Name Type Description Units
orderType String limit Major
type String buy or sell Major
pair String Trade pair like BTC_XRP Major
price Float Trade prices Major
amount Float Amount Major

Cancel Order

Cancel Order

              

https://www.cryptoa.com/api/closeOrder

{
  "status": "success",
  "orderNumber": "251",
  "cancelled_amount": 0.1,
  "result": "Order cancelled successfully"
}               
          

This endpoint used to cancle the particular orders.

HTTP Request

POST : /closeOrder/

JSON Response Payload

Field Name Type Description Units
orderId Integer Trade id get from order cancel response Major

Public API

Ticker Price

Ticker Price

              

https://www.cryptoa.com/api/returnTicker

{
  "BCH_BTC": {
    "last_market_price": "0.08040186",
    "first_currency": "BCH",
    "second_currency": "BTC",
    "lowestaskprice": "0.05744647",
    "highestbidprice": "100.00000000",
    "volume": "3600.0000000000000000"
  },
  "ETH_BTC": {
    "last_market_price": "0.08040186",
    "first_currency": "ETH",
    "second_currency": "BTC",
    "lowestaskprice": "0.00000000",
    "highestbidprice": "0.00000000",
    "volume": "0.0000000000000000"
  },
  "LTC_BTC": {
    "last_market_price": "0.08040186",
    "first_currency": "LTC",
    "second_currency": "BTC",
    "lowestaskprice": "0.00000000",
    "highestbidprice": "0.00000000",
    "volume": "0.0000000000000000"
  }
}
          

This endpoint returns a list of existing exchange order books and their respective order placement limits.

HTTP Request

GET : /returnTicker/

JSON Response Payload

Field Name Type Description Units
NULL NULL NULL NULL

24Hours Volume

24Hours Volume

              

https://www.cryptoa.com/api/return24HrVolume

{
  "BTC_BCH": {
      "BTC": "230.00000000",
      "BCH": "266.00000000"
  },
  "BTC_ETH": {
      "BTC": "0.00000000",
      "ETH": "0.00000000"
  },
  "BTC_LTC": {
      "BTC": "0.00000000",
      "LTC": "0.00000000"
  },
  "BTC_XRP": {
      "BTC": "0.00000000",
      "XRP": "0.00000000"
  },
  "BTC_XLM": {
      "BTC": "0.00000000",
      "XLM": "0.00000000"
  }
}
          

This endpoint returns a list of existing exchange 24hours volume.

HTTP Request

GET : /return24HrVolume/

JSON Response Payload

Field Name Type Description Units
NULL NULL NULL NULL

Currencys

Currencys

              

https://www.cryptoa.com/api/returnCurrencies

{
  "BTC": {
      "name": "Bitcoin",
      "symbol": "BTC",
      "withdrawalFee": "1.00000000",
      "disabled": 0
  },
  "BCH": {
      "name": "Bitcoin Cash",
      "symbol": "BCH",
      "withdrawalFee": "1.00000000",
      "disabled": 0
  },
  "ETH": {
      "name": "Ethereum",
      "symbol": "ETH",
      "withdrawalFee": "1.00000000",
      "disabled": 0
  }
}
          

This endpoint returns a list of existing exchange currency.

HTTP Request

GET : /returnCurrencies/

JSON Response Payload

Field Name Type Description Units
currency String Trade Currency (BTC) Optional

Order Book

Order Book

              

https://www.cryptoa.com/api/returnOrderbook

{
  "BTC_XRP": {
      "bids": [
          [ 1, 500 ],
          [ 1, 1 ],
          [ 1, 10 ],
          [ 1, 1 ],
          [ 100, 0.1 ]
      ],
      "asks": [
          [ 0.5, 400 ],
          [ 1, 600 ],
          [ 1, 703 ],
      ]
  }
}
          

This endpoint returns a list of existing exchange order book with amount and price.

HTTP Request

GET : /returnOrderbook/

JSON Response Payload

Field Name Type Description Units
currencyPair String Trade pair (BTC_XRP) Major

Chart Data

Chart Data

              

https://www.cryptoa.com/api/returnChartData

[
    {
        "date": 1542976140,
        "high": "10.00000000",
        "low": "10.00000000",
        "open": "10.00000000",
        "close": "10.00000000",
        "volume": "20.00000000",
        "quoteVolume": "2.00000000"
    },
    {
        "date": 1542976200,
        "high": "0.00000385",
        "low": "0.00000385",
        "open": "0.00000385",
        "close": "0.00000385",
        "volume": "0.00000770",
        "quoteVolume": "2.00000000"
    },
    {
        "date": 1543219860,
        "high": "0.00000385",
        "low": "0.00000385",
        "open": "0.00000385",
        "close": "0.00000385",
        "volume": "0.00007700",
        "quoteVolume": "20.00000000"
    },
    {
        "date": 1543227000,
        "high": "0.05000000",
        "low": "0.05000000",
        "open": "0.05000000",
        "close": "0.05000000",
        "volume": "0.50000000",
        "quoteVolume": "10.00000000"
    }
]
          

This endpoint returns a list of existing exchange Chart Data.

HTTP Request

GET : /returnChartData/

JSON Response Payload

Field Name Type Description Units
currencyPair String Trade pair (BTC_XRP) Major
start Time stamp From time (1542902400) Major
end Time stamp To time (1542902400) Major