API access to our platform with JSON responses.

Examples:


Public Methods

Ticker
GET https://bit2c.co.il/Exchanges/[BtcNis/LtcNis/BchNis/BtgNis]/Ticker.json 

Params:none.

Returns JSON dictionary:

  • ll - last price
  • av - last 24 hours price avarage
  • a - last 24 hours volume
  • h - highest buy order
  • l - lowest sell order

Order book
GET https://bit2c.co.il/Exchanges/[BtcNis/LtcNis/BchNis/BtgNis]/orderbook.json 

Params:none.

Returns JSON dictionary with "bids" and "asks". Each is a list of open orders and each order is represented as a list of price and amount.

  • {"asks":[[price,amount,unixtimestamp],...],"bids":[[price,amount,unixtimestamp],...]}

Transactions (closed trades)
GET https://bit2c.co.il/Exchanges/[BtcNis/LtcNis/BchNis/BtgNis]/trades.json 

Params:

  • since - return transactions for the last 'tid'. Default: -6 months.
    Example: https://bit2c.co.il/Exchanges/[BtcNis/LtcNis/BchNis/BtgNis]/trades.json?since=200 will return transactions from the tid 200.

Returns descending JSON list of transactions. Every transaction (dictionary) contains:

  • date - unix timestamp date and time
  • price
  • amount
  • tid - transaction id


Authenticated Private Methods


Authenticated methods require the use of an api key (in your API settings ) and can only be accessed via the POST method.
Authorization is performed by sending the following variables into the request header:
  1. Key — Public API key. An example API key: 692036b-23b9-48c7-aedf-17db72e23a5b
  2. Sign — ALL POST data (param=val&param1=val1&nonce=(number)) signed by a secret key according to HMAC-SHA512 method. Your secret key (upper case) and public keys can be generated from your account settings page.
  3. An additional security element must be passed into the post:
    nonce - All requests must also include a special nonce POST parameter with incrementing integer. The integer must always be greater than the previous requests nonce value. (example :DateTime.UtcNow.Ticks)
  4. Content-Type can't be left out but must be application/x-www-form-urlencoded.

Balance - Read method
POST https://bit2c.co.il/Account/Balance 

Params:none.

Returns json object:
{ coinCode : number , "AVAILABLE_"+coinCode : number , .... , Fees : {FeeMaker:number,FeeTaker:number}}

Example

            
                {
                    "AVAILABLE_NIS": 68299.5000000000000000,
                    "NIS": 100000.00000000,
                    "AVAILABLE_BTC": 24.2409524700000000,
                    "BTC": 24.33095247,
                    "Fees": {
                        "BtcNis": {
                            "FeeMaker": 0.50,
                            "FeeTaker": 0.50
                        },
                        "LtcNis": {
                            "FeeMaker": 0.50,
                            "FeeTaker": 0.50
                        },
                        ...
                    }
                }
            
            

Get my orders - Read method
POST https://bit2c.co.il/Order/MyOrders 

Params:

  • pair - [BtcNis/LtcNis/BchNis/BtgNis]

Returns json is an object { pair : { ask , bid } , pair is : [BtcNis/LtcNis/BchNis/BtgNis]

  • bid & ask are array of object: { created , type , amount , price , id }
    number created = Unix Timestamp
    number type = 1:sell , 0:buy
    number amount
    number price
    number id

Example:

            
                {
                    "BtcNis":
                    {   
                        "ask":null,
                        "bid":  [
                            {   
                                "created":1504420066,
                                "type":0, //0-buy,1-sell
                                "amount":1.00000000,
                                "price":15700.50000000,
                                "id":9290987
                            }
                        ]
                    }
                }
            
            

Get order by id - Read method
POST https://bit2c.co.il/Order/GetById 

Params:

  • id - number

Returns json object

  •                     {"pair":string,
                        "status":string,
                        "created":(number , unixtimestamp),
                        "type":number,
                        "amount":number,
                        "price":number,
                        "id":number}
                        

Example:

            
                {
                    "BtcNis":
                    {   
                        "ask":null,
                        "bid":  [
                            {   
                                "created":1504420066,
                                "type":0, //0-buy,1-sell
                                "amount":1.00000000,
                                "price":15700.50000000,
                                "id":9290987
                            }
                        ]
                    }
                }
            
            

Account History - Read method
POST https://bit2c.co.il/Order/AccountHistory 

Params:

  • fromTime - date format "dd/MM/yyyy HH:mm:ss.fff"
  • toTime - date format "dd/MM/yyyy HH:mm:ss.fff"

Returns json object array:

  • firstCoin / secondCoin / feeCoin - [NIS/BTC/LTC/BCH/BTG]
    firstAmount / secondAmount - number, the amount moved in this record
    feeAmount - number , the amount of fee
    fee - number , percentage
    created - string , js date
    OrderCreated - number , order id if record generated from order
    price - number - only when buy/sell
    Ref - string - reference
    accountAction - number
    0= Buy
    1= Sell
    2= Deposit
    3= Withdrawal
    4= FeeWithdrawal
    10= Unknown
    11= SendPayment
    12= ReceivedPayment
    21= DepositVIACredit
    23= RefundWithdrawal
    24= RefundFeeWithdrawal

Example:

                [
                    {
                        "firstCoin":"BTC", 
                        "secondCoin":"",
                        "firstAmount":28.20718517,
                        "secondAmount":null,
                        "feeAmount":null,
                        "created":"\/Date(1501864248927)\/",
                        "fee":null,
                        "feeCoin":"",
                        "id":1003933,
                        "OrderCreated":null,
                        "price":null,
                        "Ref":"RX30300",
                        "accountAction":2
                    }
                   ,... 
            ]
            

Account History - Read method
POST https://bit2c.co.il/Order/OrdersHistory 
returns executed orders by time and pair

Params:

  • fromTime - string, date format "dd/MM/yyyy HH:mm:ss.fff"
  • toTime - string, date format "dd/MM/yyyy HH:mm:ss.fff"
  • pair - string, [BtcNis/LtcNis/BchNis/BtgNis]

Returns json object with pairs [BtcNis/LtcNis/BchNis/BtgNis] as keys for arrays of trades:

  • firstCoin / secondCoin / feeCoin - [NIS/BTC/LTC/BCH/BTG]
    firstAmount / secondAmount - number, the amount moved in this record
    firstAmountBalance / secondAmountBalance - number, the updated balance
    feeAmount - number , the amount of fee
    fee - number , percentage
    created - string , date format "dd/MM/yyyy hh:mm"
    ticks - number , unixtimestamp
    price - number - only when buy/sell
    reference - string - reference
    action - number
    0= Buy
    1= Sell
    2= Deposit
    3= Withdrawal
    4= FeeWithdrawal
    10= Unknown
    11= SendPayment
    12= ReceivedPayment
    21= DepositVIACredit
    23= RefundWithdrawal
    24= RefundFeeWithdrawal

Example:

            {
                "BtcNis":[
                    {
                        "ticks":1504098670,
                        "created":"30/08/17 13:11",
                        "action":0,
                        "price":"16279",
                        "pair":"BtcNis",
                        "reference":"BtcNis9290975",
                        "fee":"0.25",
                        "feeAmount":"2.5",
                        "feeCoin":"₪",
                        "firstAmount":"0.06127526",
                        "firstAmountBalance":"31.32095247",
                        "secondAmount":"-1,000",
                        "secondAmountBalance":"93,174.84",
                        "firstCoin":"BTC",
                        "secondCoin":"₪"
                    }, ...
                ] ,
                LtcNis : [...]
            }
            

Add Order - Write method
POST https://bit2c.co.il/Order/AddOrder 

Params:

  • Amount - decimal
  • Price - decimal
  • IsBid - (bool)[true/false]
  • Pair - [BtcNis/LtcNis/BchNis/BtgNis]

Returns json object:

  • OrderResponse - {HasError:bool,Error:string}
  • NewOrder - {created:unixtimestamp,type:string 1-sell/0-buy,amount:number,price:number,id:number(save this to cancel order)}

Example:

                {
                    "OrderResponse":
                    {
                        "HasError":false,
                        "Error":"OrderAdded"
                    },
                    "NewOrder":
                    {
                        "created":1504431577,
                        "type":1,
                        "amount":0.01,
                        "price":17220,
                        "id":9291016
                    }
                }
            

Cancel order - Write method
POST https://bit2c.co.il/Order/CancelOrder 

Params:

  • id - order id

Returns json object:

  • HasError:bool
  • Error:string,error message

Add Buy Order market price - Write method
POST https://bit2c.co.il/Order/AddOrderMarketPriceBuy 

Params:

  • Total - decimal
  • Pair - [BtcNis/LtcNis/BchNis/BtgNis]

Returns json object:same as "AddOrder"

Add Sell Order market price - Write method
POST https://bit2c.co.il/Order/AddOrderMarketPriceSell 

Params:

  • Amount - decimal
  • Pair - [BtcNis/LtcNis/BchNis/BtgNis]

Returns json object:same as "AddOrder"


Merchants -All Write method


Create checkout button id
POST https://bit2c.co.il/Merchant/CreateCheckout 

Params:


  • Price:number - the amont you wish to get(in the currency you select in "CoinType")
    Description:string
    CoinType:string [Btc/Nis] .
    ReturnURL:string - url user will be redirected after payment
    CancelURL:string - url user will be redirected after cancel
    NotifyByEmail:bool
    Autosale:number (% auto sell bitcoin for NIS)

Returns json object:


  • string error
    Guid id - use this to create a link for payment https://bit2c.co.il/payment/Details/[id]

Send payment to checkout button
POST https://bit2c.co.il/Payment/Pay 

Params:

  • Guid CheckoutLinkId - created with Merchant/CreateCheckout

Returns message

  • bool pass : true if transferred , false if not.
    string reff

Add Coin Request
POST https://bit2c.co.il/Order/AddCoinFundsRequest 

Params:


  • Coin:string [NIS/BTC/LTC/BCH/BTG]
    refreash:bool - if true and last address has been used, creates new address

Returns


  • address:string - valid all time, can deposit amount without recreate it, amount is flex
    hasTx:bool - did address got tx before,if true it is important to generate new address for privacy

Example:

                    {"address":"mtvFjADTjBKiKJNEFKrAFw5z4xPQPs7wZW","hasTx":false}
            

Add Fund Request - for fiat money
POST https://bit2c.co.il/Order/AddFund 

Params:


  • Total:number
    Reference:string - if"IsDeposit"is true => add "Reference" of bank transfer
    IsDeposit:bool

Returns message


  • message:string - AddFundsSuccess/AddFundsError

Example:

                {"message":"בקשתך התקבלה בהצלחה במערכת, באפשרותך לצפות בסטאטוס שלה בהיסטוריה.","isDeposit":true,"coin":"NIS"}