API


What is an API?

BTCXIndia’s Application Programming Interface (API) allows our clients to access and control their accounts using custom software.

PUBLIC DATA FUNCTIONS

TICKER

Access at https://api.btcxindia.com/ticker/


• XRP _INR                      –  XRP to Indian Rupee

• high                               –  Today’s high price

• low                                 –  Today’s low price

• avg                                –  Today’s average price

• total_volume_24h          –  Total volume for the last 24 hours

• current_volume             –   Last traded volume

• last_traded_price          –   Last traded price

• bid                                 –  Highest buy order

• ask                                –   Lowest sell order

• last_traded_time           –   Last traded time in Indian standard time( IST)


HOURLY TICKER

Access at https://api.btcxindia.com/ticker_hour/

Returns a JSON dictionary code, the same as at https://api.btcxindia.com/ticker/, but calculated values are from within an hour.

ORDER BOOK

Access at https://api.btcxindia.com/order_book/

Returns JSON dictionary with "bids" and "asks".

Each is a list of open orders and each order is represented as a list of amounts, price and number of orders.

Example:

{ "timestamp":1441437690, //Indian Standard Time "bids": ["200", "22.54", 1 ],"asks": ["300", "25.32", 5]}


TRADES

Access at https://api.btcxindia.com/trades

Returns a JSON dictionary with "time stamp" ,"trade­ id", “volume” and “price”.

Example:

[{"time":"2017-05-16 13:09:38","trade_id":"a23ec8ae2fed6aeb1b10deaa9b2f5b605a9cb01c","volume":"200","price":"23.54"}]



PRIVATE FUNCTIONS


API AUTHENTICATION

All private API calls require authentication.

You need to provide 3 types of data to authenticate a request:

• API key

• Nonce

• Signature

API KEY

To get an API key, a customer must send a request to [email protected]. The support team will then issue an API key

NONCE

Nonce is a regular integer number. It must be increasing with every request you make. A common practice is to use unix time for that parameter.

Your nonce must be within 30 seconds of the API service time or your request will be considered expired and rejected.

SIGNATURE

Signature is a HMAC­SHA256 encoded message containing: Nonce, Client ID and API key. The HMAC­SHA256 code must be generated using a secret key; that will be forwarded with your API key.

Example ( NodeJS) :

var nonce = new Date().getTime();

var Data = nonce + APIkey + Client ID;

var hmac = crypto.createHmac('sha256', Secrete key);

var signature= hmac.update(Data).digest('base64');



ACCOUNT BALANCE

Access at https://api.btcxindia.com/ac_balance/

Paramaters:

• key                  - API key

• signature         - Signature

• nonce              - Nonce

Returns JSON dictionary:

Status                - Success/error*

inr                      - INR balance

xrp                     - XRP balance

pending_xrp      - Sell Volume(XRP)

pending_inr       - Buy Volume(INR)

trade_fee          - Trade fee in %

*error                 - error message



MY PENDING ORDERS

Access at https://api.btcxindia.com/my_pending_orders/

Paramaters:

• key                  - API key

• signature         - Signature

• nonce              - Nonce

Returns JSON dictionary:

time                      - Order Tme stamp

order_id               - Order ID

order_type           - Buy or Sell

volume                 - XRP Volume

inr_xrp                 - 1 XRP Price in INR



CANCEL ORDER

Access at https://api.btcxindia.com/cancel_order/

Paramaters :

• key                  -  API key

• signature         - Signature

• nonce              - Nonce

• order_id          - Order ID


Returns status message 'success' if order has been found and canceled.

After, you will also receive the message 'Your order has been cancelled'



TRADE

Access at https://api.btcxindia.com/trade/

Paramaters:

• key                  - API key

• signature         - Signature

• nonce              - Nonce

• type                 - buy (or) sell

• volume            - XRP Volume

• price                - 1 XRP Price in INR


Returns status message 'success' if sufficient funds in the wallet



TRANSACTIONS

Access at https://api.btcxindia.com/transactions/

Paramaters:

• key                  -  API key

• signature         - Signature

• nonce              - Nonce

• type                 - trade (or) deposit (or) withdrawal

Returns JSON dictionary:

(If type is trade)

time                   - Order match time stamp*

transaction_id   - Transaction ID

type                   - bought ( or) sold

xrp                     - Order volume in XRP

inr_xrp               - 1 XRP Price in INR

order_amount   - xrp*inr_xrp //example: if 1 xrp price is INR 23.17 and bought 200 xrp then it will return
                                                               INR 4634

commission       - Trade fee

net_amount       - if bought order_amount+commission ; if sold order_amounnt-commission

(If type is deposit, Returns)

time                   - Order match time stamp*

transaction_id   - Transaction ID

type                   - XRP ( or) INR

amount              - Amount in XRP (or) INR

(If type is withdrawal, Returns)

time                       - Order match time stamp*

transaction_id       - Transaction ID

type                       - XRP ( or) INR

amount                  - Amount in XRP (or) INR

withdrawl_address - receive address     // if withdrawal in XRP

tx_id                       - XRP Transaction ID     // if withdrawal in XRP



WITHDRAWAL INITIATE

Access at https://api.btcxindia.com/withdrawal_initiate/

Paramaters :

• key                  - API key

• signature         - Signature

• nonce              - Nonce

• type                 - XRP (or) INR

• amount            - Amount to withdraw

• address           - XRP Address if withdrawal is in XRP

Returns JSON dictionary:

Return status message 'verified' if balance is available

Also, returns message 'Withdrawal code has been forwarded to your mobile.'



WITHDRAWAL CONFIRM

Access at https://api.btcxindia.com/withdrawal_confirm/

Paramaters:

• key                        - API key

• signature              - Signature

• nonce                   - Nonce

• withdrawal_code   - Enter code sent to mobile

Returns JSON dictionary:

Return status ' success' if code is valid.



WALLET

Access at https://api.btcxindia.com/wallet/

Params:

• key                  - API key

• signature         - Signature

• nonce              - Nonce

• type                 - XRP (or) inr

Returns JSON dictionary:

wallet_ address  - If type is XRP, wallet address will be shown

bank_name        - Bank Name - If type is INR

bank_account    - Bank Account Number

bank_ifsc           - IFSC Code

branch               - Bank Branch

ac_type             - Account Type