Bit2C API Documantation
General
API access to our platform with JSON responses.
Examples
Public Methods
Ticker
Request URL
GET https://bit2c.co.il/Exchanges/[BtcNis/EthNis/LtcNis/UsdcNis]/Ticker.json
Parameters: none
JSON Response:
Parameter | Description |
---|---|
ll | last price |
av | last 24 hours price avarage |
a | last 24 hours volume |
h | highest buy order |
l | lowest sell order |
c | last 24 hours average change - decimal(nullable) |
up | last change - true = up , false - down , null - no change |
Order Book
Request URL
GET https://bit2c.co.il/Exchanges/[BtcNis/EthNis/LtcNis/UsdcNis]/orderbook.json
Parameters: none
JSON Response:
Contains full "bids" and "asks" lists (chached 1 sec.), each list contains open orders, each order represented as a list of price and amount.
{ "asks":[[price,amount],...], "bids":[[price,amount],...] }
Order Book - Top
Request URL
GET https://bit2c.co.il/Exchanges/[BtcNis/EthNis/LtcNis/UsdcNis]/orderbook-top.json
Parameters: none
JSON Response:
Contains top (as in site UI) "bids" and "asks" lists (real-time), each list contains open orders, each order represented as a list of price and amount.
{ "asks":[[price,amount],...], "bids":[[price,amount],...] }
Last 24h Trades (executions)
Request URL
GET https://bit2c.co.il/Exchanges/[BtcNis/EthNis/LtcNis/UsdcNis]/lasttrades
Parameters: none
JSON Response:
The lastest 24h closed trades with no cache:
Parameter | Type | Description |
---|---|---|
date | number | unix timestamp date and time |
isBid | boolean | a boolean value ture = taker buy false = taker sell |
price | number | price |
amount | number | amount |
tid | number | transaction id |
All Trades (executions)
Request URL
GET https://bit2c.co.il/Exchanges/[BtcNis/EthNis/LtcNis/UsdcNis]/trades.json
Parameters:
Parameter | Type | Description |
---|---|---|
limit | number | max = 100,000 |
since | number | return transactions for the last 'transaction id'. default: 0 |
date | number (unixtimestemp) | return transactions from date . default: firstday of trade |
JSON Response:
Cached every 5 min
Parameter | Type | Description |
---|---|---|
date | number | unix timestamp date and time |
isBid | boolean | a boolean value ture = taker buy false = taker sell |
amount | number | amount |
tid | number | transaction id |
{ "asks":[[price,amount,unixtimestamp],...], "bids":[[price,amount,unixtimestamp],...] }
Private Methods
Authenticated methods require an API key
Generate KeyAuthorization is performed by sending the following variables into the request header:
Parameter | Type | Description |
---|---|---|
Key | string | a public API ke, for example: 692036b-23b9-48c7-aedf-17db72e23a5b |
Sign | string | All POST/GET data (param1=val1¶m2=val2&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 |
nonce | UInt64 | All requests must also include a special nonce parameter with incrementing integer. The integer must always be greater than the previous requests nonce value. (example :DateTime.UtcNow.Ticks) |
If method is POST then Content-Type must be application/x-www-form-urlencoded.
Balance (Read Method)
Request URL
GET https://bit2c.co.il/Account/Balance
Parameters: none
JSON Response Object:
Parameter | Type | Description |
---|---|---|
coinCode | number | coinCode |
"AVAILABLE_"+coinCode | number | available (not locked for trade) |
FeeMaker | number | fee if order is maker |
FeeTaker | number | fee if order is taker |
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)
Request URL
GET https://bit2c.co.il/Order/MyOrders
Parameters:
Parameter | Type | Description |
---|---|---|
pair | string | BtcNis, EthNis, BchNis, LtcNis, EtcNis, BtgNis |
JSON Response object:
{ pair : { ask , bid } , pair is : { pair } }
Get Order by ID (Read Method)
Request URL
GET https://bit2c.co.il/Order/GetById
Parameters:
Parameter | Type | Description |
---|---|---|
id | number | the order id from AddOrder response |
JSON Response object:
Parameter | Type | Description |
---|---|---|
pair | string | - |
status_type | string | 0 = New 1 = Open 5 = Completed |
created | number | unix time stamp |
order_type | number | 0 = LMT 1 = MKT 2 = STL |
type | number | 0 = Buy 1 = Sell |
amount | number | The order remaining amount |
initialAmount | number | The first requested amount |
price | number | - |
id | number | - |
Example:
{ "pair":"BtcNis", "status_type":5, "created":1530189837, "type":0, "order_type":0, "amount":0.00000000, "price":12.00000000, "stop":0, "id":10782173, "initialAmount":2.00000000 }
Account History (Read Method)
Request URL
GET https://bit2c.co.il/Order/AccountHistory
Parameters:
Parameter | Type | Description |
---|---|---|
fromTime | date format | "dd/MM/yyyy HH:mm:ss.fff" |
toTime | date format | "dd/MM/yyyy HH:mm:ss.fff" |
JSON Response object array:
Parameter | Type | Description |
---|---|---|
firstCoin / secondCoin / feeCoin | string | BtcNis, EthNis, BchNis, LtcNis, EtcNis, BtgNis |
status | string | 0 = New 1 = Open 2 = NoFunds 3 = WaitForInsert 4 = Deleted 5 = Completed |
firstAmount / secondAmount | number | the amount moved in this record |
feeAmount | number | the amount of fee |
fee | number | percentage fee dedacted |
created | string | js date created account history row |
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 26 = DepositFee 27 = RefundDepositFee |
[ { "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 } ,... ]
Order History (Read Method)
Request URL
GET https://bit2c.co.il/Order/OrderHistory
Parameters:
Parameter | Type | Description |
---|---|---|
fromTime | date format | "dd/MM/yyyy HH:mm:ss.fff" |
toTime | date format | "dd/MM/yyyy HH:mm:ss.fff" |
take | number | "take the last X rows from history" |
pair | string | [BtcNis/EthNis/LtcNis/UsdcNis] , null for all pairs |
Returns json object with pairs [BtcNis/EthNis/LtcNis/UsdcNis] as keys for arrays of trades:
Parameter | Type | Description |
---|---|---|
firstCoin / secondCoin / feeCoin | string | [NIS/BTC/ETH/LTC/USDC] |
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 26= DepositFee 27= RefundDepositFee 28= Fee 29= RefundFee 30= Debit 31= Credit |
[ { "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 } ,... ]
Order History By Order Id (Read Method)
Request URL
GET https://bit2c.co.il/Order/HistoryByOrderId
Parameters:
Parameter | Type | Description |
---|---|---|
id | number | the order id from AddOrder response |
Parameter | Type | Description |
---|---|---|
firstCoin / secondCoin / feeCoin | string | [NIS/BTC/ETH/LTC/USDC] |
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 26= DepositFee 27= RefundDepositFee 28= Fee 29= RefundFee 30= Debit 31= Credit |
[{"ticks":1574767951,"created":"26/11/19 13:32","action":1,"price":"1000","pair":"EthNis","reference":"EthNis|10867390|10867377","fee":"0.5","feeAmount":"0.08","feeCoin":"₪","firstAmount":"-0.015","firstAmountBalance":"9","secondAmount":"14.93","secondAmountBalance":"130,233.28","firstCoin":"ETH","secondCoin":"₪"},{"ticks":1574767951,"created":"26/11/19 13:32","action":0,"price":"1000","pair":"EthNis","reference":"EthNis|10867390|10867377","fee":"0.5","feeAmount":"0.08","feeCoin":"₪","firstAmount":"0.015","firstAmountBalance":"9.015","secondAmount":"-15.08","secondAmountBalance":"130,218.35","firstCoin":"ETH","secondCoin":"₪"}]
Add Order (Write method)
Request URL
POST https://bit2c.co.il/Order/AddOrder
Parameters:
Parameter | Type | Description |
---|---|---|
Amount | decimal | amount |
Price | decimal | price |
IsBid | (bool)[true/false] | true-buy false-sell |
Pair | string | [BtcNis/EthNis/LtcNis/UsdcNis] |
Returns json object:
Parameter | Type | Description |
---|---|---|
OrderResponse | JObject | {HasError:bool,Error:string} |
NewOrder | JObject | {created:unixtimestamp,type:string 1-sell/0-buy,amount:number,price:number,id:number(save this to cancel order)} |
{ "OrderResponse": { "HasError":false, "Error":"OrderAdded" }, "NewOrder": { "created":1504431577, "type":1, "amount":0.01, "price":17220, "id":9291016 } }
Cancel order (Write method)
Request URL
POST https://bit2c.co.il/Order/CancelOrder
Parameters:
Parameter | Type | Description |
---|---|---|
id | number | order id |
Returns json object:
Parameter | Value | Description |
---|---|---|
HasError | bool | if error - true |
Error | string | error message |
Add Buy Order market price (Write method)
Request URL
POST https://bit2c.co.il/Order/AddOrderMarketPriceBuy
Parameters:
Parameter | Type | Description |
---|---|---|
Total | decimal | total value to but with |
Pair | string | [BtcNis/EthNis/LtcNis/UsdcNis] |
Returns json object: same as "AddOrder"
Add Sell Order market price (Write method)
Request URL
POST https://bit2c.co.il/Order/AddOrderMarketPriceSell
Parameters:
Parameter | Type | Description |
---|---|---|
Amount | decimal | amount to sell |
Pair | string | [BtcNis/EthNis/LtcNis/UsdcNis] |
Returns json object: same as "AddOrder"
Add stop limit Order (Write method)
Request URL
POST https://bit2c.co.il/Order/AddStopOrder
Parameters:
Parameter | Type | Description |
---|---|---|
Amount | decimal | amount |
Price | decimal | price |
Stop | decimal | the price "stop" to make the order change to LMT taker order |
IsBid | boolean | true-buy,false-sell |
Pair | string | [BtcNis/EthNis/LtcNis/UsdcNis] |
Returns json object:
Parameter | Type | Description |
---|---|---|
OrderResponse | JObject | {HasError:bool,Error:string} |
NewOrder | JObject | {created:unixtimestamp,type:string 1-sell/0-buy,amount:number,price:number,id:number(save this to cancel order),order_type:number=2,stop:number} |
{ "OrderResponse": { "HasError":false, "Error":"OrderAdded", "Message":"order added" }, "NewOrder": { "created":1504431577, "type":1, "amount":0.01, "price":17220, "id":9291016, "order_type":2, "stop":1000 } }
Withdrawal Crypto (Write method)
Request URL
POST https://bit2c.co.il/Funds/WithdrawCoin
Parameters:
Parameter | Type | Description |
---|---|---|
Total | decimal | Total |
Address | string | your crypto wallet Address (must be valid address to current coin) |
Coin | string | [BTC/ETH/LTC/USDC] |
subtractFeeAmount | boolean | true-will substract fee from total |
fee | decimal | only if "subtractFeeAmount" is true |
gasLimit | decimal | only if "subtractFeeAmount" is true and ETH/ETC |
gasPrice | decimal | only if "subtractFeeAmount" is true and ETH/ETC |
Returns json object:
Parameter | Type | Description |
---|---|---|
txid | string | blockchain tx id |
error | string | has error or not |
message | string | error message |
Withdrawal NIS (Write method)
Request URL
POST https://bit2c.co.il/Funds/AddFund
Parameters:
Parameter | Type | Description |
---|---|---|
Total | decimal | Total (must be > 0) |
Reference | string | must be space or some char (" ") value. |
IsDeposit | bool | false - must be false |
Returns json object:
Parameter | Type | Description |
---|---|---|
coin | string | "NIS" |
isDeposit | bool | false |
message | string | message |
error | string | error description - null if success |
Merchants
Create checkout button id (Write method)
Request URL
POST https://bit2c.co.il/Merchant/CreateCheckout
Parameters:
Parameter | Type | Description |
---|---|---|
Price | number | the amont you wish to get(in the currency you select in "CoinType") |
Description | string | the description to show on checkout page |
CoinType | string | [Btc/Nis] |
ReturnURL | string | url user will be redirected after payment |
CancelURL | string | url user will be redirected after cancel |
NotifyByEmail | bool | get notification on checkout payment |
Returns json object:
Parameter | Type | Description |
---|---|---|
id | Guid-string | use this to create a link for payment https://bit2c.co.il/payment/Details/[id] |
error | string | if error.then message |
Send payment to checkout button (Write method)
Request URL
POST https://bit2c.co.il/Payment/Pay
Parameters:
Parameter | Type | Description |
---|---|---|
CheckoutLinkId | Guid-string | created with Merchant/CreateCheckout |
Returns message
Type | Description |
---|---|
bool | true if transferred , false if not. |
Add Coin Request (Write method)
Request URL
POST https://bit2c.co.il/Funds/AddCoinFundsRequest
Parameters:
Parameter | Type | Description |
---|---|---|
Coin | string | [BTC/ETH/LTC/USDC] |
refreash | bool | if true and last address has been used, creates new address |
Returns
Parameter | Type | Description |
---|---|---|
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 |
{"address":"mtvFjADTjBKiKJNEFKrAFw5z4xPQPs7wZW","hasTx":false}