Instaswap

Development API DOCS

Version 1.4 (last update on: 15/09/2019)
* v1.2 Stable working methods
* v1.3 Stable working methods
* v1.4 Stable working methods
v1.2
Gather aprox. funds amount of selected ticker pair

GET /tickers/:giveCoin/:getCoin/:sendAmount

Params:
Version 1.2 (last update on: 19/06/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation

giveCoin: Deposit Ticker (example: BTC)
getCoin: Receive Ticker (example: ETH)
sendAmount: Amount of funds you want to exchange (example: 1.8714)
Successful response: (/tickers?giveCoin=BTC&getCoin=ETH&sendAmount=1.8714)
{
   "apiInfo":"OK",
   "response":{
      "min":0.0049977283053157656,
      "getAmount":"29.792761550654",
      "maxDigitsAfterDecimal":"4"
   }
}
* maxDigitsAfterDecimal is required when you send a transaction. Every ticker has different maximum digits after decimal
* min is minimum deposit amount on a transaction
v1.2
Send swap request (order)

GET /swap/:giveCoin/:getCoin/:sendAmount/:receiveWallet/:refundWallet/:memo

Params:
Version 1.2 (last update on: 19/06/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation

giveCoin: Deposit Ticker (example: BTC)
getCoin: Receive Ticker (example: ETH)
sendAmount: Amount of funds you want to exchange (example: 1.8714)
receiveWallet: Address to receive a currency
refundWallet: Refund address
memo (Optional): Extra memo/tag for currencies that require it
Successful response: (/swap?giveCoin=BTC&getCoin=ETH&sendAmount=1.8714&receiveWallet=15cU6gZRLWU3UusbWjpynW6zT3oa4H8q5ce&refundWallet=15cU6gZRLWU3UusbWjpynW6zT3oa4H8q5ce
{
   "apiInfo":"OK",
   "response":{
      "TransactionId":"NX54MHF1",
      "depositWallet":"15cU6gZRLWU3UusbWjpynW6zT3oa4H8q5ce",
   }
}
* All Wallet addresses in this page are not real. We use them only for example!
v1.3
Check Swap request (order) State

GET /swapState/:swapId

Params:
Version 1.3 (last update on: 09/09/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation

swapId: Transaction id from create swap request
Successful response: (/swapState.php?swapId=NX54MHF1)
{
   "apiInfo":"OK",
   "response":{
      "transactionId":"G3V8343Z",
      "depositCoin":"USDT",
      "receiveCoin":"BTC",
      "depositAmount":"1400.40",
      "refundWallet":"REFUND_WALLET",
      "receiveWallet":"RECEIVE_WALLET",
      "depositWallet":"0x3PPertyc9e853a974a7134ERty112af09XXX3871a",
      "memo_tag":"is not required",
      "transactionState":"Awaiting Deposit" OR "Swaping" OR "Withdraw" OR "Completed" OR "Deposit Not Completed",
      "timestamp":"2019-09-09 16:35:32"
   }
}
v1.3
Gather all open / completed / failed swaps (orders)

GET /report/:openOrders

GET /report/:completedOrders

GET /report/:notCompletedOrders

GET /report/:allStateOrders

Params:
Version 1.3 (last update on: 09/09/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation
Successful response: (/report?openOrders) OR (/report?completedOrders) OR(/report?notCompletedOrders)
{
   "apiInfo":"OK",
   "response":[
       {
           "transactionId":"NX54MHF1",
           "depositCoin":"BTC",
           "receiveCoin":"ETH",
           "depositAmount":"1",
           "recievingAmount":"56.12",
           "refundWallet":"15cU6gZRLWU3UusbWjpynW6zT3oa4H8q5ce",
           "receiveWallet":"15cU6gZRLWU3UusbWjpynW6zT3oa4H8q5ce",
           "depositWallet":"15cU6gZRLWU3UusbWjpynW6zT3oa4H8q5ce",
           "memo_tag":"is not required",
           "transactionState":"Awaiting Deposit"OR "Swaping" OR "Withdraw" OR "Completed" OR "Deposit Not Completed"
           "timestamp":"2019-06-22 17:21:53"
        },
        {...}
    ]
}
* All Wallet addresses in this page are not real. We use them only for example!
v1.2
Gather all available ticker pairs

GET /report/:allowedPairs

Params:
Version 1.2 (last update on: 19/06/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation
Successful response: (/report?allowedPairs)
{
   "apiInfo":"OK",
   "response":[
      {
         "depositCoin":"BTC",
         "receiveCoin":"ETH"
      },
      {
         "depositCoin":"BTC",
         "receiveCoin":"GRS"
      },
      {
         "depositCoin":"BTC",
         "receiveCoin":"USDT"
      },
      {
         "depositCoin":"BTC",
         "receiveCoin":"RPM"
      },
      {
         "depositCoin":"BTC",
         "receiveCoin":"AWR"
      },
      {...}
   ]
}
v1.2
Gather remaining requests , max limit for requests per hour and api mode

GET /report/:requests

Params:
Version 1.2 (last update on: 19/06/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation
Successful response: (/report?requests)
{
   "apiInfo":"OK",
   "response":{
      "remainingRequests":"328",
      "MaxRequestsLimitPerHour":"500",
      "apiMode":"test",
   }
}
* MaxRequestsLimit is defined in cooperation with instaswap dev team
v1.3
Gather wallet transactions history

GET /report/:walletSwapHistory/:wallet

Params:
Version 1.3 (last update on: 09/09/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation

wallet: The wallet that you want to search history for
(example: ...&wallet=3XXXXXXnwW8a4GKfLXXXX5123JCY6Xas346polsg7v)
Successful response: (/report?walletSwapHistory&wallet=WALLET_TO_SEARCH_HISTORY)
{
   "apiInfo":"OK",
   "response":[
       {
         "transactionId":"G3V8343Z",
         "depositCoin":"USDT",
         "receiveCoin":"BTC",
         "depositAmount":"1400.40",
         "recievingAmount":"0.1987",
         "refundWallet":"REFUND_WALLET",
         "receiveWallet":"WALLET_TO_SEARCH_HISTORY",
         "depositWallet":"0x3PPertyc9e853a974a7134ERty112af09XXX3871a",
         "memo_tag":"is not required",
         "transactionState":"Completed",
         "timestamp":"2019-09-09 16:35:32"
        },
        {...}
    ]
}
* Wallet transaction history shows all swaps even if deposit was failed or is still on waiting state.
* All Wallet addresses in this page are not real. We use them only for example!
v1.4
Gather transactions history of multiple wallets

GET /report/:multipleWalletSwapHistory/:wallets

Params:
Version 1.4 (last update on: 15/09/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation

wallets: Wallets separated with comma (,) that you want to search history for
(example: ...&wallet=3XXnwWX5123JCY6Xas346polsg7v,3XXXwsyd42G7HJgfh,FGHvcvre345dfDgfh45FV)
Successful response: (/report?multipleWalletSwapHistory&wallets=1ST_WALLET,2ND_WALLET)
{
   "apiInfo":"OK",
   "response":[
       {
         "transactionId":"G3V8343Z",
         "depositCoin":"ZEL",
         "receiveCoin":"USDT",
         "depositAmount":"1000",
         "receivingAmount":"804",
         "refundWallet":"REFUND_WALLET",
         "receiveWallet":"1ST_WALLET",
         "depositWallet":"0x3PPertyc9e853a974a7134ERty112af09XXX3871a",
         "memo_tag":"is not required",
         "transactionState":"Deposit Not Completed",
         "timestamp":"2019-09-15 16:35:32"
        },
       {
         "transactionId":"G53KEWO9",
         "depositCoin":"BTC",
         "receiveCoin":"ZEL",
         "depositAmount":"0.1",
         "receivingAmount":"40234",
         "refundWallet":"REFUND_WALLET",
         "receiveWallet":"1ST_WALLET",
         "depositWallet":"0x3PPertyc9e853a974a7134ERty112af09XXX3871a",
         "memo_tag":"is not required",
         "transactionState":"Waiting Deposit",
         "timestamp":"2019-09-15 16:40:00"
        },
       {
         "transactionId":"G9SABN54",
         "depositCoin":"USDT",
         "receiveCoin":"BTC",
         "depositAmount":"10000.40",
         "receivingAmount":"1",
         "refundWallet":"REFUND_WALLET",
         "receiveWallet":"2ND_WALLET",
         "depositWallet":"0x3PPertyc9e853a974a7134ERty112af09XXX3871a",
         "memo_tag":"is not required",
         "transactionState":"Completed",
         "timestamp":"2019-09-15 16:52:47"
        },
        {...}
    ]
}
* Wallet transaction history shows all swaps even if deposit was failed or is still on waiting state.
* All Wallet addresses in this page are not real. We use them only for example!
v1.4
Gather api version

GET /report/:apiVersion

Params:
Version 1.4 (last update on: 15/09/2019)
API KEY: Your api key.
API NONCE: Check Implementation
API MESSAGE: Check Implementation
Successful response: (/report?apiVersion)
{
   "apiInfo":"OK",
   "response":{
      "version":"1.4"
   }
}

PHP - IMPLEMENTATION

Version 1.2 (last update on: 19/06/2019)
/**
* 1st Example
* Gather aprox. funds amount of selected ticker pair
*/

$baseUrl = 'https://api.instaswap.io';
$path = '/tickers?giveCoin=BTC&getCoin=ETH&sendAmount=1';
$nonce = round(val:microtime(get_as_float:true) * 1000);
$key = ' ... '; <-- Your Api Key
$message = $path . $nonce;
$ch = curl_init(url:$baseUrl . $path);
curl_setopt($ch, option:CURLOPT_CUSTOMREQUEST, value:'GET');
curl_setopt($ch, option:CURLOPT_HTTPHEADER, [
'X-INSTASWAP-API-KEY:' . $key,
'X-INSTASWAP-API-NONCE:' . $nonce,
'X-INSTASWAP-API-MESSAGE:' . $message
]);
curl_setopt($ch, option:CURLOPT_RETURNTRANSFER, value:true);
$server_output = curl_exec($ch);
curl_close ($ch);
print_r($server_output);
Version 1.2 (last update on: 19/06/2019)
/**
* 2nd Example
* Send swap request (order)
*/

$baseUrl = 'https://api.instaswap.io';
$path = '/swap?giveCoin=BTC&getCoin=ETH&sendAmount=1&receiveWallet=15cU6gZRLWU3UusbWzT3oa4H8q5ce&refundWallet=15cU6gZRLWU3UusbWjpynW6zT3oae';
$nonce = round(val:microtime(get_as_float:true) * 1000);
$key = ' ... '; <-- Your Api Key
$message = $path . $nonce;
$ch = curl_init(url:$baseUrl . $path);
curl_setopt($ch, option:CURLOPT_CUSTOMREQUEST, value:'GET');
curl_setopt($ch, option:CURLOPT_HTTPHEADER, [
'X-INSTASWAP-API-KEY:' . $key,
'X-INSTASWAP-API-NONCE:' . $nonce,
'X-INSTASWAP-API-MESSAGE:' . $message
]);
curl_setopt($ch, option:CURLOPT_RETURNTRANSFER, value:true);
$server_output = curl_exec($ch);
curl_close ($ch);
print_r($server_output);
Version 1.2 (last update on: 19/06/2019)
/**
* 3rd Example
* Check Swap request (order) State
*/

$baseUrl = 'https://api.instaswap.io';
$path = '/swapState?swapId=NX54MHF1';
$nonce = round(val:microtime(get_as_float:true) * 1000);
$key = ' ... '; <-- Your Api Key
$message = $path . $nonce;
$ch = curl_init(url:$baseUrl . $path);
curl_setopt($ch, option:CURLOPT_CUSTOMREQUEST, value:'GET');
curl_setopt($ch, option:CURLOPT_HTTPHEADER, [
'X-INSTASWAP-API-KEY:' . $key,
'X-INSTASWAP-API-NONCE:' . $nonce,
'X-INSTASWAP-API-MESSAGE:' . $message
]);
curl_setopt($ch, option:CURLOPT_RETURNTRANSFER, value:true);
$server_output = curl_exec($ch);
curl_close ($ch);
print_r($server_output);
Version 1.4 (last update on: 15/09/2019)
/**
* 4th Example
* 1st $path = Get Open Orders
* 2nd $path = Get Completed Orders
* 3rd $path = Get failed Orders
* 4th $path = Get All Orders (use it wisely)
* 5th $path = Get all allowed ticker pairs
* 6th $path = Get api requests options
* 7th $path = Get version of API
*/

$baseUrl = 'https://api.instaswap.io';
you will use one of thesepath = '/report?openOrders';
you will use one of these$path = '/report?completedOrders';
you will use one of these$path = '/report?notCompletedOrders';
you will use one of these$path = '/report?allStateOrders';
you will use one of these$path = '/report?allowedPairs';
you will use one of these$path = '/report?requests';
you will use one of these$path = '/report?apiVersion';
$nonce = round(val:microtime(get_as_float:true) * 1000);
$key = ' ... '; <-- Your Api Key
$message = $path . $nonce;
$ch = curl_init(url:$baseUrl . $path);
curl_setopt($ch, option:CURLOPT_CUSTOMREQUEST, value:'GET');
curl_setopt($ch, option:CURLOPT_HTTPHEADER, [
'X-INSTASWAP-API-KEY:' . $key,
'X-INSTASWAP-API-NONCE:' . $nonce,
'X-INSTASWAP-API-MESSAGE:' . $message
]);
curl_setopt($ch, option:CURLOPT_RETURNTRANSFER, value:true);
$server_output = curl_exec($ch);
curl_close ($ch);
print_r($server_output);
Version 1.3 (last update on: 09/09/2019)
/**
* 5th Example
* Gather wallet transactions history
*/

$baseUrl = 'https://api.instaswap.io';
$path = '/report?walletSwapHistory&wallet=WALLET_TO_VIEW_HISTORY_FOR';
$nonce = round(val:microtime(get_as_float:true) * 1000);
$key = ' ... '; <-- Your Api Key
$message = $path . $nonce;
$ch = curl_init(url:$baseUrl . $path);
curl_setopt($ch, option:CURLOPT_CUSTOMREQUEST, value:'GET');
curl_setopt($ch, option:CURLOPT_HTTPHEADER, [
'X-INSTASWAP-API-KEY:' . $key,
'X-INSTASWAP-API-NONCE:' . $nonce,
'X-INSTASWAP-API-MESSAGE:' . $message
]);
curl_setopt($ch, option:CURLOPT_RETURNTRANSFER, value:true);
$server_output = curl_exec($ch);
curl_close ($ch);
print_r($server_output);
Version 1.4 (last update on: 15/09/2019)
/**
* 6th Example
* Gather multiple wallets transaction history
*/

$baseUrl = 'https://api.instaswap.io';
$path = '/report?multipleWalletSwapHistory&wallets=1ST_WALLET,2ND_WALLET,3RD_WALLET';
$nonce = round(val:microtime(get_as_float:true) * 1000);
$key = ' ... '; <-- Your Api Key
$message = $path . $nonce;
$ch = curl_init(url:$baseUrl . $path);
curl_setopt($ch, option:CURLOPT_CUSTOMREQUEST, value:'GET');
curl_setopt($ch, option:CURLOPT_HTTPHEADER, [
'X-INSTASWAP-API-KEY:' . $key,
'X-INSTASWAP-API-NONCE:' . $nonce,
'X-INSTASWAP-API-MESSAGE:' . $message
]);
curl_setopt($ch, option:CURLOPT_RETURNTRANSFER, value:true);
$server_output = curl_exec($ch);
curl_close ($ch);
print_r($server_output);