ברוקר נגישות
כניסה הרשמה נגישות
לראש העמוד
  1. General
  2. Examples
  3. Public Methods
    1. Ticker
    2. Order Book
    3. Order Book - Top
    4. 24h last trades
    5. All trades
  4. Private Methods
    1. Generate API Key
    2. Read Method
    3. Balance
    4. Get My Orders
    5. Get Order by ID
    6. Account History
    7. Order History
    8. Order History by order id
    9. Write Method
    10. Add Order
    11. Cancel order
    12. Add Buy Order market price
    13. Add Sell Order market price
    14. Add stop limit Order
    15. Withdrawal Crypto
    16. Withdrawal NIS
  5. Merchants
    1. Write Method
    2. Create checkout button id
    3. Send payment to checkout button
    4. Add Coin Request
  6. Broker
    1. Public Method
    2. Is Active
    3. Resources
    4. Get Coins With Data
    5. Get Stage 2 Values
    6. Validate Checkout
    7. Private Methods
    8. Set Count Data
    9. Validate Count Data
    10. Checkout
    11. Confirmed

Bit2C API Documantation

General

API access to our platform with JSON responses.


Examples

LanguageLink
JS/PHP/PythonCode by CCXT
C#Code by Hadar Macdasi
Java Version A - Code by Ilan Arengauz
Version B - Code by Eli Sagy
Version C - Code by Amit Abutbul
PHPCode by Amit Abutbul
PythonCode by Amit Abutbul
Node.jsCode by Ofer Eliassaf

Public Methods

Ticker

Request URL

GET  https://bit2c.co.il/Exchanges/[BtcNis/EthNis/LtcNis/UsdcNis]/Ticker.json 

Parameters: none

JSON Response:

ParameterDescription
lllast price
avlast 24 hours price avarage
alast 24 hours volume
hhighest buy order
llowest sell order
c last 24 hours average change - decimal(nullable)
uplast 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:

ParameterTypeDescription
datenumberunix timestamp date and time
isBidbooleana boolean value
ture = taker buy
false = taker sell
pricenumberprice
amountnumberamount
tidnumbertransaction id

All Trades (executions)

Request URL

GET https://bit2c.co.il/Exchanges/[BtcNis/EthNis/LtcNis/UsdcNis]/trades.json 

Parameters:

ParameterTypeDescription
limitnumbermax = 100,000
sincenumberreturn transactions for the last 'transaction id'.
default: 0
datenumber (unixtimestemp) return transactions from date .
default: firstday of trade

JSON Response:
Cached every 5 min

ParameterTypeDescription
datenumberunix timestamp date and time
isBidbooleana boolean value
ture = taker buy
false = taker sell
amountnumberamount
tidnumbertransaction id

{

"asks":[[price,amount,unixtimestamp],...],

"bids":[[price,amount,unixtimestamp],...]

}


Private Methods

Authenticated methods require an API key

Generate Key

Authorization is performed by sending the following variables into the request header:

ParameterTypeDescription
Keystringa public API ke, for example:
692036b-23b9-48c7-aedf-17db72e23a5b
SignstringAll POST/GET data (param1=val1&param2=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
nonceUInt64All 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:

ParameterTypeDescription
coinCodenumbercoinCode
"AVAILABLE_"+coinCodenumberavailable (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:

ParameterTypeDescription
pairstringBtcNis, 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:

ParameterTypeDescription
idnumberthe order id from AddOrder response

JSON Response object:

ParameterTypeDescription
pairstring-
status_typestring0 = New
1 = Open
5 = Completed
creatednumberunix time stamp
order_typenumber0 = LMT
1 = MKT
2 = STL
typenumber0 = Buy
1 = Sell
amountnumberThe order remaining amount
initialAmountnumberThe first requested amount
pricenumber-
idnumber-

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:

ParameterTypeDescription
fromTimedate format"dd/MM/yyyy HH:mm:ss.fff"
toTimedate format"dd/MM/yyyy HH:mm:ss.fff"

JSON Response object array:

ParameterTypeDescription
firstCoin / secondCoin / feeCoinstring
BtcNis, EthNis, BchNis, LtcNis, EtcNis, BtgNis
statusstring0 = New
1 = Open
2 = NoFunds
3 = WaitForInsert
4 = Deleted
5 = Completed
firstAmount / secondAmountnumberthe amount moved in this record
feeAmountnumberthe amount of fee
feenumberpercentage fee dedacted
createdstringjs date created account history row
OrderCreatednumberorder ID if record generated from order
pricenumberonly when buy/sell
Refstringreference
accountActionnumber0 = 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)

returns executed orders by time and pair

Request URL

GET https://bit2c.co.il/Order/OrderHistory

Parameters:

ParameterTypeDescription
fromTimedate format"dd/MM/yyyy HH:mm:ss.fff"
toTimedate format"dd/MM/yyyy HH:mm:ss.fff"
takenumber"take the last X rows from history"
pairstring[BtcNis/EthNis/LtcNis/UsdcNis] , null for all pairs

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

ParameterTypeDescription
firstCoin / secondCoin / feeCoinstring[NIS/BTC/ETH/LTC/USDC]
firstAmount / secondAmountnumberthe amount moved in this record
firstAmountBalance / secondAmountBalancenumberthe updated balance
feeAmountnumberthe amount of fee
feenumberpercentage
createdstringdate format "dd/MM/yyyy hh:mm"
ticksnumberunixtimestamp
pricenumberonly when buy/sell
referencestringreference
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
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

}

,...

]

Order History By Order Id (Read Method)

returns account history by executed order id

Request URL

GET https://bit2c.co.il/Order/HistoryByOrderId

Parameters:

ParameterTypeDescription
idnumberthe order id from AddOrder response
ParameterTypeDescription
firstCoin / secondCoin / feeCoinstring[NIS/BTC/ETH/LTC/USDC]
firstAmount / secondAmountnumberthe amount moved in this record
firstAmountBalance / secondAmountBalancenumberthe updated balance
feeAmountnumberthe amount of fee
feenumberpercentage
createdstringdate format "dd/MM/yyyy hh:mm"
ticksnumberunixtimestamp
pricenumberonly when buy/sell
referencestringreference
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
Example:

[

{

"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:

ParameterTypeDescription
Amountdecimalamount
Pricedecimalprice
IsBid(bool)[true/false]true-buy false-sell
Pairstring [BtcNis/EthNis/LtcNis/UsdcNis]

Returns json object:

ParameterTypeDescription
OrderResponseJObject{HasError:bool,Error:string}
NewOrderJObject{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)

Request URL

POST https://bit2c.co.il/Order/CancelOrder

Parameters:

ParameterTypeDescription
idnumberorder id

Returns json object:

ParameterValueDescription
HasErrorboolif error - true
Errorstringerror message

Add Buy Order market price (Write method)

Request URL

POST  https://bit2c.co.il/Order/AddOrderMarketPriceBuy

Parameters:

ParameterTypeDescription
Totaldecimaltotal value to but with
Pairstring[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:

ParameterTypeDescription
Amountdecimalamount to sell
Pairstring [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:

ParameterTypeDescription
Amountdecimalamount
Pricedecimalprice
Stopdecimalthe price "stop" to make the order change to LMT taker order
IsBidbooleantrue-buy,false-sell
Pairstring[BtcNis/EthNis/LtcNis/UsdcNis]

Returns json object:

ParameterTypeDescription
OrderResponseJObject{HasError:bool,Error:string}
NewOrderJObject{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}
Example:

{

"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:

ParameterTypeDescription
TotaldecimalTotal
Addressstringyour crypto wallet Address (must be valid address to current coin)
Coinstring [BTC/ETH/LTC/USDC]
subtractFeeAmountbooleantrue-will substract fee from total
fee decimalonly if "subtractFeeAmount" is true
gasLimitdecimalonly if "subtractFeeAmount" is true and ETH/ETC
gasPricedecimalonly if "subtractFeeAmount" is true and ETH/ETC

Returns json object:

ParameterTypeDescription
txidstringblockchain tx id
errorstringhas error or not
messagestringerror message

Withdrawal NIS (Write method)

Request URL

POST https://bit2c.co.il/Funds/AddFund

Parameters:

ParameterTypeDescription
TotaldecimalTotal (must be > 0)
Referencestringmust be space or some char (" ") value.
IsDepositbool false - must be false

Returns json object:

ParameterTypeDescription
coinstring"NIS"
isDepositboolfalse
messagestringmessage
errorstringerror description - null if success

Merchants

Create checkout button id (Write method)

Request URL

POST https://bit2c.co.il/Merchant/CreateCheckout

Parameters:

ParameterTypeDescription
Pricenumberthe amont you wish to get(in the currency you select in "CoinType")
Descriptionstringthe description to show on checkout page
CoinTypestring[Btc/Nis]
ReturnURLstringurl user will be redirected after payment
CancelURLstringurl user will be redirected after cancel
NotifyByEmailboolget notification on checkout payment

Returns json object:

ParameterTypeDescription
idGuid-stringuse this to create a link for payment https://bit2c.co.il/payment/Details/[id]
errorstringif error.then message

Send payment to checkout button (Write method)

Request URL

POST  https://bit2c.co.il/Payment/Pay

Parameters:

ParameterTypeDescription
CheckoutLinkIdGuid-stringcreated with Merchant/CreateCheckout

Returns message

TypeDescription
booltrue if transferred , false if not.

Add Coin Request (Write method)

Request URL

POST  https://bit2c.co.il/Funds/AddCoinFundsRequest

Parameters:

ParameterTypeDescription
Coinstring [BTC/ETH/LTC/USDC]
refreashbool if true and last address has been used, creates new address

Returns

ParameterTypeDescription
addressstringvalid all time, can deposit amount without recreate it, amount is flex
hasTxbooldid address got tx before,if true it is important to generate new address for privacy

Example:

{

"address":"mtvFjADTjBKiKJNEFKrAFw5z4xPQPs7wZW",

"hasTx":false

}


Broker

IsActive (Read Method)

Request URL

POST https://bit2c.co.il/Broker/IsActive

Parameters: none

JSON Response Object:

ParameterTypeDescription
isActivebooleana boolean value
ture = is Active
false = not is Active
actionIdnumber0=MANUAL
1=CANCEL
2=REFRESH
overrideExpirynumbercancel or refresh Exipry
balanceActivationJObjectBuyActive - 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:

ParameterTypeDescription
resourceDataJObjectDictionary 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:

ParameterTypeDescription
isBuybooleana boolean value
ture = is Buy
false = is Sell

JSON Response Object:

ParameterTypeDescription
coinsDataJObjectDictionary of Coins
adminUserDataJObjectDictionary admin User Data
userDataJObjectNeedsZoomWithdrawal - 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:

ParameterTypeDescription
isBuybooleana boolean value
ture = is Buy
false = is Sell
coinCodenumberBTC,ETH,LTC,USDC

JSON Response Object:

ParameterTypeDescription
digitsAfterPointCountnumberDigits After Point
feePercentagedecimalBuy or Sell Fee (%)
usersFeesdecimalUsers Fees
feesJObjectList 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:

ParameterTypeDescription
coinCodenumberBTC,ETH,LTC,USDC
isBuybooleana boolean value
ture = is Buy
false = is Sell
amountTotaldecimalPurchase or sale amount

JSON Response Object:

ParameterTypeDescription
validbooleana boolean value
ture = Succee
false = Fail
invalidbooleana boolean value
ture = Fail
false = Succee
linkToJObjectBalance - a boolean value
ContactUs - a boolean value
invalidHtmlJObjectBalanceMsg - a string value
BalanceBtn - a string value
ContactUs - a string value
coinErrorstringCoin error text
nisErrorstringNis 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:

ParameterTypeDescription
actionnumberCancel = 1
Refresh = 2
Timeout = 3

JSON Response Object:

ParameterTypeDescription
validbooleana boolean value
ture = Succee
false = Fail
invalidbooleana boolean value
ture = Fail
false = Succee

Example:

{

"valid":true,

"invalid":false,

}

Checkout (Read Method)

Request URL

GET https://bit2c.co.il/Broker/Checkout

Parameters:

ParameterTypeDescription
coinCodenumberBTC,ETH,LTC,USDC
isBuybooleana boolean value
ture = is Buy
false = is Sell
amountTotaldecimalPurchase or sale amount

JSON Response Object:

ParameterTypeDescription
ratedecimalrate
feedecimalfee
coinAmountdecimalcoin Amount
nisTotaldecimalnis Total
expirynumberExpiry Seconds
checkoutIdnumberrow id
cancelExiprynumberCancel Inactive Expiry Seconds
refreshExiprynumberRefresh Inactive Expiry Seconds
invalidbooleana 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:

ParameterTypeDescription
actionnumberCancel = 1
Refresh = 2
Timeout = 3
checkoutIdnumbercheckout Id

JSON Response Object:

ParameterTypeDescription
validbooleana boolean value
ture = Succee
false = Fail
invalidbooleana boolean value
ture = Fail
false = Succee

Example:

{

"valid":true,

"invalid":false,

}

Confirmed (Write Method)

Request URL

GET https://bit2c.co.il/Broker/Confirmed

Parameters:

ParameterTypeDescription
checkoutIdnumbercheckout Id

JSON Response Object:

ParameterTypeDescription
ratedecimalrate
feedecimalfee
coinAmountdecimalcoin Amount
nisTotaldecimalnis Total
invalidbooleana boolean value
ture = Fail
false = Succee

Example:

{

"rate" : 138361.28,

"fee" : 2.5,

"coinAmount" : 0.00034330,

"nisTotal" : 50,

"invalid":false,

}