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) |
Example:
"AVAILABLE_NIS": 68299.5000000000000000,
"NIS": 100000.00000000,
"AVAILABLE_BTC": 24.2409524700000000,
"BTC": 24.33095247,
}
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",
"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
}
Broker
IsActive (Read Method)
Request URL
POST https://bit2c.co.il/Broker/IsActive
Parameters: none
JSON Response Object:
Parameter | Type | Description |
---|---|---|
isActive | boolean | a boolean value ture = is Active false = not is Active |
actionId | number | 0=MANUAL 1=CANCEL 2=REFRESH |
overrideExpiry | number | cancel or refresh Exipry |
balanceActivation | JObject | BuyActive - a boolean value SellActive - a boolean value |
Example:
{
"isActive": true,
"actionId": 0,
"overrideExpiry": 0,
"balanceActivation":
{
"BuyActive":true,
"SellActive": false
}
}
Resources (Read Method)
Request URL
GET https://bit2c.co.il/Broker/Resources
Parameters: none
JSON Response Object:
Parameter | Type | Description |
---|---|---|
resourceData | JObject | Dictionary of Data |
Example:
{
"resourceData":
{
{
"Key":"brokerbuycrypto",
"Value": "קניית קריפטו"
},
{
"Key":"backtobroker",
"Value": "חזרה לברוקר"
},
{
"Key":"brokernext",
"Value": "הבא"
},
....
}
}
Get Coins With Data (Read Method)
Request URL
GET https://bit2c.co.il/Broker/GetCoinsWithData
Parameters: none
JSON Response Object:
Parameter | Type | Description |
---|---|---|
coinsData | JObject | Dictionary of Coins |
adminUserData | JObject | Dictionary admin User Data |
userData | JObject | NeedsZoomWithdrawal - a boolean value IsLoggedIn - a boolean value BrokerFeeZero - a boolean value |
Example:
{
"coinsData":
{
{
"Key":"BTC",
"BrokerCoinConfigDisplay":
{
RateProviderUrl ="API URL ...",
RateExpirySeconds =120,
CoinCode="BTC",
CoinId=1,
DealExpirySeconds =120,
DigitsAfterPointCount =2,
MinimumNisBuy =50.00,
MaximumNisBuy =1000000.00,
MinimumNisSell =50.00,
MaximumNisSell =1000000.00,
BuyFee =5.000000,
SellFee =5.000000,
rate =138234.6000,
order =1,
localName ="ביטקוין",
DisplayBuy =true,
DisplaySell =true,
DisplayMobileHeader =true,
valid =true,
latestRate ="28/11/2023 13:03:33",
isLatest =true,
}
},
....
},
"adminUserData":
{
....
},
"userData":
{
....
}
}
Get Stage 2 Values (Read Method)
Request URL
GET https://bit2c.co.il/Broker/GetStage2Values
Parameters:
Parameter | Type | Description |
---|---|---|
isBuy | boolean | a boolean value ture = is Buy false = is Sell |
coinCode | number | BTC,ETH,LTC,USDC |
JSON Response Object:
Parameter | Type | Description |
---|---|---|
digitsAfterPointCount | number | Digits After Point |
feePercentage | decimal | Buy or Sell Fee (%) |
usersFees | decimal | Users Fees |
fees | JObject | List fees |
Example:
{
"digitsAfterPointCount":2,
"feePercentage":5.00,
"usersFees":null,
"fees":
{
{
"Key":"0.00",
"Value": 5.00
},
{
"Key":"20000.00",
"Value": 4.80
},
....
}
}
Validate Checkout (Read Method)
Request URL
GET https://bit2c.co.il/Broker/ValidateCheckout
Parameters:
Parameter | Type | Description |
---|---|---|
coinCode | number | BTC,ETH,LTC,USDC |
isBuy | boolean | a boolean value ture = is Buy false = is Sell |
amountTotal | decimal | Purchase or sale amount |
JSON Response Object:
Parameter | Type | Description |
---|---|---|
valid | boolean | a boolean value ture = Succee false = Fail |
invalid | boolean | a boolean value ture = Fail false = Succee |
linkTo | JObject | Balance - a boolean value ContactUs - a boolean value |
invalidHtml | JObject | BalanceMsg - a string value BalanceBtn - a string value ContactUs - a string value |
coinError | string | Coin error text |
nisError | string | Nis error text |
Example:
{
"valid":true,
"invalid":false,
"linkTo":
{
"Balance":false,
"ContactUs":false
},"invalidHtml":
{
"BalanceMsg":null,
"BalanceBtn":null,
"ContactUs":null
},
"coinError":"",
"nisError":"",
}
Validate Count Data (Read Method)
Request URL
POST https://bit2c.co.il/Broker/ValidateCountData
Parameters:
Parameter | Type | Description |
---|---|---|
action | number | Cancel = 1 Refresh = 2 Timeout = 3 |
JSON Response Object:
Parameter | Type | Description |
---|---|---|
valid | boolean | a boolean value ture = Succee false = Fail |
invalid | boolean | a boolean value ture = Fail false = Succee |
Example:
{
"valid":true,
"invalid":false,
}
Checkout (Read Method)
Request URL
GET https://bit2c.co.il/Broker/Checkout
Parameters:
Parameter | Type | Description |
---|---|---|
coinCode | number | BTC,ETH,LTC,USDC |
isBuy | boolean | a boolean value ture = is Buy false = is Sell |
amountTotal | decimal | Purchase or sale amount |
JSON Response Object:
Parameter | Type | Description |
---|---|---|
rate | decimal | rate |
fee | decimal | fee |
coinAmount | decimal | coin Amount |
nisTotal | decimal | nis Total |
expiry | number | Expiry Seconds |
checkoutId | number | row id |
cancelExipry | number | Cancel Inactive Expiry Seconds |
refreshExipry | number | Refresh Inactive Expiry Seconds |
invalid | boolean | a boolean value ture = Fail false = Succee |
Example:
{
"rate" : 138361.28,
"fee" : 2.5,
"coinAmount" : 0.00034330,
"nisTotal" : 50,
"expiry" :120,
"checkoutId" :6,
"cancelExipry" : 600,
"refreshExipry" : 600,
"invalid":false,
}
Set Count Data (Write Method)
Request URL
POST https://bit2c.co.il/Broker/SetCountData
Parameters:
Parameter | Type | Description |
---|---|---|
action | number | Cancel = 1 Refresh = 2 Timeout = 3 |
checkoutId | number | checkout Id |
JSON Response Object:
Parameter | Type | Description |
---|---|---|
valid | boolean | a boolean value ture = Succee false = Fail |
invalid | boolean | a boolean value ture = Fail false = Succee |
Example:
{
"valid":true,
"invalid":false,
}
Confirmed (Write Method)
Request URL
GET https://bit2c.co.il/Broker/Confirmed
Parameters:
Parameter | Type | Description |
---|---|---|
checkoutId | number | checkout Id |
JSON Response Object:
Parameter | Type | Description |
---|---|---|
rate | decimal | rate |
fee | decimal | fee |
coinAmount | decimal | coin Amount |
nisTotal | decimal | nis Total |
invalid | boolean | a boolean value ture = Fail false = Succee |
Example:
{
"rate" : 138361.28,
"fee" : 2.5,
"coinAmount" : 0.00034330,
"nisTotal" : 50,
"invalid":false,
}