API

Public functions

Order book

GET https://indacoin.com/api/orderbook?pair={pair}

Params:

  • pair - 'btc_usd' or 'ltc_usd'

Returns array of orders. Each order is an object with next fields:

  • price - order price
  • amount - base currency amount

Example: https://indacoin.com/api/orderbook?pair=btc_usd

Last trades

GET https://indacoin.com/api/trades/{pair}/{tid}

Params:

  • pair - 'btc_usd' or 'ltc_usd'
  • tid - trade id begging to return list from

Returns list of trades. Each trade is an object with next fields:

  • tid - trade id
  • price - trade price
  • amount - base currency amount
  • date - trade time

Example: https://indacoin.com/api/trades/btc_usd/23

Market price

GET https://indacoin.com/api/GetMarketPrice/{operation}/{pair}/{amount}

Params:

  • operation - 'buy' or 'sell'
  • pair - 'btc_usd' or 'ltc_usd'
  • amount - amount in dollars. Default: 50.

Returns market price.

Example: https://indacoin.com/api/GetMarketPrice/buy/btc_usd/15

Ticker

GET https://indacoin.com/api/ticker

No params.

Returns JSON-object. Object fields is like 'BTC_USD'. Each field contains next fields:

  • last_price - price of the last trade
  • max_price - maximum trade price in the last 24 hours
  • min_price - minimun trade price in the last 24 hours
  • open_price - price of the first trade in the last 24 hours
  • today_open_price - price of the first trade today
  • volume_base - trade volume in the last 24 hours, base currency
  • volume_quote - trade volume in the last 24 hours, quote currency

Authentication

You need to provide 3 headers to authenticate a request:

  • API-Key
  • API-Sign
  • API-Nonce

Make sure the Content-Type is application/json.

API-Key

You can get API-Key in account settings.

API-Sign

Text Signature: method + nonce + API­key, created with ECDSA algorithm using a hash function with sha­1, issued a private key on curve sec256k1.

API-Nonce

nonce is an arbitrary number increasing with every request.

Private functions

getbalance

POST https://indacoin.com/api/getbalance

No params.

Returns JSON dictionary of your balance.

openorders

POST https://indacoin.com/api/openorders

No params.

Returns descending JSON list of orders. Every order contains:

  • 1 - unique identificator
  • 2 - pair of currencies
  • 3 - order type: sell or buy
  • 4 - price
  • 5 - amount, received/spent in the second currency of pair
  • 6 - amount, spent/received in the first currency of pair
  • 7 - creation time
  • 8 - fee in the second currency of pair

gethistory

POST https://indacoin.com/api/gethistory

Params:

  • limit - number of history records to return. Default: 100
  • offset - skip that many records before beginning to return. Default: 0

Returns array of history records. Each record is presented as an array.

Zero element is record type: 'buy', 'sell', 'in' or 'out'.

In 'buy'/'sell' case the whole record array is:

  • 0 - 'buy' or 'sell'
  • 1 - pair of deal: 'btc_usd' or 'ltc_usd'
  • 2 - price
  • 3 - base amount
  • 4 - quote amount
  • 5 - commission
  • 6 - deal time

In 'in'/'out' case the whole record array is:

  • 0 - 'in' or 'out'
  • 1 - number of operation
  • 2 - currency: 'BTC', 'LTC' or 'USD'
  • 3 - amount
  • 4 - operation time

buyorder

POST https://indacoin.com/api/buyorder

Params:

  • pair - 'btc_usd' or 'ltc_usd'
  • price - order price
  • amount - amount crypto to buy

Example: {pair:'BTC_USD',price:'597.0100',amount:'0.02428171'}

Returns JSON-object:

  • i - order ID (to confirm a deal)
  • s - sum in the second currency spent for the execution of more profitable orders
  • a - sum in the first currency got performing more profitable orders
  • p - pair of the order
  • ot - order type

Example: {"i":173409,"s":0.00,"a":0.00000000,"p":"BTC_USD","ot":"BUY"}

sellorder

POST https://indacoin.com/api/sellorder

Params:

  • pair - 'btc_usd' or 'ltc_usd'
  • price - order price
  • amount - amount to sell

Example: {pair:'BTC_USD',price:'591.5584',amount:'0.03675761'}

Returns JSON-object:

  • i - order ID (to confirm a deal)
  • s - sum in the second currency spent for the execution of more profitable orders
  • a - sum in the first currency got performing more profitable orders
  • p - pair of the order
  • ot - order type

Example: {"i":173456,"s":0.00,"a":0.00000000,"p":"BTC_USD","ot":"SELL"}

cancelorder

POST https://indacoin.com/api/cancelorder

Params:

  • i - order ID

Request example: {i:'200389'}

Returns one of:

  • success - order has been found and canceled
  • failed - error case (expired or not existing deal)

Partnership functions

Simple integration

The most simple integration could be by using the following link, that should include params like btc wallet address, amount, currency (CARDEUR or CARDUSD), your partner name and discount id. Link for example: https://indacoin.com/change?addrOut=1FeGgKxU5gjC562wZXd67VTVfwcSjpqv3Y&amount_pay=100&cur_from=CARDEUR&cur_to=BTC&partner=your_partner_name&discount=1000

Tight integration

Please describe your business, the size of your company and your interest in a co-operation with Indacoin. Get in touch with [email protected] to receive further information.

Logic

The logic is the following

  • Check the limit of the user (it will create one if he doesn't exist yet)
  • Further create transaction
  • Forward him to indacoin URL, the user will pay and passes verification
  • Either will pass or not until the end, you should show him URL for finishing verification
  • On your URL arrives a callback in case of failure or success of transaction

To verify that you have a signature - you need to send in headers 'gw-partner', 'gw-nonce', 'gw-sign'. Header gw-sign is formed as HMAC sha256 from partnerName + "_" + nonce

Singature for URL forms just like API's instead of nonce - transaction's ID and also in Base64 encoding

Example of payment form is https://indacoin.com/gw/payment_form?transaction_id=1154&partner=indacoin&cnfhash=Ny8zcXVWbCs5MVpGRFFXem44NWh5SE9xTitlajkydFpDTXhDOVMrOFdOOD0=

Minimum amounts for now is USD 15

Get price

GET https://indacoin.com/api/GetExchangerAmount/{Currency}/{Amount}/{PartnerName}

- receive amount user will get

Parameters in GET:

  • Currency string (usd, euro),
  • Amount - numeric_string,
  • PartnerName - string,

User limits

POST https://indacoin.com/api/exgw_getUserlimits

- receive user's limit (and create if non-existent)

Parameters in json:

  • user_id - string,
  • cur_in string (usd, eur),

Transactions

POST https://indacoin.com/api/exgw_getTransactions

- receive info about last transactions

Parameters in json:

  • user_id - string,
  • tx_id - string,
  • status - tx_status,
  • created_at - int/timestamp,
  • hash - string (or null),
  • cur_in - string (usd, eur),
  • cur_out - string (btc),
  • amount_in - numeric_string,
  • amount_out - numeric_string,
  • target_address - string,
  • limit - int,
  • offset - int

all parameters are optional

Transaction info

POST https://indacoin.com/api/exgw_gettransactioninfo

- receive transaction's info

Parameters in json:

  • transaction_id - numeric

Create transaction

POST https://indacoin.com/api/exgw_createTransaction

- create new transaction

Parameters in json:

  • user_id -string,
  • cur_in -string(eur,usd),
  • cur_out - string (btc),
  • target_address - string,
  • amount_in -decimal