API Documentation

Overview


We provide a simple and powerful API that allows you to programmatically trade on our exchange. You can have multiple API keys each with its own access right. You can manage your APIs on the Manage API page. For added security, we have provided email verification for generating new APIs and for redisplay your API secret key. All public requests are GET requests and all responses come in a default JSON response object.


Getting Started

You can create new APIs on the manage API section. APIs come with three levels of permission: read info, trade and withdraw.

You can restrict the functionality of APIs. Before creating new APIs, you must choose what permissions you would like the key to have. The permissions are:

  • Read Info- You can only view your market trade history, account balances, cryptocurrency transaction history etc

  • Trade- You can place a buy/sell order in a specific trading market.Make sure you have the proper permissions set on your API keys for this call to work.

  • Withdraw- You can programmatically withdraw your cryptocurrency to any address you provide.


In order to make authenticated API calls, you have to provide an API signature to validate your identity. We use a standard HMAC-SHA512 signing. Calculate the HMAC hash using your API secret and URL and include it under an API sign header


$apikey="YOUR API KEY HERE";

$apisecret="YOUR API SECRET KEY HERE";

$market='btc-usd';

$service_url = 'https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getmytradehistory';

$sign=hash_hmac('sha512',$service_url ,$apisecret);

$curl = curl_init($service_url);

$curl_post_data = array(

"apikey" => $apikey,

"market" => $market,

 );

curl_setopt($curl, CURLOPT_POST, success);

curl_setopt($curl, CURLOPT_HTTPHEADER, array('apisign:'.$sign));

curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);

$curl_response = curl_exec($curl);

$obj = json_decode($curl_response);

API Reference


There are two categories of API service that we provide Public APIs that are used without user authentication and Authenticated API that is only accessible via authenticated API calls.

Public API's can directly be accessed by invoking  the URL directly but authenticated API's can only be accessed by providing the API key and secret which you can generate from new API section.



Public API


  • api/getasksofmarket


This particular API request is used to provide all the ask orders of a particular market.

Parameters : market

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getasksofmarket?market=btc-usd

Response

{ "respose": "success", "message": "", "result": [{ "Market": "BTC-USD", "BaseCurrency": "BTC", "TradeCurrency": "USD", "Type": "Limit", "Price": "6390.75", "Size": "3.39097910", "Total": "21670.90", "Sum": "21670.90" }] }


  • api/getbidsofmarket


This particular API request is used to provide all the  bid orders of a particular market.

Parameters : market

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getbidsofmarket?market=btc-usd

Response

{ "respose": "success", "message": "", "result": [{ "Market": "BTC-USD", "BaseCurrency": "BTC", "TradeCurrency": "USD", "Type": "Limit", "Price": "6386.32", "Size": "0.71435770", "Total": "4562.12", "Sum": "4562.12" }] }


  • api/getallmarkets


This particular API request is used to provide all active trading markets in the Inout Blockchain FiatExchanger.

Parameters : None

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getallmarkets

Response

{ "respose": "success", "message": "", "result": [{ "Market": "BTC-USD", "BaseCurrency": "Bitcoin", "TradeCurrency": "United States Dollar", "MinTradeSize": "0.00009", "CreatedOn": "01/01/1970 05:30:00" }, { "Market": "BTC-EUR", "BaseCurrency": "Bitcoin", "TradeCurrency": "Euro", "MinTradeSize": "0.00009", "CreatedOn": "10/17/2018 11:03:19" }] }


  • api/getmarketsummary


This particular API request is used to provide market summary of a particular trading market in the last 24 hours.

Parameters : market

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getmarketsummary?market=btc-usd

Response

{ "respose": "success", "message": "", "result": [{ "MarketName": "BTC-USD", "High": "6434.17", "Low": "6386.32", "Volume": "430.114", "Last": "6386.32", "Bid": "6386.32", "Ask": "6390.75", "ChangePecentage": "-0.74", "OpenBuyOrders": "3653", "OpenSellOrders": "3671", "CreatedOn": "01/01/1970 05:30:00" }] }


  • api/getmarkettradehistory


This particular API request is used to provide old trade history of a particular market.

Parameters : market

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getmarkettradehistory?market=btc-usd

Response

{ "respose": "success", "message": "", "result": [{ "Id": "89643", "ClosedDate": "11/10/2018 15:20:02", "Type": "Sell", "Amount": "6386.32", "TotalUnits": "0.14100260", "TotalCost": "900.49" }] }


  • api/getticker


This particular API request is used to get current tick values for a particular market.

Parameters : market

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getticker?market=btc-usd

Response

{ "respose": "success", "message": "", "result": [{ "MarketName": "BTC-USD", "BaseCurrency": "Bitcoin", "TradeCurrency": "United States Dollar", "Bid": "6386.32", "Ask": "6390.75", "Last": "6386.32" }] }

  • api/getallmarketsummaries


This particular API request is used to provide market summaries of all active market.

Parameters :None

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getallmarketsummaries

Response

{ "respose": "success", "message": "", "result": [{ "MarketName": "BTC-USD", "High": "6434.07", "Low": "6386.32", "Volume": "429.114", "Last": "6386.32", "Bid": "6386.32", "Ask": "6390.75", "ChangePecentage": "-0.74", "OpenBuyOrders": "3653", "OpenSellOrders": "3671", "CreatedOn": "01/01/1970 05:30:00" }] }


  • api/getcurrencies


This particular API request is used to provide all active currencies of the system.

Parameters :None

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getcurrencies

Response

{ "respose": "success", "message": "", "result": [{ "Currency": "Bitcoin", "Symbol": "BTC", "IsActive": "true", "CoinType": "Cryptocurrency" }, { "Currency": "Bitcoin Cash", "Symbol": "BCH", "IsActive": "true", "CoinType": "Cryptocurrency" }] }


Authenticated APIs


  • api/getbalance


This particular API request is used to return authenticated users available balance for a specific currency.

Parameters :currency

Required Permission: Read info

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getbalance

Response

{ "respose": "success", "message": "", "result": [{ "Currency": "BTC", "AvailableBalance": "991.99900000", "PendingWithdrawals": "1.00000000", "OnOrders": "7.00100000", "DepositAddress": "3AuEJzdKCnGmowtLDFiSoxhhmpnmkYC4vE" }] }


  • api/getallbalances


This particular API request is used to provide the available user balance of the authenticated users in all currencies.

Parameters :None

Required Permission: Read info

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getallbalances

Response

{

"response": "success",

"message": "",

"result": [{

"Currency": "BTC",

"AvailableBalance": "992.77974100",

"PendingWithdrawals": "3.00000000",

"OnOrders": "14.10008600",

"DepositAddress": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx"

}, {

"Currency": "BCH",

"AvailableBalance": "993.00010000",

"PendingWithdrawals": "0.00000000",

"OnOrders": "5.99990000",

"DepositAddress": "172nurPYSq97T6LzsBSfc3G9g4xiEDdgXz"

}]

}


  • api/getmytradehistory


This particular API request is used to provide trade history of  authenticated user.

Parameters :market

Required Permission: Read info

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getmytradehistory

Response

{ "respose": "success", "message": "", "result": [{ "Id": "114038", "OpenedDate": "11/09/2018 17:27:41", "ClosedDate": "11/09/2018 17:27:41", "Type": "Limit-Sell", "Amount": "5500.00", "UnitsFilled": "0.14436840", "UnitsTotal": "1.00000000", "ActualCost": "6430.03", "TotalCost": "6430.03" }] }


  • api/getmyopenorders


This particular API request is used to provide open orders of  authenticated user in a particular market.

Parameters :market

Required Permission: Read info

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getmyopenorders

Response

{ "response": "success", "message": "", "result": [{ "Id": "60", "Market": "BTC-USD", "Type": "Limit-Buy", "Amount": "6387.86", "UnitsFilled": "0.00000000", "UnitsTotal": "4.20453240", "EstimatedTotal": "26857.96", "OrderDate": "10/16/2018 18:08:21" }] }


  • api/getdepositaddress


This particular API request is used to returns deposit address of a requested cryptocurrency.

Parameters :currency

Required Permission: Read info

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getdepositaddress

Response

{ "response": "success", "message": "", "result": [{ "Currency": "BTC", "Address": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx" }] }


  • api/selllimit


This particular API request is used to programatically add limit sell order in  a particular market specified as parameter.

Parameters : market,units,price

Required Permission: Trade

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/selllimit


Response

{ "response": "success", "message": "YOUR SELL ORDER PLACED", "result": [{ "Id": "5677" }] }


  • api/buylimit


This particular API request is used to programatically add limit buy order in a particular market  specified as parameter.


Parameters : market,units,price

Required Permission: Trade

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/buylimit


Response

{ "response": "success", "message": "YOUR BUY ORDER PLACED", "result": [{ "Id": "5679" }] }


  • api/buyconditional


This particular API request is used to programatically add limit buy order in  a particular market specified as parameter.


Parameters : market,units,price, condition(1:Greater than or equal to, 2:Less than or equal to), conditionalprice

Required Permission: Trade

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/buyconditional



Response

{ "response": "success", "message": "YOUR BUY ORDER PLACED", "result": [{ "Id": "6162" }] }


  • api/sellconditional


This particular API request is used to programatically add limit buy orderin  a particular market specified as parameter.


Parameters : market,units,price, condition(1:Greater than or equal to, 2:Less than or equal to), conditionalprice

Required Permission: Trade

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/sellconditional



Response

{ "response": "success", "message": "YOUR SELL ORDER PLACED", "result": [{ "Id": "6792" }] }


  • api/cancelorder


This particular API request is used to cancel specific bid/ask.

Parameters :id

Required Permission: Trade

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/cancelorder

Response

{ "response": "success", "message": "CANCELLED", "result": null }

  • api/getdeposithistory


This particular API request is used to provide  deposit history of a particular currency of the authenticated user .

Parameters :currency

Required Permission: Read info

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getdeposithistory

Response

Response

{ "response": "success", "message": "", "result": [{ "Currency": "Bitcoin", "TransactionId": "fa09af05-e435-5dc5-b43f-9362e537e7e0", "AmountDeposited": "10.00000000 BTC", "RequestedDate": "08/25/2018 17:40:25", "ProcessedDate": "08/25/2018 17:40:25", "WalleteAddress": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx", "TotalBalance": "1009.87982700 BTC", "TransactionStatus": "Completed" }] }


  • api/getwithdrawalhistory


This particular API request is used to return authenticated users withdrawal history.

Parameters :currency

Required Permission: Read info

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/getwithdrawalhistory

Response

{ "response": "success", "message": "", "result": [{ "CryptoCurrency": "Bitcoin", "TransactionId": "fa09af05-e435-5dc5-b43f-9362e537e7e0", "AmountWithdrawn": "1.00000000 BTC", "WithdrawalTransactionFee": "0.00070000 BTC", "NetAmount": "0.99930000 BTC", "WithdrawalAddress": "3E5C8su1BYZsrwz6LsAW5udvSbcZvRqovD", "RequestedDate": "10/17/2018 09:23:01", "ProcessedDate": "10/17/2018 09:23:01", "BlockchainHash": "5f511f9f6ee23a6c94e8d28e0776a9dec50f984ff6d7c83953f465aed6de26ad", "WalleteAddress": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx", "TotalBalance": "1009.87982700 BTC", "TransactionStatus": "Completed" }] }


  • api/withdraw


This particular API request is used to withdraw specified units of specified  cryptocurrency to a specified address in the API request.

Parameters :currency,quantity,address,paymentid(for coins like XRP,XLM)

Required Permission: withdraw

Request : https://inout-blockchain-fiatexchanger-addons-demo.inoutscripts.net/index.php/api/withdraw

Response

{ "response": "success", "message": "YOUR WITHDRAWAL REQUEST HAS BEEN COMPLETED", "result": [{ "Id": "233132", }] }


Success

Success

Error