-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch_plus_index.json
1 lines (1 loc) · 210 KB
/
search_plus_index.json
1
{"./":{"url":"./","title":"Bibox Exchange","keywords":"","body":"Bibox Bibox Exchange provides REST API and WebSocket API, which are convenient for investors to view the market and trade easily. https://www.bibox.com We strongly recommend use the V3 version of the API for development. The V3 API has a more user-friendly experience and is better than the V1 version in performance. Click to view V3API REST api https://api.bibox.com WebSocket api wss://push.bibox.com/ WebSocket api of Coin-based contract wss://push.bibox.me/cbc Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2021-01-20 "},"restful_intro.html":{"url":"restful_intro.html","title":"Restful API description","keywords":"","body":"Restful API description REST API Introduction Bibox provides a new set of API for users, to help them access Bibox trading system quickly, implementing programmed transaction. API allows the following functions: View the market information (K line, depth, real-time dealing ticker, 24h market) View the account asset information Order, cancel View order information REST API Url https://api.bibox.com REST API Signature Apikey is required before using REST API to trade and view assets. Limited speed strategy: For the same apikey, the api request is 30 times/5 seconds; for the same ip, when the number of cmd requests exceeds 15 for one api, the speed limit will be 1 time / 1 second. Apply for apikey log in https://www.bibox.com/ Accnount information -> API apikey and secret are generated according to the instruction, please keep it carefully Set apikey operating authorization log in https://www.bibox.com/ Accnount information -> API -> Edit set apikey authorization Legal request structure Based on the consideration of safety, all API request must be calculated by signature algorithm except market api. A legel request has the following components APIKEY the apikey you applied。 Request Method Body is the cmds in request structure, REST API supports a batch of request, which means cmds can contain multiple mthod bodies, each represents an independent API request, every method has a group of required parameters and optional parameters used for defining API. The parameters and their meanings can be viewed in the description of each method. Signature Method the hash-based protocol of calculating signatures by users, HmacMD5 is applied here. Signature the value calculated by signature is used for ensuring that the signature is valid and not tampered. Please be noted: Signature means signing the value of cmds after formatting! Example { \"cmds\": \"[{\\\"cmd\\\":\\\"transfer/assets\\\",\\\"body\\\":{\\\"select\\\":1}}]\", \"apikey\":\"5213595xxxxedca0809axxxxxaba7580xxxxxa6\", \"sign\":\"6a21e39e3f68b6fc2227c4074c7e6a6c\" //The result of signing cmds by your apisecret } Sign Steps API request can be tempered at great risk while it is sent through the Internet. To ensure that the request is not tempered, we will require users to sign in every request (except market API) for verifying the authticity of parameters or the values of parameters. Establish a standard for requests of calculating signatures because when using HMAC to calculate signature, total different results will be achieved as different contents are calculated. So before calculating signatures, please make a standard. Examples of the request of viewing asset detail will be given as follows. { \"cmds\":[ { \"cmd\":\"transfer/assets\", \"body\":{ \"select\":1 } } ], \"apikey\":\"\", \"sign\":\"\" } formatting cmds{ \"cmds\": \"[{\\\"cmd\\\":\\\"transfer/assets\\\",\\\"body\\\":{\\\"select\\\":1}}]\", //js用 JSON.stringify()进行格式化 \"apikey\":\"\", \"sign\":\"\" } Fill in with the apikey you applied{ \"cmds\": \"[{\\\"cmd\\\":\\\"transfer/assets\\\",\\\"body\\\":{\\\"select\\\":1}}]\", \"apikey\":\"5213595xxxxedca0809axxxxxaba7580xxxxxa6\", \"sign\":\"\" } Use the apisecret you applied to sign cmds{ \"cmds\": \"[{\\\"cmd\\\":\\\"transfer/assets\\\",\\\"body\\\":{\\\"select\\\":1}}]\", \"apikey\":\"5213595xxxxedca0809axxxxxaba7580xxxxxa6\", \"sign\":\"6a21e39e3f68b6fc2227c4074c7e6a6c\" } Calculate signature, please introduces the following 2 parameters into hash function The character string needed to be calculated with signature \"[{\\\"cmd\\\":\\\"transfer/assets\\\",\\\"body\\\":{\\\"select\\\":1}}]\" the apisecret needed to be signed bxxxxxxxxf1236222xxxxxxxxx6d5d76d5xxxxxxxxx Acquire the result of signature calculation 6a21e39e3f68b6fc2227c4074c7e6a6c the example of completed signature nodejs implements let CryptoJS = require(\"crypto-js\"); let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\": \"transfer/assets\", \"body\": { \"select\": 1 } } ]; let form = { \"cmds\": JSON.stringify(param), //格式化param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(form) output { \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/assets\\\",\\\"body\\\":{\\\"select\\\":1}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"86e88a4bc8eedc795b453f121f5894ee\" } API Request and Response Format Bibox REST API parameter standard, supports a batch of requests, please read carefully. Request Parameter the request format of requiring apikey // Request { \"cmds\": JSON.stringify([ // Supporting a batch of requests (different setting of cmd is used for differentiating the result of return) { \"cmd\": \"orderpending/trade\", \"index\": 1234567, \"body\": { \"pair\": \"BIX_BTC\", ... } }, { \"cmd\": \"orderpending/cancelTrade\", \"body\": { \"orders_id\": 12345 } } ]), \"apikey\": \"**************\", // your apikey \"sign\": \"**************\" // The result of signing cmds with you apisecret signature (serialized) } the request format of not requiring apikey // Request { \"cmds\": JSON.stringify([ { \"cmd\": \"api/ticker\", \"body\": { \"pair\": \"BIX_BTC\" } }, { \"cmd\": \"api/depth\", \"body\": { \"pair\": \"BIX_BTC\", \"size\": 10, } } ]) } The explanation of parameter name desc cmds The encapsulation format of requesting parameter, arraytype, serialized is required when using, each element in array represents an independent API invoking. cmd The name of API interface, please refer to API Reference body The corresponding request parameter of cmd, please refer to API_Reference apikey The apikey alloacated by system sign The result of signing cmds (after formatting) with api secret allocated by system The result of return Request success return { \"result\":[ { \"cmd\":\"api/pairList\", \"result\":[ { \"id\":1, \"pair\":\"BIX_BTC\" }, { \"id\":2, \"pair\":\"ETH_BTC\" } ] } ] } The explanation of results name desc cmd The name of API interface, please refer to API Reference result(outside) a batch of requests of returning results, the order consistency is not guaranteed result(inside) The result of returning specific cmd interface Request error return { \"error\":{ \"code\":\"1000\", \"msg\":\"something error\" } } The explanation of results name desc code error code msg The description of error a batch request of returns { \"result\":[ { //success \"cmd\":\"api/pairList\", \"result\":[ { \"id\":1, \"pair\":\"BIX_BTC\" }, { \"id\":2, \"pair\":\"ETH_BTC\" } ] }, { //error \"cmd\":\"api/depth\", \"error\":{ \"code\":\"1000\", \"msg\":\"something error\" } } ] } Example // Request let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/transfer\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\": \"transfer/assets\", \"body\": { \"select\": 1 } } ]; let form = { \"cmds\": JSON.stringify(param), //stringify param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log({url, form}) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { let result = JSON.parse(body); console.log(result) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); request parameter { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/assets\\\",\\\"body\\\":{\\\"select\\\":1}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"86e88a4bc8eedc795b453f121f5894ee\" } } error return // Response { \"error\":{ \"code\":\"3012\", \"msg\":\"apikey无效\" } } success return // Response { \"result\":[ { \"result\":{ \"total_btc\":\"3.28811692\", \"total_cny\":\"201875.67\", \"total_usd\":\"28847.20\", \"assets_list\":[ { \"coin_symbol\":\"BTC\", \"BTCValue\":\"0.21730559\", \"CNYValue\":\"13341.59\", \"USDValue\":\"1906.46\", \"balance\":\"0.21730558\", \"freeze\":\"0.00000000\" }, { \"coin_symbol\":\"BIX\", \"BTCValue\":\"0.03018417\", \"CNYValue\":\"1853.17\", \"USDValue\":\"264.81\", \"balance\":\"62.68909999\", \"freeze\":\"0.00000000\" } ] }, \"cmd\":\"transfer/assets\" } ] } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2019-11-13 "},"rest_api_c.html":{"url":"rest_api_c.html","title":"Restful API contract trading","keywords":"","body":"Restful API description for contract View Kline GET https://api.bibox.com/v1/mdata?cmd=kline&pair=4BTC_USDT&period=1min&size=10 POST https://api.bibox.com/v1/mdata cmd: api/kline Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 4BTC_USDT, 4ETH_USDT, ... period true string Kline period '1min', '3min', '5min', '15min', '30min', '1hour', '2hour', '4hour', '6hour', '12hour', 'day', 'week' size false integer how many 1000 1-1000 example // Request { \"cmd\": \"api/kline\", \"body\": { \"pair\": \"4BTC_USDT\", \"period\": \"1min\", \"size\": 10 } } { \"url\":\"https://api.bibox.com/v1/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/kline\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\",\\\"period\\\":\\\"1min\\\",\\\"size\\\":10}}]\", } } // Response { \"result\":[ { \"time\":1575450180000, // Timestamp \"open\":\"7196.33000000\", // Opening Price \"high\":\"7196.33000000\", // The highest price \"low\":\"7188.90000000\", // The lowest price \"close\":\"7188.90000000\", // Closing Price \"vol\":\"337.00000000\" // Trading Volume }, { \"time\":1575450240000, \"open\":\"7188.88000000\", \"high\":\"7188.96000000\", \"low\":\"7185.67000000\", \"close\":\"7187.18000000\", \"vol\":\"844.00000000\" }, ], \"cmd\":\"api/kline\" } View the contract depth of the market GET https://api.bibox.com/v1/mdata?cmd=depth&pair=4BTC_USDT&size=10 POST https://api.bibox.com/v1/mdata cmd: api/depth Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 4BTC_USDT, 4ETH_USDT, ... size false integer c 200 1-200 example // Request { \"cmd\": \"api/depth\", \"body\": { \"pair\": \"4BTC_USDT\" } } { \"url\":\"https://api.bibox.com/v1/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/depth\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\"}}]\", } } // Response { \"result\":{ \"pair\":\"4BTC_USDT\", \"update_time\":1510983122681, \"asks\":[ //The depth of sellers { \"price\":\"0.008654\", //The price of pending order \"volume\":\"200.9123\" //The price of pending orders } ], \"bids\":[ //The depth of buyers { \"price\":\"0.008596\", //The price of pending order \"volume\":\"18.54306495\" //The price of pending orders }, { \"price\":\"0.00859289\", \"volume\":\"40.13567123\" } ] }, \"cmd\":\"api/depth\" } contract account information POST https://api.bibox.com/v1/cquery cmd:query/assets example Request parameter // Request [ { \"cmd\":\"query/assets\", \"body\":{} } ] { \"url\":\"https://api.bibox365.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/assets\\\",\\\"body\\\":{}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"85190bfcb83357b9fa5aa2e79f0d7826\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\": \"query/assets\", \"body\": {} } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":{ \"balance\":\"97.2378\", // available balance \"freeze\":\"1.7326\", // frozen amount \"profit\":\"-2.4327\", \"margin\":\"1.7326\", \"imargin\":\"0.0000\", \"total_balance\":\"98.8397\", \"BTCValue\":\"0.02528321\", \"CNYValue\":\"664.61\", \"USDValue\":\"98.84\", \"floatProfitBTC\":\"-0.00003344\", \"floatProfit\":\"-0.1308\", \"profitBTC\":\"-0.00062226\", \"freezeBTC\":\"0.00044322\" }, \"cmd\":\"query/assets\" } ] } check single information of contract position POST https://api.bibox.com/v1/cquery cmd: query/order Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true string contract symbol 4BTC_USDT,4ETH_USDT, ... example Request parameter // Request { \"cmd\":\"query/order\", \"body\":{ \"pair\":\"4BTC_USDT\" // contract symbol:BTCUSDT Perpetual Contract symbol is 4BTC_USDT,ETHUSDT Perpetual Contract symbol is 4ETH_USDT 。。。 } } { \"url\":\"https://api.bibox.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/order\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"e533359a43984510ef4dbcb0941bac6b\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\": \"query/order\", \"body\": { \"pair\":\"4BTC_USDT\" } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":{ \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // contract symbol \"contract\":2, // position size \"margin\":\"1.5612\", // margin \"profit\":\"-2.4995\", \"price\":\"3903.0450\", // average price of opening position \"order_side\":2, // side: 1long, 2short \"price_force\":\"3961.5907\", // forced liquidation price \"floatProfit\":\"-0.1376\", \"leverage\":50, // 0:cross-margin, others: fixed leverage \"icontract_up\":2, // uncompleted orders in long position \"icontract_down\":0 // uncompleted orders in short position }, \"cmd\":\"query/order\" } ] } Check all information of contract position POST https://api.bibox.com/v1/cquery cmd: query/orderAll Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true string Contract symbol 4BTC_USDT,4ETH_USDT, ... example Request parameter // Request { \"cmd\":\"query/orderAll\", \"body\":{ } } { \"url\":\"https://api.bibox.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderAll\\\",\\\"body\\\":{}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"1a9be520fb658c677b86f99769634e5b\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\": \"query/orderAll\", \"body\": { } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":[ { \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // Contract symbol \"contract\":2, // position size \"margin\":\"1.5612\", // margin \"profit\":\"-2.4995\", \"price\":\"3903.0450\", // average price of opening position \"order_side\":2, // position side: 1long, 2short \"price_force\":\"3961.5907\", // forced liquidation price \"floatProfit\":\"-0.1376\", \"leverage\":50, // 0:cross-margin, others: fixed leverage \"icontract_up\":2, // uncompleted Cont of limit order in long position \"icontract_down\":0 // uncompleted Cont of limit order in short position }, { \"coin_symbol\":\"USDT\", \"pair\":\"4ETH_USDT\", \"contract\":6, \"margin\":\"0.1714\", \"profit\":\"0.0668\", \"price\":\"142.8816\", \"order_side\":2, \"price_force\":\"145.0248\", \"floatProfit\":\"0.0063\", \"leverage\":50, \"icontract_up\":6, \"icontract_down\":0 } ], \"cmd\":\"query/orderAll\" } ] } Check uncompleted contract orders POST https://api.bibox.com/v1/cquery cmd: query/orderPending Request parameter Parameter Name Necessary or not Type Description Default Value Range page true integer page 1,2, ... size true integer number 10,20, ... pair false string Contract symbol 4BTC_USDT,4ETH_USDT, ... example Request parameter // Request { \"cmd\":\"query/orderPending\", \"body\":{ \"page\":1, \"size\":20, \"pair\":\"\" } } { \"url\":\"https://api.bibox.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderPending\\\",\\\"body\\\":{\\\"page\\\":1,\\\"size\\\":20,\\\"pair\\\":\\\"\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"caef8a751a35660e073ea07014b3b8d8\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderPending\", \"body\":{ \"page\":1, \"size\":20, \"pair\":\"\" } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":{ \"count\":3, \"page\":1, \"items\":[ { \"id\":491168, // order number \"coin_symbol\":\"USDT\", \"pair\":\"4ETH_USDT\", // contract symbol \"order_side\":1, // position side: 1long, 2short \"order_type\":2, \"contract\":3, // number of orders \"order_from\":1, \"status\":1, // 0,1:uncompleted; 2:partly completed; 3:completed; 4: partly cancel; 5 cancel completed; 6,7 system cancel; >=100 order fail \"price\":\"136.0000\", // order price \"price_deal\":\"0.0000\", // average transaction price \"deal_count\":0, \"contract_deal\":0, // number of completed orders \"createdAt\":\"2019-02-20T02:01:46.000Z\", \"updatedAt\":\"2019-02-20T02:01:46.000Z\" }, { \"id\":489453, \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", \"order_side\":1, \"order_type\":2, \"contract\":2, \"order_from\":1, \"status\":1, \"price\":\"3850.0000\", \"price_deal\":\"0.0000\", \"deal_count\":0, \"contract_deal\":0, \"createdAt\":\"2019-02-20T01:51:41.000Z\", \"updatedAt\":\"2019-02-20T01:51:42.000Z\" } ] }, \"cmd\":\"query/orderPending\" } ] } make contract order POST https://api.bibox.com/v1/ctrade cmd: order/open Request parameter Parameter Name Necessary or not Type Description Default Value Range order_type true integer order type 1:market price 2:limited price leverage true integer leverage cross margin:0, fixed margin:1,2,... cross_leverage false integer cross leverage 25 when leverage=0 and cross_leverage=1,2,...50 order_side true integer position side 1:long, 2:short price true string order price The numbers greater than 0 contract true string Cont 1,2, ... pair true string contract symbol 4BTC_USDT,4ETH_USDT, ... order_from true integer 6 6 client_oid false Long client order id > 0 example Request parameter // Request { \"cmd\":\"order/open\", \"body\":{ \"pair\":\"4BTC_USDT\", \"order_type\":2, \"price\":\"3929.97\", \"contract\":\"1\", \"order_from\":1, \"leverage\":50, \"cross_leverage\":25, \"order_side\":1, \"client_oid\": '123456789', } } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/open\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\",\\\"order_type\\\":2,\\\"price\\\":\\\"3929.97\\\",\\\"contract\\\":\\\"1\\\",\\\"order_from\\\":1,\\\"leverage\\\":50,\\\"cross_leverage\\\":25,\\\"order_side\\\":1,\\\"client_oid\\\":\\\"123456789\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"d298bb71db50f31c9fc923595e942fcd\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/open\", \"body\":{ \"pair\":\"4BTC_USDT\", \"order_type\":2, \"price\":\"3929.97\", \"contract\":\"1\", \"order_from\":1, \"leverage\":50, \"cross_leverage\":25, \"order_side\":1, \"client_oid\": '123456789', } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { result: '17592186044786', // order id client_oid: '123456789', // client order id cmd: 'order/open', } ] } make bulk contract orders POST https://api.bibox.com/v1/ctrade cmd: order/openBatch Request parameter Parameter Name Necessary or not Type Description Default Value Range leverage true integer leverage cross margin:0, fixed margin:1,2,... cross_leverage false integer cross leverage 25 when leverage=0 and cross_leverage=1,2,...50 order_side true integer position side 1:long, 2:short price true string order price The numbers greater than 0 contract true string Cont 1,2, ... pair true string Contract symbol 4BTC_USDT,4ETH_USDT, ... client_oid false Long client order id > 0 example Request parameter // Request { \"cmd\":\"order/openBatch\", \"body\":{ \"pair\":\"4ETH_USDT\", \"leverage\":50, \"cross_leverage\": 25, \"arr\":[ { \"order_side\":1, \"price\":140, \"contract\":1, \"client_oid\": '123456787' }, { \"order_side\":1, \"price\":140.5, \"contract\":1, \"client_oid\": '123456788' } ] } } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/openBatch\\\",\\\"body\\\":{\\\"pair\\\":\\\"4ETH_USDT\\\",\\\"leverage\\\":50,\\\"cross_leverage\\\":25,\\\"arr\\\":[{\\\"order_side\\\":1,\\\"price\\\":140,\\\"contract\\\":1,\\\"client_oid\\\":\\\"123456787\\\"},{\\\"order_side\\\":1,\\\"price\\\":140.5,\\\"contract\\\":1,\\\"client_oid\\\":\\\"123456788\\\"}]}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"cb3eee178b4f6442026d324760f9b9cd\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/openBatch\", \"body\":{ \"pair\":\"4ETH_USDT\", \"leverage\":50, \"cross_leverage\": 25, \"arr\":[ { \"order_side\":1, \"price\":140, \"contract\":1, \"client_oid\": '123456787' }, { \"order_side\":1, \"price\":140.5, \"contract\":1, \"client_oid\": '123456788' } ] } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":[ { code: 0, // 0 means success;non-zero means failure, code is error code id: '17592186044787', // order id msg: '', client_oid: '123456787' }, { code: 0, id: '17592186044790', msg: '', client_oid: '123456788' } ], \"cmd\":\"order/openBatch\" } ] } cancel contract order POST https://api.bibox.com/v1/ctrade cmd: order/close Request parameter Parameter Name Necessary or not Type Description Default Value Range order_id true string order id example Request parameter // Request { \"cmd\":\"order/close\", \"body\":{ \"order_id\":\"574954\" } } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/close\\\",\\\"body\\\":{\\\"order_id\\\":\\\"574954\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"9a9286632189e3c2d6581cb81e38349b\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/close\", \"body\":{ \"order_id\":\"574954\" } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":\"success\", \"cmd\":\"order/close\" } ] } cancel multiple orders POST https://api.bibox.com/v1/ctrade cmd: order/closeBatch Request parameter Parameter Name Necessary or not Type Description Default Value Range order_ids true string order id array example Request parameter // Request { \"cmd\":\"order/closeBatch\", \"body\":{ \"order_ids\":[ \"574953\", \"574954\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/closeBatch\\\",\\\"body\\\":{\\\"order_ids\\\":[\\\"574953\\\",\\\"574954\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"64449ef8dc5016a6230ce4a8f0f18eb1\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/closeBatch\", \"body\":{ \"order_ids\":[ \"574953\", \"574954\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":\"success\", \"cmd\":\"order/closeBatch\", \"index\":13 } ] } cancel 1000 orders POST https://api.bibox.com/v1/ctrade cmd: order/closeAll example Request parameter // Request { \"cmd\":\"order/closeAll\", \"body\":{ }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/closeAll\\\",\\\"body\\\":{},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"d0ab49a6de0aa0254baa8445582b42c2\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/closeAll\", \"body\":{ }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":\"success\", \"cmd\":\"order/closeAll\", \"index\":13 } ] } cancel multiple orders through client order id POST https://api.bibox.com/v1/ctrade cmd: order/closeBatchClientOid Request parameter Parameter Name Necessary or not Type Description Default Value Range clientIds true string array client oid limit 50 example Request parameter // Request { \"cmd\":\"order/closeBatchClientOid\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/closeBatchClientOid\\\",\\\"body\\\":{\\\"clientIds\\\":[\\\"1588819328619\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3172e38a62698ffc4f73223c6a0b22d3\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/closeBatchClientOid\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":\"success\", \"cmd\":\"order/closeBatchClientOid\" } ] } adjust contract leverage POST https://api.bibox.com/v1/ctrade cmd: order/changeLeverage Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true string Contract symbol 4BTC_USDT,4ETH_USDT, ... leverage true integer leverage cross margin:0, fixed margin:1,2,... cross true integer cross flag cross: 1, fixed: 0 example Request parameter // Request { \"cmd\":\"order/changeLeverage\", \"body\":{ \"pair\":\"4BTC_USDT\", \"leverage\":40, \"cross\": 0 }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/changeLeverage\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\",\\\"leverage\\\":40,\\\"cross\\\":0},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"1abd620b3cc04be7e181309d5c83670e\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/changeLeverage\", \"body\":{ \"pair\":\"4BTC_USDT\", \"leverage\":40, \"cross\": 0 }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":\"success\", \"cmd\":\"order/changeLeverage\", \"index\":13 } ] } adjust contract margin POST https://api.bibox.com/v1/ctrade cmd: order/changeMargin Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true string Contract symbol 4BTC_USDT,4ETH_USDT, ... margin true integer increase or reduce margin increase: margin>=0.5; reduce: margin example Request parameter // Request { \"cmd\":\"order/changeMargin\", \"body\":{ \"pair\": \"4ETH_USDT\", \"margin\": 4 }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/changeMargin\\\",\\\"body\\\":{\\\"pair\\\":\\\"4ETH_USDT\\\",\\\"margin\\\":4},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"f6ef54d12ccadaef85782a7a238413f6\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/changeMargin\", \"body\":{ \"pair\": \"4ETH_USDT\", \"margin\": 4 }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":\"success\", \"cmd\":\"order/changeMargin\", \"index\":13 } ] } transfer funds from master account to contract account POST https://api.bibox.com/v1/ctrade cmd: transfer/in Request parameter Parameter Name Necessary or not Type Description Default Value Range amount true integer amount example Request parameter // Request { \"cmd\":\"transfer/in\", \"body\":{ \"amount\":\"100\" } } { \"url\":\"https://api.bibox.com/v1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/in\\\",\\\"body\\\":{\\\"amount\\\":\\\"100\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"16c40525ae36ae0f55fe5237c91336cd\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"transfer/in\", \"body\":{ \"amount\":\"100\" } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":\"success\", \"cmd\":\"transfer/in\" } ] } check transaction records in the market GET https://api.bibox.com/v1/cquery?cmd=deals&&pair=4ETH_USDT&&size=10 Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true String Contract symbol 4BTC_USDT,4ETH_USDT,... size true integer number 1,2,... The description of return result { \"result\":{ \"result\":[ { \"pair\":\"4BTC_USDT\", // contract symbol \"order_side\":1, // 1long, 2short \"contract\":52, // number of orders \"price\":\"3601.1600\", // transaction price \"createdAt\":1550977541000 // transaction time }, ... ], \"cmd\":\"deals\" } } check orders through order id POST https://api.bibox.com/v1/cquery cmd: query/orderPendingByIDs Request parameter Parameter Name Necessary or not Type Description Default Value Range ids true string array order id limit 50 example Request parameter // Request { \"cmd\":\"query/orderPendingByIDs\", \"body\":{ \"ids\":[ \"491168\", \"2\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderPendingByIDs\\\",\\\"body\\\":{\\\"ids\\\":[\\\"491168\\\",\\\"2\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3172e38a62698ffc4f73223c6a0b22d3\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderPendingByIDs\", \"body\":{ \"ids\":[ \"491168\", \"2\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":[ { \"id\":491168, // order id \"coin_symbol\":\"USDT\", \"pair\":\"4ETH_USDT\", // Contract symbol \"order_side\":1, // 1long, 2short \"order_type\":2, \"contract\":3, // contract \"order_from\":1, \"status\":1, // 0,1:uncompleted; 2:partly completed; 3:completed; 4: partly cancel; 5 cancel completed; 6,7 system cancel; >=100 order fail \"price\":\"136.0000\", // order price \"price_deal\":\"0.0000\", // average transaction price \"deal_count\":0, \"contract_deal\":0, // number of completed orders \"createdAt\":\"2019-02-20T02:01:46.000Z\", \"updatedAt\":\"2019-02-20T02:01:46.000Z\" }, { \"id\":2, \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", \"order_side\":1, \"order_type\":2, \"contract\":1, \"order_from\":1, \"status\":3, \"price\":\"3622.0000\", \"price_deal\":\"3622.0000\", \"deal_count\":1, \"contract_deal\":1, \"createdAt\":\"2019-02-15T13:10:27.000Z\", \"updatedAt\":\"2019-02-15T13:10:45.000Z\" } ], \"cmd\":\"query/orderPendingByIDs\", \"index\":13 } ] } check uncompleted orders through client order id POST https://api.bibox.com/v1/cquery cmd: query/ordersDetailByClientIds 请求参数 参数名称 是否必须 类型 描述 默认值 取值范围 clientIds true string array client_oid limit 50 示例 POST https://api.bibox.com/v1/cquery cmd: query/ordersDetailByClientIds Request parameter Parameter Name Necessary or not Type Description Default Value Range clientIds true string array client oid limit 50 example Request parameter // Request { \"cmd\":\"query/ordersDetailByClientIds\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/ordersDetailByClientIds\\\",\\\"body\\\":{\\\"clientIds\\\":[\\\"1588819328619\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3172e38a62698ffc4f73223c6a0b22d3\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/ordersDetailByClientIds\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //格式化param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//签名cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":[ { \"id\": \"71468256443234\", \"user_id\": 101051, \"client_oid\": \"1588819328619\", \"pair\": \"4BTC_USDT\", \"coin_symbol\": \"4BTC\", \"price\": \"9486.0000\", \"price_deal\": \"9485.9900\", \"contract\": \"15\", \"contract_deal\": \"4\", \"deal_count\": \"1\", \"order_side\": 1, \"order_type\": 2, \"order_from\": 6, \"status\": 2, \"reason\": 0, \"createdAt\": 1588819336186, \"updatedAt\": 1588819336186 }, ], \"cmd\":\"query/ordersDetailByClientIds\", \"index\":13 } ] } check orders through client order id POST https://api.bibox.com/v1/cquery cmd: query/orderPendingByClientIds 请求参数 参数名称 是否必须 类型 描述 默认值 取值范围 clientIds true string array client_oid limit 50 示例 POST https://api.bibox.com/v1/cquery cmd: query/orderPendingByClientIds Request parameter Parameter Name Necessary or not Type Description Default Value Range clientIds true string array client oid limit 50 example Request parameter // Request { \"cmd\":\"query/orderPendingByClientIds\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderPendingByClientIds\\\",\\\"body\\\":{\\\"clientIds\\\":[\\\"1588819328619\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3172e38a62698ffc4f73223c6a0b22d3\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderPendingByClientIds\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //格式化param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//签名cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":[ { \"id\": 71468256443234, \"client_oid\": \"1588819328619\", \"coin_symbol\": \"USDT\", \"pair\": \"4BTC_USDT\", \"order_side\": 1, \"order_type\": 2, \"contract\": 15, \"order_from\": 6, \"status\": 3, \"price\": \"9486.0000\", \"price_deal\": \"9485.9973\", \"deal_count\": 2, \"contract_deal\": 15, \"createdAt\": \"2020-05-07T02:42:16.000Z\", \"updatedAt\": \"2020-05-07T03:02:24.000Z\" } }, ], \"cmd\":\"query/orderPendingByClientIds\", \"index\":13 } ] } check personal position changed record POST https://api.bibox.com/v1/cquery cmd: query/orderList Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true String contract symbol 1,2,... page true integer page 1,2,... size true integer number 1,2,... begin_time false integer starting time end_time false integer ending time type false integer transaction type 1open position, 2liquidation, 3forced liquidation, 4cover position example Request parameter // Request { \"cmd\":\"query/orderList\", \"body\":{ \"pair\":\"4BTC_USDT\", \"page\":1, \"size\":100, \"begin_time\":1550971541000, \"end_time\":1550977541000, type: 2, } } { \"url\":\"https://api.bibox.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderList\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\",\\\"page\\\":1,\\\"size\\\":100,\\\"begin_time\\\":1550971541000,\\\"end_time\\\":1550977541000,\\\"type\\\":2}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"2517280ee4d332c3b63d4ee34fa5bb06\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderList\", \"body\":{ \"pair\":\"4BTC_USDT\", \"page\":1, \"size\":100, \"begin_time\":1550971541000, \"end_time\":1550977541000, type: 2, } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":{ \"count\":101, \"page\":1, \"items\":[ { \"id\":236343, \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // contract symbol \"type\":2, // 1open position, 2liquidation, 3forced liquidation, 4cover position \"order_side\":2, // 1long, 2short \"price_open\":\"3999.0000\", // order pirce \"price\":\"3964.5800\", // average price of opening position \"price_deal\":\"3999.0000\", // transaction price \"contract\":2, // number of Cont \"profit\":\"0.6884\", // profits and losses \"fee\":\"0.0000\", // transaction fee \"createdAt\":\"2019-02-23T17:07:31.000Z\" }, ... ] }, \"cmd\":\"query/orderList\" } ] } query order detail POST https://api.bibox.com/v1/cquery cmd: query/orderDetailByID Request parameter Parameter Name Necessary or not Type Description Default Value Range id true String order id example Request parameter // Request { \"cmd\":\"query/orderDetailByID\", \"body\":{ \"id\":\"58\", // order id } } { \"url\":\"https://api.bibox.com/v1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderDetailByID\\\",\\\"body\\\":{\\\"id\\\":\\\"58\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"2a5c0bdaea46ddf4efa809bd92e0181a\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderDetailByID\", \"body\":{ \"id\":\"58\", // order id } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"result\":{ \"items\":[ { \"id\":42, // order detail id \"coin_symbol\":\"USDT\", // \"pair\":\"4BTC_USDT\", // Contract symbol \"order_side\":1, // 1 long, 2short \"contract\":1, // contract \"order_from\":1, // 1web,2android,3ios, 6 apikey, \"createdAt\":\"2019-08-13T08:22:25.000Z\", // create time \"updatedAt\":\"2019-08-13T08:22:26.000Z\", \"price\":\"7029.9700\", // price \"price_deal\":\"0.0000\", // deal price \"fee\":\"0.0000\", // fee \"is_cancel\":1, // 0 normal 1: canceld order \"is_maker\":1, // 0: taker; 1: maker; \"order_type\":2 // 1:market price 2:limited price } ], \"count\":9, \"page\":1 }, \"cmd\":\"query/orderDetailByID\" } ] } query contract value (apikey not required) GET https://api.bibox.com/v1/cquery?cmd=contractValue The description of return result { \"result\":{ \"result\":[ { \"pair\":\"4BTC_USDT\", \"value\":\"0.0100000000\", \"coin_symbol\":\"BTC\" }, ], \"cmd\":\"contractValue\" } } query contract leverage info (apikey not required) GET https://api.bibox.com/v1/cquery?cmd=contractConfig The description of return result { \"result\":{ \"result\":{ \"cross_leverage\":25, // cross leverage \"leverage_max\":50, // max leverage \"margin_rate_force\":\"0.01\", // margin rate force \"night_fee_rate\":\"0.0006\", // night fee rate \"hold_limit\":{ // hold limit amount \"BTC\":5000, \"ETH\":150000, \"EOS\":50000, \"LTC\":35000, \"BCH\":100000 } }, \"cmd\":\"contractConfig\" } } query contract open limit once (apikey not required) GET https://api.bibox.com/v1/cquery?cmd=openLimit The description of return result { \"result\":{ \"result\":{ \"BTC\":5000, \"ETH\":75000, \"EOS\":75000, \"LTC\":15000, \"BCH\":15000 }, \"cmd\":\"openLimit\" } } query current funding rate (apikey not required) GET https://api.bibox.com/v1/cquery?cmd=lastPremiumIndex The description of return result { \"result\":{ \"result\":{ \"4BTC_USDT\":{ \"id\":164391, \"pair\":\"4BTC_USDT\", \"close\":\"0.0007000000\", \"fund_rate_up\":\"0.0005000000\", \"fund_rate_down\":\"-0.0005000000\", \"createdAt\":\"2020-02-27T00:00:00.000Z\", \"updatedAt\":\"2020-02-27T00:00:00.000Z\" }, ... }, \"cmd\":\"lastPremiumIndex\" } } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2020-10-30 "},"rest_api_c_v1_1.html":{"url":"rest_api_c_v1_1.html","title":"Restful API contract trading_V1.1","keywords":"","body":"Restful API description for contract Description v1.1 streamlines the returned results of v1. Requirements: The cmds in the parameter contains only one cmd. contract account information POST https://api.bibox.com/v1.1/cquery cmd:query/assets example Request parameter // Request [ { \"cmd\":\"query/assets\", \"body\":{} } ] { \"url\":\"https://api.bibox365.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/assets\\\",\\\"body\\\":{}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"85190bfcb83357b9fa5aa2e79f0d7826\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\": \"query/assets\", \"body\": {} } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":{ \"balance\":\"97.2378\", // available balance \"freeze\":\"1.7326\", // frozen amount \"profit\":\"-2.4327\", \"margin\":\"1.7326\", \"imargin\":\"0.0000\", \"total_balance\":\"98.8397\", \"BTCValue\":\"0.02528321\", \"CNYValue\":\"664.61\", \"USDValue\":\"98.84\", \"floatProfitBTC\":\"-0.00003344\", \"floatProfit\":\"-0.1308\", \"profitBTC\":\"-0.00062226\", \"freezeBTC\":\"0.00044322\" }, \"cmd\":\"query/assets\" } check single information of contract position POST https://api.bibox.com/v1.1/cquery cmd: query/order Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true string contract symbol 4BTC_USDT,4ETH_USDT, ... example Request parameter // Request { \"cmd\":\"query/order\", \"body\":{ \"pair\":\"4BTC_USDT\" // contract symbol:BTCUSDT Perpetual Contract symbol is 4BTC_USDT,ETHUSDT Perpetual Contract symbol is 4ETH_USDT 。。。 } } { \"url\":\"https://api.bibox.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/order\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"e533359a43984510ef4dbcb0941bac6b\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\": \"query/order\", \"body\": { \"pair\":\"4BTC_USDT\" } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":{ \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // contract symbol \"contract\":2, // position size \"margin\":\"1.5612\", // margin \"profit\":\"-2.4995\", \"price\":\"3903.0450\", // average price of opening position \"order_side\":2, // side: 1long, 2short \"price_force\":\"3961.5907\", // forced liquidation price \"floatProfit\":\"-0.1376\", \"leverage\":50, // 0:cross-margin, others: fixed leverage \"icontract_up\":2, // uncompleted orders in long position \"icontract_down\":0 // uncompleted orders in short position }, \"cmd\":\"query/order\" } Check all information of contract position POST https://api.bibox.com/v1.1/cquery cmd: query/orderAll Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true string Contract symbol 4BTC_USDT,4ETH_USDT, ... example Request parameter // Request { \"cmd\":\"query/orderAll\", \"body\":{ } } { \"url\":\"https://api.bibox.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderAll\\\",\\\"body\\\":{}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"1a9be520fb658c677b86f99769634e5b\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\": \"query/orderAll\", \"body\": { } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // Contract symbol \"contract\":2, // position size \"margin\":\"1.5612\", // margin \"profit\":\"-2.4995\", \"price\":\"3903.0450\", // average price of opening position \"order_side\":2, // position side: 1long, 2short \"price_force\":\"3961.5907\", // forced liquidation price \"floatProfit\":\"-0.1376\", \"leverage\":50, // 0:cross-margin, others: fixed leverage \"icontract_up\":2, // uncompleted Cont of limit order in long position \"icontract_down\":0 // uncompleted Cont of limit order in short position }, { \"coin_symbol\":\"USDT\", \"pair\":\"4ETH_USDT\", \"contract\":6, \"margin\":\"0.1714\", \"profit\":\"0.0668\", \"price\":\"142.8816\", \"order_side\":2, \"price_force\":\"145.0248\", \"floatProfit\":\"0.0063\", \"leverage\":50, \"icontract_up\":6, \"icontract_down\":0 } ], \"cmd\":\"query/orderAll\" } Check uncompleted contract orders POST https://api.bibox.com/v1.1/cquery cmd: query/orderPending Request parameter Parameter Name Necessary or not Type Description Default Value Range page true integer page 1,2, ... size true integer number 10,20, ... pair false string Contract symbol 4BTC_USDT,4ETH_USDT, ... example Request parameter // Request { \"cmd\":\"query/orderPending\", \"body\":{ \"page\":1, \"size\":20, \"pair\":\"\" } } { \"url\":\"https://api.bibox.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderPending\\\",\\\"body\\\":{\\\"page\\\":1,\\\"size\\\":20,\\\"pair\\\":\\\"\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"caef8a751a35660e073ea07014b3b8d8\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderPending\", \"body\":{ \"page\":1, \"size\":20, \"pair\":\"\" } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":{ \"count\":3, \"page\":1, \"items\":[ { \"id\":491168, // order number \"coin_symbol\":\"USDT\", \"pair\":\"4ETH_USDT\", // contract symbol \"order_side\":1, // position side: 1long, 2short \"order_type\":2, \"contract\":3, // number of orders \"order_from\":1, \"status\":1, // 0,1:uncompleted; 2:partly completed; 3:completed; 4: partly cancel; 5 cancel completed; 6,7 system cancel; >=100 order fail \"price\":\"136.0000\", // order price \"price_deal\":\"0.0000\", // average transaction price \"deal_count\":0, \"contract_deal\":0, // number of completed orders \"createdAt\":\"2019-02-20T02:01:46.000Z\", \"updatedAt\":\"2019-02-20T02:01:46.000Z\" }, { \"id\":489453, \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", \"order_side\":1, \"order_type\":2, \"contract\":2, \"order_from\":1, \"status\":1, \"price\":\"3850.0000\", \"price_deal\":\"0.0000\", \"deal_count\":0, \"contract_deal\":0, \"createdAt\":\"2019-02-20T01:51:41.000Z\", \"updatedAt\":\"2019-02-20T01:51:42.000Z\" } ] }, \"cmd\":\"query/orderPending\" } make contract order POST https://api.bibox.com/v1.1/ctrade cmd: order/open Request parameter Parameter Name Necessary or not Type Description Default Value Range order_type true integer order type 1:market price 2:limited price leverage true integer leverage cross margin:0, fixed margin:1,2,... cross_leverage false integer cross leverage 25 when leverage=0 and cross_leverage=1,2,...50 order_side true integer position side 1:long, 2:short price true string order price The numbers greater than 0 contract true string Cont 1,2, ... pair true string contract symbol 4BTC_USDT,4ETH_USDT, ... order_from true integer 6 6 client_oid false Long client order id > 0 example Request parameter // Request { \"cmd\":\"order/open\", \"body\":{ \"pair\":\"4BTC_USDT\", \"order_type\":2, \"price\":\"3929.97\", \"contract\":\"1\", \"order_from\":1, \"leverage\":50, \"cross_leverage\":25, \"order_side\":1, \"client_oid\": '123456789', } } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/open\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\",\\\"order_type\\\":2,\\\"price\\\":\\\"3929.97\\\",\\\"contract\\\":\\\"1\\\",\\\"order_from\\\":1,\\\"leverage\\\":50,\\\"cross_leverage\\\":25,\\\"order_side\\\":1,\\\"client_oid\\\":\\\"123456789\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"d298bb71db50f31c9fc923595e942fcd\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/open\", \"body\":{ \"pair\":\"4BTC_USDT\", \"order_type\":2, \"price\":\"3929.97\", \"contract\":\"1\", \"order_from\":1, \"leverage\":50, \"cross_leverage\":25, \"order_side\":1, \"client_oid\": '123456789', } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { result: '17592186044786', // order id client_oid: '123456789', // client order id cmd: 'order/open', } make bulk contract orders POST https://api.bibox.com/v1.1/ctrade cmd: order/openBatch Request parameter Parameter Name Necessary or not Type Description Default Value Range leverage true integer leverage cross margin:0, fixed margin:1,2,... cross_leverage false integer cross leverage 25 when leverage=0 and cross_leverage=1,2,...50 order_side true integer position side 1:long, 2:short price true string order price The numbers greater than 0 contract true string Cont 1,2, ... pair true string Contract symbol 4BTC_USDT,4ETH_USDT, ... client_oid false Long client order id > 0 example Request parameter // Request { \"cmd\":\"order/openBatch\", \"body\":{ \"pair\":\"4ETH_USDT\", \"leverage\":50, \"cross_leverage\": 25, \"arr\":[ { \"order_side\":1, \"price\":140, \"contract\":1, \"client_oid\": '123456787' }, { \"order_side\":1, \"price\":140.5, \"contract\":1, \"client_oid\": '123456788' } ] } } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/openBatch\\\",\\\"body\\\":{\\\"pair\\\":\\\"4ETH_USDT\\\",\\\"leverage\\\":50,\\\"cross_leverage\\\":25,\\\"arr\\\":[{\\\"order_side\\\":1,\\\"price\\\":140,\\\"contract\\\":1,\\\"client_oid\\\":\\\"123456787\\\"},{\\\"order_side\\\":1,\\\"price\\\":140.5,\\\"contract\\\":1,\\\"client_oid\\\":\\\"123456788\\\"}]}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"cb3eee178b4f6442026d324760f9b9cd\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/openBatch\", \"body\":{ \"pair\":\"4ETH_USDT\", \"leverage\":50, \"cross_leverage\": 25, \"arr\":[ { \"order_side\":1, \"price\":140, \"contract\":1, \"client_oid\": '123456787' }, { \"order_side\":1, \"price\":140.5, \"contract\":1, \"client_oid\": '123456788' } ] } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { code: 0, // 0 means success;non-zero means failure, code is error code id: '17592186044787', // order id msg: '', client_oid: '123456787' }, { code: 0, id: '17592186044790', msg: '', client_oid: '123456788' } ], \"cmd\":\"order/openBatch\" } cancel contract order POST https://api.bibox.com/v1.1/ctrade cmd: order/close Request parameter Parameter Name Necessary or not Type Description Default Value Range order_id true string order id example Request parameter // Request { \"cmd\":\"order/close\", \"body\":{ \"order_id\":\"574954\" } } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/close\\\",\\\"body\\\":{\\\"order_id\\\":\\\"574954\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"9a9286632189e3c2d6581cb81e38349b\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/close\", \"body\":{ \"order_id\":\"574954\" } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":\"success\", \"cmd\":\"order/close\" } cancel multiple orders POST https://api.bibox.com/v1.1/ctrade cmd: order/closeBatch Request parameter Parameter Name Necessary or not Type Description Default Value Range order_ids true string order id array example Request parameter // Request { \"cmd\":\"order/closeBatch\", \"body\":{ \"order_ids\":[ \"574953\", \"574954\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/closeBatch\\\",\\\"body\\\":{\\\"order_ids\\\":[\\\"574953\\\",\\\"574954\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"64449ef8dc5016a6230ce4a8f0f18eb1\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/closeBatch\", \"body\":{ \"order_ids\":[ \"574953\", \"574954\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":\"success\", \"cmd\":\"order/closeBatch\", \"index\":13 } cancel 1000 orders POST https://api.bibox.com/v1.1/ctrade cmd: order/closeAll example Request parameter // Request { \"cmd\":\"order/closeAll\", \"body\":{ }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/closeAll\\\",\\\"body\\\":{},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"d0ab49a6de0aa0254baa8445582b42c2\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/closeAll\", \"body\":{ }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":\"success\", \"cmd\":\"order/closeAll\", \"index\":13 } cancel multiple orders through client order id POST https://api.bibox.com/v1.1/ctrade cmd: order/closeBatchClientOid Request parameter Parameter Name Necessary or not Type Description Default Value Range clientIds true string array client oid limit 50 example Request parameter // Request { \"cmd\":\"order/closeBatchClientOid\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/closeBatchClientOid\\\",\\\"body\\\":{\\\"clientIds\\\":[\\\"1588819328619\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3172e38a62698ffc4f73223c6a0b22d3\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/closeBatchClientOid\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":\"success\", \"cmd\":\"order/closeBatchClientOid\" } adjust contract leverage POST https://api.bibox.com/v1.1/ctrade cmd: order/changeLeverage Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true string Contract symbol 4BTC_USDT,4ETH_USDT, ... leverage true integer leverage cross margin:0, fixed margin:1,2,... cross true integer cross flag cross: 1, fixed: 0 example Request parameter // Request { \"cmd\":\"order/changeLeverage\", \"body\":{ \"pair\":\"4BTC_USDT\", \"leverage\":40, \"cross\": 0 }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/changeLeverage\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\",\\\"leverage\\\":40,\\\"cross\\\":0},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"1abd620b3cc04be7e181309d5c83670e\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/changeLeverage\", \"body\":{ \"pair\":\"4BTC_USDT\", \"leverage\":40, \"cross\": 0 }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":\"success\", \"cmd\":\"order/changeLeverage\", \"index\":13 } adjust contract margin POST https://api.bibox.com/v1.1/ctrade cmd: order/changeMargin Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true string Contract symbol 4BTC_USDT,4ETH_USDT, ... margin true integer increase or reduce margin increase: margin>=0.5; reduce: margin example Request parameter // Request { \"cmd\":\"order/changeMargin\", \"body\":{ \"pair\": \"4ETH_USDT\", \"margin\": 4 }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"order/changeMargin\\\",\\\"body\\\":{\\\"pair\\\":\\\"4ETH_USDT\\\",\\\"margin\\\":4},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"f6ef54d12ccadaef85782a7a238413f6\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"order/changeMargin\", \"body\":{ \"pair\": \"4ETH_USDT\", \"margin\": 4 }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":\"success\", \"cmd\":\"order/changeMargin\", \"index\":13 } transfer funds from master account to contract account POST https://api.bibox.com/v1.1/ctrade cmd: transfer/in Request parameter Parameter Name Necessary or not Type Description Default Value Range amount true integer amount example Request parameter // Request { \"cmd\":\"transfer/in\", \"body\":{ \"amount\":\"100\" } } { \"url\":\"https://api.bibox.com/v1.1/ctrade\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/in\\\",\\\"body\\\":{\\\"amount\\\":\\\"100\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"16c40525ae36ae0f55fe5237c91336cd\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/ctrade\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"transfer/in\", \"body\":{ \"amount\":\"100\" } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":\"success\", \"cmd\":\"transfer/in\" } check transaction records in the market GET https://api.bibox.com/v1.1/cquery?cmd=deals&&pair=4ETH_USDT&&size=10 Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true String Contract symbol 4BTC_USDT,4ETH_USDT,... size true integer number 1,2,... The description of return result { \"result\":[ { \"pair\":\"4BTC_USDT\", // contract symbol \"order_side\":1, // 1long, 2short \"contract\":52, // number of orders \"price\":\"3601.1600\", // transaction price \"createdAt\":1550977541000 // transaction time }, ... ], \"cmd\":\"deals\" } check orders through order id POST https://api.bibox.com/v1.1/cquery cmd: query/orderPendingByIDs Request parameter Parameter Name Necessary or not Type Description Default Value Range ids true string array order id limit 50 example Request parameter // Request { \"cmd\":\"query/orderPendingByIDs\", \"body\":{ \"ids\":[ \"491168\", \"2\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderPendingByIDs\\\",\\\"body\\\":{\\\"ids\\\":[\\\"491168\\\",\\\"2\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3172e38a62698ffc4f73223c6a0b22d3\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderPendingByIDs\", \"body\":{ \"ids\":[ \"491168\", \"2\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"id\":491168, // order id \"coin_symbol\":\"USDT\", \"pair\":\"4ETH_USDT\", // Contract symbol \"order_side\":1, // 1long, 2short \"order_type\":2, \"contract\":3, // contract \"order_from\":1, \"status\":1, // 0,1:uncompleted; 2:partly completed; 3:completed; 4: partly cancel; 5 cancel completed; 6,7 system cancel; >=100 order fail \"price\":\"136.0000\", // order price \"price_deal\":\"0.0000\", // average transaction price \"deal_count\":0, \"contract_deal\":0, // number of completed orders \"createdAt\":\"2019-02-20T02:01:46.000Z\", \"updatedAt\":\"2019-02-20T02:01:46.000Z\" }, { \"id\":2, \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", \"order_side\":1, \"order_type\":2, \"contract\":1, \"order_from\":1, \"status\":3, \"price\":\"3622.0000\", \"price_deal\":\"3622.0000\", \"deal_count\":1, \"contract_deal\":1, \"createdAt\":\"2019-02-15T13:10:27.000Z\", \"updatedAt\":\"2019-02-15T13:10:45.000Z\" } ], \"cmd\":\"query/orderPendingByIDs\", \"index\":13 } check uncompleted orders through client order id POST https://api.bibox.com/v1.1/cquery cmd: query/ordersDetailByClientIds 请求参数 参数名称 是否必须 类型 描述 默认值 取值范围 clientIds true string array client_oid limit 50 示例 POST https://api.bibox.com/v1.1/cquery cmd: query/ordersDetailByClientIds Request parameter Parameter Name Necessary or not Type Description Default Value Range clientIds true string array client oid limit 50 example Request parameter // Request { \"cmd\":\"query/ordersDetailByClientIds\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/ordersDetailByClientIds\\\",\\\"body\\\":{\\\"clientIds\\\":[\\\"1588819328619\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3172e38a62698ffc4f73223c6a0b22d3\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/ordersDetailByClientIds\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //格式化param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//签名cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"id\": \"71468256443234\", \"user_id\": 101051, \"client_oid\": \"1588819328619\", \"pair\": \"4BTC_USDT\", \"coin_symbol\": \"4BTC\", \"price\": \"9486.0000\", \"price_deal\": \"9485.9900\", \"contract\": \"15\", \"contract_deal\": \"4\", \"deal_count\": \"1\", \"order_side\": 1, \"order_type\": 2, \"order_from\": 6, \"status\": 2, \"reason\": 0, \"createdAt\": 1588819336186, \"updatedAt\": 1588819336186 }, ], \"cmd\":\"query/ordersDetailByClientIds\", \"index\":13 } check orders through client order id POST https://api.bibox.com/v1.1/cquery cmd: query/orderPendingByClientIds 请求参数 参数名称 是否必须 类型 描述 默认值 取值范围 clientIds true string array client_oid limit 50 示例 POST https://api.bibox.com/v1.1/cquery cmd: query/orderPendingByClientIds Request parameter Parameter Name Necessary or not Type Description Default Value Range clientIds true string array client oid limit 50 example Request parameter // Request { \"cmd\":\"query/orderPendingByClientIds\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } { \"url\":\"https://api.bibox.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderPendingByClientIds\\\",\\\"body\\\":{\\\"clientIds\\\":[\\\"1588819328619\\\"]},\\\"index\\\":13}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3172e38a62698ffc4f73223c6a0b22d3\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderPendingByClientIds\", \"body\":{ \"clientIds\":[ \"1588819328619\" ] }, \"index\":13 } ]; let form = { \"cmds\": JSON.stringify(param), //格式化param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//签名cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"id\": 71468256443234, \"client_oid\": \"1588819328619\", \"coin_symbol\": \"USDT\", \"pair\": \"4BTC_USDT\", \"order_side\": 1, \"order_type\": 2, \"contract\": 15, \"order_from\": 6, \"status\": 3, \"price\": \"9486.0000\", \"price_deal\": \"9485.9973\", \"deal_count\": 2, \"contract_deal\": 15, \"createdAt\": \"2020-05-07T02:42:16.000Z\", \"updatedAt\": \"2020-05-07T03:02:24.000Z\" }, ], \"cmd\":\"query/orderPendingByClientIds\", \"index\":13 } check personal position changed record POST https://api.bibox.com/v1.1/cquery cmd: query/orderList Request parameter Parameter Name Necessary or not Type Description Default Value Range pair true String contract symbol 1,2,... page true integer page 1,2,... size true integer number 1,2,... begin_time false integer starting time end_time false integer ending time type false integer transaction type 1open position, 2liquidation, 3forced liquidation, 4cover position example Request parameter // Request { \"cmd\":\"query/orderList\", \"body\":{ \"pair\":\"4BTC_USDT\", \"page\":1, \"size\":100, \"begin_time\":1550971541000, \"end_time\":1550977541000, type: 2, } } { \"url\":\"https://api.bibox.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderList\\\",\\\"body\\\":{\\\"pair\\\":\\\"4BTC_USDT\\\",\\\"page\\\":1,\\\"size\\\":100,\\\"begin_time\\\":1550971541000,\\\"end_time\\\":1550977541000,\\\"type\\\":2}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"2517280ee4d332c3b63d4ee34fa5bb06\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderList\", \"body\":{ \"pair\":\"4BTC_USDT\", \"page\":1, \"size\":100, \"begin_time\":1550971541000, \"end_time\":1550977541000, type: 2, } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":{ \"count\":101, \"page\":1, \"items\":[ { \"id\":236343, \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // contract symbol \"type\":2, // 1open position, 2liquidation, 3forced liquidation, 4cover position \"order_side\":2, // 1long, 2short \"price_open\":\"3999.0000\", // order pirce \"price\":\"3964.5800\", // average price of opening position \"price_deal\":\"3999.0000\", // transaction price \"contract\":2, // number of Cont \"profit\":\"0.6884\", // profits and losses \"fee\":\"0.0000\", // transaction fee \"createdAt\":\"2019-02-23T17:07:31.000Z\" }, ... ] }, \"cmd\":\"query/orderList\" } query order detail POST https://api.bibox.com/v1.1/cquery cmd: query/orderDetailByID Request parameter Parameter Name Necessary or not Type Description Default Value Range id true String order id example Request parameter // Request { \"cmd\":\"query/orderDetailByID\", \"body\":{ \"id\":\"58\", // order id } } { \"url\":\"https://api.bibox.com/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"query/orderDetailByID\\\",\\\"body\\\":{\\\"id\\\":\\\"58\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"2a5c0bdaea46ddf4efa809bd92e0181a\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v1.1/cquery\"; let apikey = \"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\"; //your apikey let secret = \"1e01c22ff8c59e9d98d93423817303f098d93423\"; //your apikey secret let param = [ { \"cmd\":\"query/orderDetailByID\", \"body\":{ \"id\":\"58\", // order id } } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":{ \"items\":[ { \"id\":42, // order detail id \"coin_symbol\":\"USDT\", // \"pair\":\"4BTC_USDT\", // Contract symbol \"order_side\":1, // 1 long, 2short \"contract\":1, // contract \"order_from\":1, // 1web,2android,3ios, 6 apikey, \"createdAt\":\"2019-08-13T08:22:25.000Z\", // create time \"updatedAt\":\"2019-08-13T08:22:26.000Z\", \"price\":\"7029.9700\", // price \"price_deal\":\"0.0000\", // deal price \"fee\":\"0.0000\", // fee \"is_cancel\":1, // 0 normal 1: canceld order \"is_maker\":1, // 0: taker; 1: maker; \"order_type\":2 // 1:market price 2:limited price } ], \"count\":9, \"page\":1 }, \"cmd\":\"query/orderDetailByID\" } query contract value (apikey not required) GET https://api.bibox.com/v1.1/cquery?cmd=contractValue The description of return result { \"result\":[ { \"pair\":\"4BTC_USDT\", \"value\":\"0.0100000000\", \"coin_symbol\":\"BTC\" }, ], \"cmd\":\"contractValue\" } query contract leverage info (apikey not required) GET https://api.bibox.com/v1.1/cquery?cmd=contractConfig The description of return result { \"result\":{ \"cross_leverage\":25, // cross leverage \"leverage_max\":50, // max leverage \"margin_rate_force\":\"0.01\", // margin rate force \"night_fee_rate\":\"0.0006\", // night fee rate \"hold_limit\":{ // hold limit amount \"BTC\":5000, \"ETH\":150000, \"EOS\":50000, \"LTC\":35000, \"BCH\":100000 } }, \"cmd\":\"contractConfig\" } query contract open limit once (apikey not required) GET https://api.bibox.com/v1.1/cquery?cmd=openLimit The description of return result { \"result\":{ \"BTC\":5000, \"ETH\":75000, \"EOS\":75000, \"LTC\":15000, \"BCH\":15000 }, \"cmd\":\"openLimit\" } query current funding rate (apikey not required) GET https://api.bibox.com/v1.1/cquery?cmd=lastPremiumIndex The description of return result { \"result\":{ \"4BTC_USDT\":{ \"id\":164391, \"pair\":\"4BTC_USDT\", \"close\":\"0.0007000000\", \"fund_rate_up\":\"0.0005000000\", \"fund_rate_down\":\"-0.0005000000\", \"createdAt\":\"2020-02-27T00:00:00.000Z\", \"updatedAt\":\"2020-02-27T00:00:00.000Z\" }, ... }, \"cmd\":\"lastPremiumIndex\" } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2020-10-30 "},"rest_api_bc.html":{"url":"rest_api_bc.html","title":"Restful API Coin-based contract","keywords":"","body":"Restful API Coin-based contract View Kline GET https://api.bibox.com/v2/mdata?cmd=kline&pair=5BTC_USD&period=1min&size=10 Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 5BTC_USD, 5ETH_USD, ... period true string Kline period '1min', '3min', '5min', '15min', '30min', '1hour', '2hour', '4hour', '6hour', '12hour', 'day', 'week' size false integer how many 1000 1-1000 example // Response { \"result\":[ { \"time\":1602680580000,// Timestamp \"open\":\"10666.00000000\",// Opening Price \"high\":\"10666.00000000\",// The highest price \"low\":\"10666.00000000\", // The lowest price \"close\":\"10666.00000000\",// Closing Price \"vol\":\"0.00000000\"// Trading Volume }, ... ], \"cmd\":\"kline\", \"ver\":\"2.0\" } View the contract depth of the market GET https://api.bibox.com/v2/mdata?cmd=depth&pair=5BTC_USD&size=10 POST https://api.bibox.com/v1/mdata cmd: api/depth Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 4BTC_USDT, 4ETH_USDT, ... size false integer how many 200 1-200 example // Response { \"result\":{ \"pair\":\"5BTC_USD\", \"update_time\":1602669350668, \"asks\":[//The depth of sellers ], \"bids\":[//The depth of buyers { \"volume\":\"54054\",//The price of pending orders \"price\":\"10666\"//The price of pending order }, ... ] }, \"cmd\":\"depth\", \"ver\":\"2.0\" } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2020-10-30 "},"rest_api_bc_v1_1.html":{"url":"rest_api_bc_v1_1.html","title":"Restful API Coin-based contract V1.1","keywords":"","body":"Restful API Coin-based contract V1.1 Description v1.1 streamlines the returned results of v1. Requirements: The cmds in the parameter contains only one cmd. Query position change records POST https://api.bibox.com/v1.1/cquery cmd:bc/dealLog Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 5BTC_USD,5ETH_USD, ... page true integer page number 1,2, ... size true integer how many 10,20, ... example Request parameter // Request [ { \"cmd\":\"bc/dealLog\", \"body\":{ \"pair\":\"5BTC_USD\", \"page\":1, \"size\":10 }, \"index\":1 } ] { \"url\":\"http://tapi.bibox365aa.com:33050/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"bc/dealLog\\\",\\\"body\\\":{\\\"pair\\\":\\\"5BTC_USD\\\",\\\"page\\\":1,\\\"size\\\":10},\\\"index\\\":1}]\", \"apikey\":\"900625568558820892a8c833c33ebc8fd2701efe\", \"sign\":\"4429dee1480d6b046a087b10b751143b\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"http://tapi.bibox365aa.com:33050/v1.1/cquery\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = [ { \"cmd\":\"bc/dealLog\", \"body\":{ \"pair\": \"5BTC_USD\", \"page\": 1, \"size\": 10, }, \"index\":1 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify(param)) console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":{ \"count\":3, \"page\":1, \"items\":[ { \"id\":\"1125899906842635654\", // Position change id \"user_id\":100006, // user id \"coin_symbol\":\"BTC\",// coin symbol \"pair\":\"5BTC_USD\",// pair \"side\":1,// position side, 1long,2short \"model\":1,// position model,1cross,2fixed \"log_type\":1,// change type 1 open a position, 2 close a position, 3 lighten a position to reduce the risk level, 4 liquidate a position, 5ADL \"hold_coin_dx\":\"1.0000000000\",// position change amount \"hold_coin\":\"1.0000000000\",// Position holding \"price_log\":\"11692.0000000000\",// proposed price \"price_open\":\"11692.0000000000\",// open price \"profit\":\"0.0000000000\",// profit \"fee\":\"0.0000000599\",// fee \"fee_bix\":\"0.0000000000\",// bix Deduction \"fee_bix0\":\"0.0000000000\", // Coupon deduction \"createdAt\":\"2020-10-14T03:00:08.000Z\",// time \"updatedAt\":\"2020-10-14T03:00:08.000Z\" }, ... ] }, \"cmd\":\"bc/dealLog\", \"index\":1 } Query order transaction details POST https://api.bibox.com/v1.1/cquery cmd:bc/orderDetail Request parameter Name Necessary or not Type Description Default Value Range orderId true long order id page true integer page number 1,2, ... size true integer how many 10,20, ... example Request parameter // Request [ { \"cmd\":\"bc/orderDetail\", \"body\":{ \"orderId\":\"421112953438213\", \"page\":1, \"size\":10 }, \"index\":1 } ] { \"url\":\"http://tapi.bibox365aa.com:33050/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"bc/orderDetail\\\",\\\"body\\\":{\\\"orderId\\\":\\\"421112953438213\\\",\\\"page\\\":1,\\\"size\\\":10},\\\"index\\\":1}]\", \"apikey\":\"900625568558820892a8c833c33ebc8fd2701efe\", \"sign\":\"a8741a05515df4be5ce75a2776790a0c\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"http://tapi.bibox365aa.com:33050/v1.1/cquery\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = [ { \"cmd\":\"bc/orderDetail\", \"body\":{ \"orderId\": \"421112953438213\", \"page\": 1, \"size\": 10, }, \"index\":1 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify(param)) console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":{ \"count\":1, \"page\":1, \"items\":[ { \"id\":\"1125899906842635651\",// details id \"coin_symbol\":\"BTC\",// coin symbol \"pair\":\"5BTC_USD\",// pair \"side\":2,// order side 1open long,2open short,3close long,4close short \"order_from\":4,// order from \"price\":\"10692.0000000000\",// target price \"deal_price\":\"11510.0000000000\",// deal price \"deal_coin\":\"1.0000000000\",// deal amount \"fee\":\"0.0000000608\",// fee \"fee_bix\":\"0.0000000000\",// bix deduction \"fee_bix0\":\"0.0000000000\",// Coupon deduction \"is_maker\":0,// is maker \"createdAt\":\"2020-10-14T02:58:59.000Z\"// time } ] }, \"cmd\":\"bc/orderDetail\", \"index\":1 } Query historical orders POST https://api.bibox.com/v1.1/cquery cmd:bc/orderHistory Request parameter Name Necessary or not Type Description Default Value Range pair false string pair 5BTC_USD,5ETH_USD, ... page true integer page number 1,2, ... size true integer how many 10,20, ... side false integer order side 1open long,2open short,3close long,4close short status false array status,3: Full transaction, 4: Partial order cancellation, 5: Full order cancellation, 100: Order failed example Request parameter // Request [ { \"cmd\":\"bc/orderHistory\", \"body\":{ \"page\":1, \"size\":10, \"pair\":\"5BTC_USD\", \"side\":1, \"status\":[ 3, 4, 5, 100 ] }, \"index\":1 } ] { \"url\":\"http://tapi.bibox365aa.com:33050/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"bc/orderHistory\\\",\\\"body\\\":{\\\"page\\\":1,\\\"size\\\":10,\\\"pair\\\":\\\"5BTC_USD\\\",\\\"side\\\":1,\\\"status\\\":[3,4,5,100]},\\\"index\\\":1}]\", \"apikey\":\"900625568558820892a8c833c33ebc8fd2701efe\", \"sign\":\"e5da11a7b038b1ad546243706aa75ecc\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"http://tapi.bibox365aa.com:33050/v1.1/cquery\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = [ { \"cmd\":\"bc/orderHistory\", \"body\":{ \"page\": 1, \"size\": 10, \"pair\": \"5BTC_USD\", \"side\": 1, \"status\": [3, 4, 5, 100], }, \"index\":1 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify(param)) console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":{ \"count\":1, \"page\":1, \"items\":[ { \"id\":421112953438215,// order id \"user_id\":100006,// user id \"coin_symbol\":\"BTC\",// coin symbol \"pair\":\"5BTC_USD\",// pair \"side\":1,// order side \"order_type\":2,// order type 1market order,2limit order \"price\":\"11692.0000000000\",// target price \"amount_coin\":\"1.0000000000\",// Number of pending orders \"freeze\":\"0.0000000000\",// Frozen funds \"price_deal\":\"11692.0000000000\",// Average transaction price \"deal_coin\":\"1.0000000000\",// deal amount \"deal_num\":1,// deal number \"fee\":\"0.0000000599\",// fee \"fee_bix\":\"0.0000000000\",// bix deduction \"fee_bix0\":\"0.0000000000\",// Coupon deduction \"status\":3,// order status,1 uncompleted, 2 partially completed, 3 completely completed, 4 partially cancelled, 5 completely cancelled, 100 failed to place an order \"reason\":0,// failed reason \"fee_rate_maker\":\"0.0007000000\",// maker fee rate \"fee_rate_taker\":\"0.0007000000\",// taker fee rate \"client_oid\":1602644402806,// client order id \"order_from\":4, // ignore \"createdAt\":\"2020-10-14T03:00:08.000Z\",// created time \"updatedAt\":\"2020-10-14T03:00:08.000Z\"// updated time } ] }, \"cmd\":\"bc/orderHistory\", \"index\":1 } checking order POST https://api.bibox.com/v1.1/cquery cmd:bc/orderById Request parameter Name Necessary or not Type Description Default Value Range orderIds true array array of order id clientOids true array array of client order id example Request parameter // Request [ { \"cmd\":\"bc/orderById\", \"body\":{ \"orderIds\":[ \"421112953438213\", \"421112953438214\" ], \"clientOids\":[ \"1602644402806\", \"1602644402811\" ] }, \"index\":1 } ] { \"url\":\"http://tapi.bibox365aa.com:33050/v1.1/cquery\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"bc/orderById\\\",\\\"body\\\":{\\\"orderIds\\\":[\\\"421112953438213\\\",\\\"421112953438214\\\"],\\\"clientOids\\\":[\\\"1602644402806\\\",\\\"1602644402811\\\"]},\\\"index\\\":1}]\", \"apikey\":\"900625568558820892a8c833c33ebc8fd2701efe\", \"sign\":\"8a83452af336b6cf14a0c0090da96912\" } } example code let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"http://tapi.bibox365aa.com:33050/v1.1/cquery\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = [ { \"cmd\":\"bc/orderById\", \"body\":{ \"orderIds\": [\"421112953438213\", \"421112953438214\"], \"clientOids\": [\"1602644402806\", \"1602644402811\"], }, \"index\":1 } ]; let form = { \"cmds\": JSON.stringify(param), //format param \"apikey\": apikey, \"sign\": \"\" }; let sign = CryptoJS.HmacMD5(form.cmds, secret).toString();//sign cmds form.sign = sign; console.log(JSON.stringify(param)) console.log(JSON.stringify({url, form})) request.post({url, form }, (error, response, body) => { if (!error && response && response.statusCode === 200) { try { console.log(body) } catch (error) { console.log(error) } } else { console.log(error, response, body); } }); Response // Response { \"result\":[ { \"id\":421112953438214,// order id \"user_id\":100006,// user id \"coin_symbol\":\"BTC\",// coin symbol \"pair\":\"5BTC_USD\",// pair \"side\":1,// order side 1open long,2open short,3close long,4close short \"order_type\":2,// order type 1market order,2limit order \"price\":\"11692.0000000000\",// target price \"amount_coin\":\"1.0000000000\",// Number of pending orders \"freeze\":\"0.0000000000\",// Frozen funds \"price_deal\":\"11692.0000000000\",// Average transaction price \"deal_coin\":\"1.0000000000\",// deal amount \"deal_num\":1,// deal number \"fee\":\"0.0000000599\",// fee \"fee_bix\":\"0.0000000000\",// bix deduction \"fee_bix0\":\"0.0000000000\",// Coupon deduction \"status\":3,// order status,1 uncompleted, 2 partially completed, 3 completely completed, 4 partially cancelled, 5 completely cancelled, 100 failed to place an order \"reason\":0,// failed reason \"fee_rate_maker\":\"0.0007000000\",// maker fee rate \"fee_rate_taker\":\"0.0007000000\",// taker fee rate \"client_oid\":1602644402806,// client order id \"order_from\":4, // ignore \"createdAt\":\"2020-10-14T03:00:08.000Z\",// created time \"updatedAt\":\"2020-10-14T03:00:08.000Z\"// updated time }, ... ], \"cmd\":\"bc/orderById\", \"index\":1 } Query funding rate GET https://api.bibox.com/v1.1/cquery?cmd=bcFundRate Response { \"result\":{ \"5BTC_USD\":{ \"pair\":\"5BTC_USD\", // pair \"close\":\"0.0000000000\", // ignore \"fund_rate\":\"0.0001000000\", // funding rate \"createdAt\":\"2020-10-14T00:00:00.000Z\" // time }, \"5ETH_USD\":{ \"pair\":\"5ETH_USD\", \"close\":\"0.0000000000\", \"fund_rate\":\"0.0001000000\", \"createdAt\":\"2020-10-14T00:00:00.000Z\" } }, \"cmd\":\"bcFundRate\" } Query mark price GET https://api.bibox.com/v1.1/cquery?cmd=bcTagPrice Response { \"result\":{ \"5BTC_USD\":{//pair \"close\":\"11453.7224909000\",// index price \"priceTag\":\"11454.2951770245\",// mark price \"createdAt\":\"2020-10-14T03:41:08.000Z\" // time }, \"5ETH_USD\":{ \"close\":\"383.1999999600\", \"priceTag\":\"383.2191599600\", \"createdAt\":\"2020-10-14T03:41:08.000Z\" } }, \"cmd\":\"bcTagPrice\" } Query basic contract information GET https://api.bibox.com/v1.1/cquery?cmd=bcValue Response { \"result\":[ { \"id\":465, // ignore \"pair\":\"5BTC_USD\",//pair \"coin_symbol\":\"BTC\", // ignore \"leverage_init\":\"10.0000000000\", // ignore \"leverage_min\":\"0.0100000000\",//Minimum leverage \"leverage_max\":\"100.0000000000\",//Maximum leverage \"value\":\"1.0000000000\",//Contract value \"risk_level_base\":\"1000000.0000000000\",//ignore \"risk_level_dx\":\"50000.0000000000\",//ignore \"maker_fee\":\"0.0006000000\",//Default maker fee rate \"taker_fee\":\"0.0006000000\",//Default taker fee rate \"open_max_per\":\"10000000.0000000000\",//Maximum number of single pending orders \"pending_max\":100,//Maximum number of pending order \"hold_max\":\"100000000.0000000000\",//Maximum position value \"price_precision\":1 // ignore }, { \"id\":466, \"pair\":\"5ETH_USD\", \"coin_symbol\":\"ETH\", \"leverage_init\":\"10.0000000000\", \"leverage_min\":\"0.0100000000\", \"leverage_max\":\"100.0000000000\", \"value\":\"1.0000000000\", \"risk_level_base\":\"10000.0000000000\", \"risk_level_dx\":\"5000.0000000000\", \"maker_fee\":\"0.0006000000\", \"taker_fee\":\"0.0006000000\", \"open_max_per\":\"10000000.0000000000\", \"pending_max\":100, \"hold_max\":\"100000000.0000000000\", \"price_precision\":2 } ], \"cmd\":\"bcValue\" } Query accuracy configuration GET https://api.bibox.com/v1.1/cquery?cmd=bcUnit Response { \"result\":[ { \"pair\":\"5BTC_USD\",//pair \"price_unit\":1,//Decimal points for order \"vol_unit\":6, // ignore \"value_unit\":0 // ignore }, { \"pair\":\"5ETH_USD\", \"price_unit\":1, \"vol_unit\":6, \"value_unit\":0 } ], \"cmd\":\"bcUnit\" } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2020-10-30 "},"rest_api_bc_v3.html":{"url":"rest_api_bc_v3.html","title":"Restful API Coin-based contract V3","keywords":"","body":"Restful API Coin-based contract V3 Signature and return format All are post requests, and the request data is directly placed in httpbody 'content-type': 'application/json', The apikey and signature are placed in httpheader 'bibox-api-key': apikey 'bibox-api-sign': sign Add a timestamp to the httpheader to indicate the timestamp of the request sent, expressed in milliseconds, to limit the time of the request 'bibox-timestamp': timestamp Return value, each response contains state, 0 means success, other error codes, means failure example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/assets/transfer/cbc\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"amount\":\"0.01\", \"symbol\":\"BTC\", \"type\":0 }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Fund transfer POST https://api.bibox.com/v3/assets/transfer/cbc Request parameter Name Necessary or not Type Description Default Value Range amount true string string of amount symbol true string coin symbol BTC,ETH, ... type true integer 0 transfer in, 1 transfer out 0,1 example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/assets/transfer/cbc\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"amount\":\"0.01\", \"symbol\":\"BTC\", \"type\":0 }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, // success \"result\":\"352559634189422592\" // ignore } { \"state\":3016, // failed \"msg\":\"交易对错误\" } Place an order POST https://api.bibox.com/v3/cbc/order/open Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 5BTC_USD,5ETH_USD, ... amount true string Number to string order_side true integer order side,1 open long, 2 open short, 3 close long, 4 close short 1,2,3,4 order_type true integer order type,1 market order, 2 limit order 1,2 price true string target price order_from true integer order from 6 client_oid false string client order id example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/order/open\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"pair\":\"5BTC_USD\", \"order_side\":1, \"order_type\":2, \"price\":\"11500\", \"amount\":1, \"order_from\":6, \"client_oid\": \"1234567890\", }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, \"order_id\":\"425510999949316\", // order id \"client_oid\":\"1234567890\", // client order id \"status\":1, // order status,1 uncompleted, 2 partially completed, 3 completely completed, 4 partially cancelled, 5 completely cancelled, 100 failed to place an order \"cmd\":\"open\" // ignore } Cancel order POST https://api.bibox.com/v3/cbc/order/close Request parameter Name Necessary or not Type Description Default Value Range order_id true string order id example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/order/close\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"order_id\":\"425510999949316\" }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, // success \"result\":\"success\", \"cmd\":\"close\" } Batch cancellation POST https://api.bibox.com/v3/cbc/order/closeBatch Request parameter Name Necessary or not Type Description Default Value Range order_ids true array array of order id example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/order/closeBatch\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"order_ids\":[\"2234567890\",\"2234567891\"] }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0,// success \"result\":\"success\", \"cmd\":\"close\" } Cancel all orders POST https://api.bibox.com/v3/cbc/order/closeAll Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 5BTC_USD,5ETH_USD, ... example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/order/closeAll\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"pair\":\"5BTC_USD\" }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0,// success \"result\":\"success\", \"cmd\":\"closeAll\" } Adjust margin on a fixed position POST https://api.bibox.com/v3/cbc/changeMargin Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 5BTC_USD,5ETH_USD, ... margin true string margin side true integer position side, 1 long side, 2 short side 1,2 example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/changeMargin\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"pair\":\"5BTC_USD\", \"margin\":\"0.01\", \"side\":1 }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":3103, // failed \"msg\":\"没有持仓不支持该操作\", \"cmd\":\"changeMargin\" } Adjust position mode and leverage POST https://api.bibox.com/v3/cbc/changeMode Request parameter Name Necessary or not Type Description Default Value Range pair true string pair 5BTC_USD,5ETH_USD, ... mode true integer position mode, 1 cross, 2 fi 1,2 leverage_long true integer Long leverage 1~100 leverage_short true integer Short leverage 1~100 example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/changeMode\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"pair\":\"5BTC_USD\", \"mode\":2, \"leverage_long\":10, \"leverage_short\":20 }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, \"result\":\"success\", \"cmd\":\"changeMode\" } Query assets POST https://api.bibox.com/v3/cbc/assets Request parameter Name Necessary or not Type Description Default Value Range coin false string coin symbol BTC,ETH,... example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/assets\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { // \"coin\":\"BTC\", }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, \"result\":[ { \"b\":\"1\", // Available Balance \"c\":\"BTC\", // coin symbol \"u\":100006, // user id \"f\":\"0\", // Frozen funds \"m\":\"0\" // Margin }, { \"b\":\"1\", \"c\":\"ETH\", \"u\":100006, \"f\":\"0\", \"m\":\"0\" } ], \"cmd\":\"assets\" } Query position POST https://api.bibox.com/v3/cbc/position Request parameter Name Necessary or not Type Description Default Value Range pair false string pair 5BTC_USD,5ETH_USD, ... side false integer position side, 1 long side, 2 short side 1,2 example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/position\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { // \"pair\":\"5BTC_USD\", // \"side\":1 }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, \"result\":[ { \"pt\":\"0\",//ignore \"f\":\"0\",//ignore \"l\":\"10\", // leverage \"sd\":1, // position side, 1 long, 2 short \"pa\":\"0\", //Alert price \"ui\":100006,//user id \"fb0\":\"0\",//ignore \"pf\":\"0\",//Liquidation price \"md\":2,// position mode, 1 cross, 2 fixed \"lc\":\"0\",// Closable position price \"pi\":\"5BTC_USD\", // pair \"mg\":\"0\", //margin \"hc\":\"0\",// Position value \"fb\":\"0\",//ignore \"po\":\"0\" //Opening price }, ... ], \"cmd\":\"position\" } Query order list POST https://api.bibox.com/v3/cbc/order/list Request parameter Name Necessary or not Type Description Default Value Range pair false string pair 5BTC_USD,5ETH_USD, ... order_side true integer order side,1 open long, 2 open short, 3 close long, 4 close short 1,2,3,4 example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/order/list\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { // \"pair\":\"5BTC_USD\", // \"order_side\":1 }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, \"result\":{ \"p\":1, \"t\":1, \"o\":[ { \"f\":\"0\", //fee \"dp\":\"0\", //deal price \"eq\":\"0\", //deal amount \"p\":\"11092\", //target price \"tif\":0, // ignore \"q\":\"1\", //Order quantity \"sd\":1, //order side \"r\":0, //reason \"s\":1, // status \"t\":1602679944815, //time \"ui\":100006, //user id \"fz\":\"0.0000091417\", //Frozen funds \"fb0\":\"0\", //Coupon deduction \"of\":4, //order from \"pi\":\"5BTC_USD\", //pair \"oi\":\"426610511577093\", // order id \"coi\":\"1602679943911\", //clientoid \"fb\":\"0\", //bix deduction \"po\":false //ignore }, ... ] }, \"cmd\":\"orderList\" } Checking order POST https://api.bibox.com/v3/cbc/order/detail Request parameter Name Necessary or not Type Description Default Value Range order_id true string order id example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/order/detail\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"order_id\":\"426610511577093\", }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, \"result\":{ \"f\":\"0\", //fee \"dp\":\"0\", //deal price \"eq\":\"0\", //deal amount \"p\":\"11092\", //target price \"tif\":0, // ignore \"q\":\"1\", //Order quantity \"sd\":1, //order side \"r\":0, //reason \"s\":1, // status \"t\":1602679944815, //time \"ui\":100006, //user id \"fz\":\"0.0000091417\", //Frozen funds \"fb0\":\"0\", //Coupon deduction \"of\":4, //order from \"pi\":\"5BTC_USD\", //pair \"oi\":\"426610511577093\", // order id \"coi\":\"1602679943911\", //clientoid \"fb\":\"0\", //bix deduction \"po\":false //ignore }, \"cmd\":\"orderDetail\" } Bulk query order list POST https://api.bibox.com/v3/cbc/order/listBatch Request parameter Name Necessary or not Type Description Default Value Range order_ids true array array of order id example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/order/listBatch\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"order_ids\":[\"426610511577093\"], }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, \"result\":[ { \"f\":\"0\", //fee \"dp\":\"0\", //deal price \"eq\":\"0\", //deal amount \"p\":\"11092\", //target price \"tif\":0, // ignore \"q\":\"1\", //Order quantity \"sd\":1, //order side \"r\":0, //reason \"s\":1, // status \"t\":1602679944815, //time \"ui\":100006, //user id \"fz\":\"0.0000091417\", //Frozen funds \"fb0\":\"0\", //Coupon deduction \"of\":4, //order from \"pi\":\"5BTC_USD\", //pair \"oi\":\"426610511577093\", // order id \"coi\":\"1602679943911\", //clientoid \"fb\":\"0\", //bix deduction \"po\":false //ignore } ], \"cmd\":\"orderListBatch\" } Batch query order list according to clientoid POST https://api.bibox.com/v3/cbc/order/listBatchByClientOid Request parameter Name Necessary or not Type Description Default Value Range order_ids true array array of client order id example let CryptoJS = require(\"crypto-js\"); let request = require(\"request\"); let url = \"https://api.bibox.com/v3/cbc/order/listBatchByClientOid\"; let apikey = \"900625568558820892a8c833c33ebc8fd2701efe\"; //your apikey let secret = \"c708ac3e70d115ec29efbee197330627d7edf842\"; //your apikey secret let param = { \"order_ids\":[\"1602679943911\"], }; let cmd = JSON.stringify(param); //format param let timestamp = '' + (Date.now()); let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds request.post({ url: url,//Request path method: \"POST\",//Request method headers: {//Request headers 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }, body: cmd//Request parms string }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log({ url, 'content-type': 'application/json', 'bibox-api-key': apikey, 'bibox-api-sign': sign, 'bibox-timestamp': timestamp }); console.log(body) }); Response // Response { \"state\":0, \"result\":[ { \"f\":\"0\", //fee \"dp\":\"0\", //deal price \"eq\":\"0\", //deal amount \"p\":\"11092\", //target price \"tif\":0, // ignore \"q\":\"1\", //Order quantity \"sd\":1, //order side \"r\":0, //reason \"s\":1, // status \"t\":1602679944815, //time \"ui\":100006, //user id \"fz\":\"0.0000091417\", //Frozen funds \"fb0\":\"0\", //Coupon deduction \"of\":4, //order from \"pi\":\"5BTC_USD\", //pair \"oi\":\"426610511577093\", // order id \"coi\":\"1602679943911\", //clientoid \"fb\":\"0\", //bix deduction \"po\":false //ignore } ], \"cmd\":\"orderListBatchByCLientOid\" } Get server time GET https://api.bibox.com/v3/cbc/timestamp Response // Response { \"time\":\"1602680518605\" } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2020-10-30 "},"rest_api_spot.html":{"url":"rest_api_spot.html","title":"Restful API Spot trading","keywords":"","body":"Restful API Spot trading Market Quotation(apikey is not necessary) Network testing GET https://api.bibox.com/v2/mdata?cmd=ping POST https://api.bibox.com/v2/mdata cmd:ping example // Request { \"cmd\": \"ping\" \"body\": {} } { \"url\":\"https://api.bibox.com/v2/mdata\", \"form\":{ \"cmds\":\"[{\\\"body\\\":{},\\\"cmd\\\":\\\"ping\\\"}]\", } } // Response { \"result\": {}, //Test succeed \"cmd\":\"ping\" } View trading pair GET https://api.bibox.com/v2/mdata?cmd=pairList POST https://api.bibox.com/v2/mdata cmd:api/pairList example // Request { \"cmd\": \"api/pairList\", \"body\": {} } { \"url\":\"https://api.bibox.com/v2/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/pairList\\\",\\\"body\\\":{}}]\", } } // Response { \"result\":[ { \"id\":1,// pair id \"pair\":\"BIX_BTC\" //pair symbol }, { \"id\":2, \"pair\":\"ETH_BTC\" } ], \"cmd\":\"api/pairList\" } View Kline GET https://api.bibox.com/v2/mdata?cmd=kline&pair=BIX_BTC&period=1min&size=10 POST https://api.bibox.com/v2/mdata cmd: api/kline Request parameter Name Necessary or not Type Description Default Value Range pair true string pair BIX_BTC, ETH_BTC, ... period true string Kline period '1min', '3min', '5min', '15min', '30min', '1hour', '2hour', '4hour', '6hour', '12hour', 'day', 'week' size false integer how many 1000 1-1000 example // Request { \"cmd\": \"api/kline\", \"body\": { \"pair\": \"BIX_BTC\", \"period\": \"1min\", \"size\": 10 } } { \"url\":\"https://api.bibox.com/v2/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/kline\\\",\\\"body\\\":{\\\"pair\\\":\\\"BIX_BTC\\\",\\\"period\\\":\\\"1min\\\",\\\"size\\\":10}}]\", } } // Response { \"result\":[ { \"time\":1512660420000, // Timestamp \"open\":\"0.00586568\", // Opening Price \"high\":\"0.00586568\", // The highest price \"low\":\"0.00586568\", // The lowest price \"close\":\"0.00586568\", // Closing Price \"vol\":\"0\" // Trading Volume }, { \"time\":1512660480000, \"open\":\"0.00586568\", \"high\":\"0.00586568\", \"low\":\"0.00586568\", \"close\":\"0.00586568\", \"vol\":\"10\" } ], \"cmd\":\"api/kline\" } View the market quotation of all tokens GET https://api.bibox.com/v2/mdata?cmd=marketAll POST https://api.bibox.com/v2/mdata cmd: api/marketAll example // Request { \"cmd\": \"api/marketAll\", \"body\": {} } { \"url\":\"https://api.bibox.com/v2/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/marketAll\\\",\\\"body\\\":{}}]\", } } // Response { \"result\":[ { \"id\":4, \"coin_symbol\":\"BIX\", //Trading Token \"currency_symbol\":\"BTC\", //Pricing Token \"last\":\"0.00002704\", //24h the lastest price \"high\":\"0.00003480\", //24h the highest price \"low\":\"0.00001951\", //24h the lowest price \"change\":\"+0.00000715\", //24h price change \"percent\":\"+35.95%\", //24h price change percentage \"vol24H\":\"641954\", //24h Trading Volume \"amount\":\"16.55\", //24h Trading Amount \"last_cny\":\"1.84\", //The lastest price equivelant to CNY \"high_cny\":\"2.37\", \"low_cny\":\"1.33\", \"last_usd\":\"0.27\", //The lastest price equivalent to USD \"high_usd\":\"0.35\", \"low_usd\":\"0.19\" }, { \"id\":5, \"coin_symbol\":\"ETH\", \"currency_symbol\":\"BTC\", \"last\":\"0.04341296\", \"high\":\"0.04884176\", \"low\":\"0.04321405\", \"change\":\"-0.00047878\", \"percent\":\"-1.09%\", \"vol24H\":\"86\", \"amount\":\"3.77\", \"last_cny\":\"2950.87\", \"high_cny\":\"3319.88\", \"low_cny\":\"2937.35\", \"last_usd\":\"432.60\", \"high_usd\":\"486.70\", \"low_usd\":\"430.62\" } ], \"cmd\":\"api/marketAll\" } View market quotation of a single token GET https://api.bibox.com/v2/mdata?cmd=market&pair=BIX_BTC POST https://api.bibox.com/v2/mdata cmd: api/market Request parameter Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, ETH_BTC, ... example // Request { \"cmd\": \"api/market\", \"body\": { \"pair\": \"BIX_BTC\" } } { \"url\":\"https://api.bibox.com/v2/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/market\\\",\\\"body\\\":{\\\"pair\\\":\\\"BIX_BTC\\\"}}]\", } } // Response { \"result\":[ { \"id\":4, \"coin_symbol\":\"BIX\", //Trading Token \"currency_symbol\":\"BTC\", //Pricing Token \"last\":\"0.00002704\", //24h the lastest price \"high\":\"0.00003480\", //24h the highest price \"low\":\"0.00001951\", //24h the lowest price \"change\":\"+0.00000715\", //24h price change \"percent\":\"+35.95%\", //24h price change percentage \"vol24H\":\"641954\", //24h Trading Volume \"amount\":\"16.55\", //24h Trading Amount \"last_cny\":\"1.84\", //The lastest price equivelant to CNY \"high_cny\":\"2.37\", \"low_cny\":\"1.33\", \"last_usd\":\"0.27\", //The lastest price equivalent to USD \"high_usd\":\"0.35\", \"low_usd\":\"0.19\" } ], \"cmd\":\"api/market\" } View the depth of the market GET https://api.bibox.com/v2/mdata?cmd=depth&pair=BIX_BTC&size=10 POST https://api.bibox.com/v2/mdata cmd: api/depth Request parameter Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, ETH_BTC, ... size false integer how many 200 1-200 example // Request { \"cmd\": \"api/depth\", \"body\": { \"pair\": \"BIX_BTC\" } } { \"url\":\"https://api.bibox.com/v2/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/depth\\\",\\\"body\\\":{\\\"pair\\\":\\\"BIX_BTC\\\"}}]\", } } // Response { \"result\":{ \"pair\":\"BIX_BTC\", \"update_time\":1510983122681, \"asks\":[ //The depth of sellers { \"price\":\"0.008654\", //The price of pending order \"volume\":\"200.9123\" //The price of pending orders } ], \"bids\":[ //The depth of buyers { \"price\":\"0.008596\", //The price of pending order \"volume\":\"18.54306495\" //The price of pending orders }, { \"price\":\"0.00859289\", \"volume\":\"40.13567123\" } ] }, \"cmd\":\"api/depth\" } View trading record history GET https://api.bibox.com/v2/mdata?cmd=deals&pair=BIX_BTC&size=10 POST https://api.bibox.com/v2/mdata cmd: api/deals Request parameter Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, ETH_BTC, ... size false integer how many 200 1-200 example // Request { \"cmd\": \"api/deals\", \"body\": { \"pair\": \"LTC_BTC\" } } { \"url\":\"https://api.bibox.com/v2/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/deals\\\",\\\"body\\\":{\\\"pair\\\":\\\"LTC_BTC\\\"}}]\", } } // Response { \"result\":[ { \"pair\":\"LTC_BTC\", \"price\":\"0.008601\", //Trading price \"amount\":\"24.12584739\", //Trading amount \"time\":\"1512721748000\", //Trading time \"side\":2 //Taker trading side 1-Buy, 2-Sell }, { \"pair\":\"LTC_BTC\", \"price\":\"0.008611\", //Trading price \"amount\":\"24.23584739\", //Trading amount \"time\":\"1512721748000\", //Trading time \"side\":2 //Taker trading side 1-Buy, 2-Sell } ], \"cmd\":\"api/deals\" } View the market ticker GET https://api.bibox.com/v2/mdata?cmd=ticker&pair=BIX_BTC POST https://api.bibox.com/v2/mdata cmd: api/ticker Request parameter Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, ETH_BTC, ... example // Request { \"cmd\": \"api/ticker\", \"body\": { \"pair\": \"BIX_BTC\" } } { \"url\":\"https://api.bibox.com/v2/mdata\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"api/ticker\\\",\\\"body\\\":{\\\"pair\\\":\\\"BIX_BTC\\\"}}]\", } } // Response { \"result\":{ \"pair\":\"BIX_BTC\", //Trading pair \"buy\":\"0.00582132\", //The highest bid price \"buy_amount\":\"1\", //The highest bid amount \"high\":\"0.00778847\", //24h The highest price \"last\":\"0.00582156\", //The lastest trading price \"low\":\"0.00540611\", //24h The lowest price \"sell\":\"0.00582152\", //The lowest ask price \"sell_amount\":\"1\", //The lowest ask amount \"timestamp\":1510983122665, //Timestamp \"vol\":\"70.50811953\" //24h trading volume \"percent\":\"+10.02%\" //24h price change percentage \"last_cny\":\"621.53\", //The lastest trading price,equivalent to CNY \"last_usd\":\"93.93\" //The lastest trading price,equivalent to USD }, \"cmd\":\"api/ticker\" } The trade parameter specification GET https://api.bibox.com/v1/orderpending?cmd=tradeLimit The description of return result { \"result\":{ \"min_trade_price\":{ //the minimum price \"default\":\"0.00000001\", //the default minimum price, applies to all PAIRs except the PAIRs of USDT-denominated and DAI-denominated \"USDT\":\"0.0001\", //the minimum price applies to the PAIRs of USDT-denominated, more than 0.0001 of the decimal part will be automatically discarded \"DAI\":\"0.0001\" //the minimum price applies to the PAIRs of DAI-denominated, more than 0.0001 of the decimal part will be automatically discarded }, \"min_trade_amount\":{ //the minimum amount \"default\":\"0.0001\" //the minimum amount applies to all PAIRs, more than 0.0001 of the decimal part will be automatically discarded }, \"min_trade_money\":{ //the minimum money (money = price * amount) \"USDT\":\"1\", //the minimum money applies to the PAIRs of USDT-denominated \"DAI\":\"1\", //the minimum money applies to the PAIRs of DAI-denominated \"GUSD\":\"1\", \"BIX\":\"3\", \"BTC\":\"0.0002\", \"ETH\":\"0.005\" } }, \"cmd\":\"tradeLimit\" } Users Asset Information (needs apikey) Spot account asset POST https://api.bibox.com/v1/transfer cmd: transfer/assets Request parameter Name Necessary or not Type Description Default Value Range select false integer View or not the asset details 0-The total assets of all tokens, 1-the asset details of all tokens example // Request { \"cmd\": \"transfer/assets\", \"body\": { \"select\": 1 } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/assets\\\",\\\"body\\\":{\\\"select\\\":1}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"86e88a4bc8eedc795b453f121f5894ee\" } } // Response { \"result\":{ \"total_btc\":\"107.71371658\", //The total assets of all tokens, equivalent to BTC \"total_cny\":\"5587362.53\", //The total assets of all tokens, equivalent to CNY \"total_usd\":\"4000.30\", //The total assets of all tokens, equivalent to USD \"assets_list\":[ //The asset details of tokens { \"coin_symbol\":\"BTC\", \"balance\":\"102.31666784\", //Available \"freeze\":\"0.01800000\", //Freeze \"BTCValue\":\"1100.35043000\", //equivalent to BTC \"CNYValue\":\"59448654.69\", //equivalent to CNY \"USDValue\":\"8945419.86\", //equivalent to USD }, { \"coin_symbol\":\"ETH\", \"balance\":\"100.00000000\", \"freeze\":\"0.00000000\", \"BTCValue\":\"1100.35043000\", \"CNYValue\":\"59448654.69\", \"USDValue\":\"8945419.86\", }, { \"coin_symbol\":\"LTC\", \"balance\":\"125.34853787\", \"freeze\":\"0.00000000\", \"BTCValue\":\"1100.35043000\", \"CNYValue\":\"59448654.69\", \"USDValue\":\"8945419.86\", }, { \"coin_symbol\":\"BIX\", \"balance\":\"712.79411732\", \"freeze\":\"0.00000000\", \"BTCValue\":\"1100.35043000\", \"CNYValue\":\"59448654.69\", \"USDValue\":\"8945419.86\", } ] }, \"cmd\":\"transfer/assets\" } Deposit POST https://api.bibox.com/v1/transfer cmd: transfer/transferIn Request parameter Name Necessary or not Type Description Default Value Range coin_symbol true string deposit Token BIX, EOS, ... example // Request { \"cmd\": \"transfer/transferIn\", \"body\":{ \"coin_symbol\":\"BIX\" } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/transferIn\\\",\\\"body\\\":{\\\"coin_symbol\\\":\\\"BIX\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"05068bce6cf2eb7619440d99be86abde\" } } // Response { \"result\":\"xxxxxxxxxxxxxxxxx\", //deposit address \"cmd\":\"transfer/transferIn\" } Withdraw POST https://api.bibox.com/v1/transfer cmd: transfer/transferOut Request parameter Name Necessary or not Type Description Default Value Range coin_symbol true string withdraw Token BIX, ETH, ... amount true double withdraw amount totp_code false integer google code New address required,Old address ignored trade_pwd false string trade password New address required,Old address ignored addr true string withdraw address addr_remark true string the remark of withdraw address memo false string withdraw tag memo is required for some tokens, such as EOS example // Request { \"cmd\": \"transfer/transferOut\", \"body\":{ \"coin_symbol\":\"BIX\", \"amount\":1, \"totp_code\":703634, \"trade_pwd\":\"12345678\", \"addr\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\", \"addr_remark\":\"bibox-1\", \"memo\":\"\", } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/transferOut\\\",\\\"body\\\":{\\\"coin_symbol\\\":\\\"BIX\\\",\\\"amount\\\":1,\\\"totp_code\\\":703634,\\\"trade_pwd\\\":\\\"12345678\\\",\\\"addr\\\":\\\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\\",\\\"addr_remark\\\":\\\"bibox-1\\\",\\\"memo\\\":\\\"\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"8260d0e280d2b2a78ff29bb92acf5e6b\" } } // Response { \"result\":228 //withdrawal id \"cmd\":\"transfer/transferOut\" } Deposit history list POST https://api.bibox.com/v1/transfer cmd: transfer/transferInList Request parameter Name Necessary or not Type Description Default Value Range filter_type false integer filter type 0 0-all,1-deposit is in process,2-deposit finished,3-deposit failed coin_symbol false string deposit token BIX, ETH, ... page true integer The page number from the page 1 size true integer the amount in one page 1-50 example // Request { \"cmd\": \"transfer/transferInList\", \"body\": { \"filter_type\": 0, \"page\": 1, \"size\": 10, } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/transferInList\\\",\\\"body\\\":{\\\"filter_type\\\":0,\\\"page\\\":1,\\\"size\\\":10}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"7c515dc6b6ccb803115ce8653ef6eed3\" } } // Response { \"result\":{ \"count\":2, \"page\":1, \"items\":[ { \"coin_symbol\":\"ETH\", // token \"to_address\":\"xxxxxxxxxxxxxxxxxxxxxxxxxx\", // address \"amount\":\"1.00000000\", // amount \"confirmCount\":\"15\", // the acknowledgment number \"createdAt\":1540641511000, \"status\":2 // status, 1-deposit is in process,2-deposit finished,3-deposit failed }, { \"coin_symbol\":\"BIX\", \"to_address\":\"xxxxxxxxxxxxxxxxxxxxxxxxxx\", \"amount\":\"1.00000000\", \"confirmCount\":\"15\", \"createdAt\":1540622460000, \"status\":2 } ] }, \"cmd\":\"transfer/transferInList\" } Withdraw history list POST https://api.bibox.com/v1/transfer cmd: transfer/transferOutList Request parameter Name Necessary or not Type Description Default Value Range filter_type false integer filter type -2: The review fails; -1: user canceled; 0: to be reviewed; 1: The review passes (token to be listed); 2: token listing; 3: token listing completed coin_symbol false string deposit token BIX, ETH, ... page true integer The page number from the page 1 size true integer the amount in one page 1-50 example // Request { \"cmd\": \"transfer/transferOutList\", \"body\": { \"page\": 1, \"size\": 10, } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/transferOutList\\\",\\\"body\\\":{\\\"page\\\":1,\\\"size\\\":10}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"0702af0bab89897ffe0d486c265f2b21\" } } // Response { \"result\":{ \"count\":2, \"page\":1, \"items\":[ { \"coin_symbol\":\"ETH\", // token \"to_address\":\"xxxxxxxxxxxxxxxxxxxxxxxxxx\", // address \"amount\":\"1.00000000\", // amount \"fee\":\"0.00000000\", // withdraw fee \"createdAt\":1540641511000, \"memo\":\"\", \"status\":-2 // Status, -2: The review fails; -1: user canceled; 0: to be reviewed; 1: The review passes (token to be listed); 2: token listing; 3: token listing completed }, { \"coin_symbol\":\"BIX\", \"to_address\":\"xxxxxxxxxxxxxxxxxxxxxxxxxx\", \"amount\":\"1.00000000\", \"fee\":\"0.00000000\", \"createdAt\":1540622460000, \"memo\":\"\", \"status\":3 } ] }, \"cmd\":\"transfer/transferOutList\" } Query token config POST https://api.bibox.com/v1/transfer cmd: transfer/coinConfig Request parameter Name Necessary or not Type Description Default Value Range coin_symbol false string token BIX, ETH... example // Request { \"cmd\": \"transfer/coinConfig\", \"body\": { } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/coinConfig\\\",\\\"body\\\":{}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"41babcc84fd5301117f4fcf66cd70b6f\" } } // Response { \"result\":[ { \"coin_symbol\":\"BTC\", \"original_decimals\":8, //the original decimals of token \"enable_deposit\":1, //enable deposit,0-no,1-yes \"enable_withdraw\":1, //enable withdraw,0-no,1-yes \"withdraw_fee\":0.0005, //withdraw fee \"withdraw_min\":0.005 //the minimum amount }, { \"coin_symbol\":\"BIX\", \"original_decimals\":18, \"enable_deposit\":0, \"enable_withdraw\":0, \"withdraw_fee\":2, \"withdraw_min\":10 }, ... //其他币种配置信息 ], \"cmd\":\"transfer/coinConfig\" } Withdrawal information POST https://api.bibox.com/v1/transfer cmd: transfer/withdrawInfo Request parameter Name Necessary or not Type Description Default Value Range id true integer withdrawal id example // Request { \"cmd\": \"transfer/withdrawInfo\", \"body\": { \"id\": 228 } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/withdrawInfo\\\",\\\"body\\\":{\\\"id\\\":228}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"e5a1067e1f2aee028989552c23425099\" } } // Response { \"result\":{ \"id\":228, \"createdAt\": 1512756997000, \"coin_symbol\":\"LTC\", // \"to_address\":\"xxxxxxxxxxxxxxxxxxxxxxxxxx\", // withdrawal address \"status\":3, // Status, -2: The review fails; -1: user canceled; 0: to be reviewed; 1: The review passes (token to be listed); 2: token listing; 3: token listing completed \"amount\":\"1.00000000\", // amount \"fee\":0.1 // fee }, \"cmd\":\"transfer/withdrawInfo\" } Transaction(Needs apikey) place an order POST https://api.bibox.com/v2/orderpending cmd: orderpending/trade Request parameter Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, ETH_BTC, ... account_type true integer Account type 0-spot account order_type true integer Trading type 2-limit order order_side true integer Trading side 1-Buy,2-Sell price true double order price minimum value 0.00000001 amount true double order amount minimum value 0.0001 client_oid false long to string client order id '110011223344' example // Request { \"cmd\": \"orderpending/trade\", \"index\": 12345, //random index, specific one in a batch \"body\": { \"pair\": \"BIX_BTC\", \"account_type\": 0, \"order_type\": 2, \"order_side\": 1, \"price\": 0.00032, \"amount\": 1000, \"client_oid\": '110011223344' } } { \"url\":\"https://api.bibox.com/v1/orderpending\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"orderpending/trade\\\",\\\"index\\\":12345,\\\"body\\\":{\\\"pair\\\":\\\"BIX_BTC\\\",\\\"account_type\\\":0,\\\"order_type\\\":2,\\\"order_side\\\":1,\\\"price\\\":0.00032,\\\"amount\\\":1000}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"2d775fdc61a2aaf63e9f40441c2040a8\" } } // Response { \"result\": \"100055558128036\", //order id \"index\": 12345, //random index, specific one in a batch \"cmd\":\"orderpending/trade\" } cancel an order POST https://api.bibox.com/v1/orderpending cmd: orderpending/cancelTrade Request parameter Name Necessary or not Type Description Default Value Range orders_id true string order id example // Request { \"cmd\": \"orderpending/cancelTrade\", \"index\": 12345, \"body\": { \"orders_id\": \"8588285380268971\" } } { \"url\":\"https://api.bibox.com/v1/orderpending\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"orderpending/cancelTrade\\\",\\\"index\\\":12345,\\\"body\\\":{\\\"orders_id\\\":\\\"8588285380268971\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"bf3882a208ada6ebc86a8cf8e3b5ea5a\" } } // Response { \"result\":\"OK\", //Note: This result only indicates that the server received the cancelling request, and the cancelling result can query the order record \"index\": 12345, //random index, specific one in a batch \"cmd\":\"orderpending/cancelTrade\" } The current order list POST https://api.bibox.com/v1/orderpending cmd: orderpending/orderPendingList Request parameter Name Necessary or not Type Description Default Value Range pair false string Trading pair BIX_BTC, ETH_BTC, ... account_type true integer Account type 0-spot account order_side false integer Trading side 1-Buy,2-Sell coin_symbol false string Trading Token BIX, EOS, ... currency_symbol false string Pricing Token BTC, USDT, ... page true integer The page number from the page 1 size true integer the amount in one page 1-50 example // Request { \"cmd\": \"orderpending/orderPendingList\", \"body\": { \"account_type\": 0, \"order_side\": 2, \"page\": 1, \"size\": 10, \"coin_symbol\": \"LTC\", \"currency_symbol\": \"BTC\" } } { \"url\":\"https://api.bibox.com/v1/orderpending\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"orderpending/orderPendingList\\\",\\\"body\\\":{\\\"account_type\\\":0,\\\"order_side\\\":2,\\\"page\\\":1,\\\"size\\\":10,\\\"coin_symbol\\\":\\\"LTC\\\",\\\"currency_symbol\\\":\\\"BTC\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"15e0c711e4ad94b30245782147c9307f\" } } // Response { \"result\":{ \"count\":1, \"page\":1, \"items\":[ { \"id\":\"100055558128036\", \"createdAt\": 1512756997000, \"account_type\":0, \"coin_symbol\":\"LTC\", //Trading Token \"currency_symbol\":\"BTC\", //Pricing Token \"order_side\":2, //Trading side 1-Buy, 2-Sell \"order_type\":2, //2-limit order \"price\":\"0.00900000\", //order price \"amount\":\"1.00000000\", //order amount \"money\":\"0.00900000\", //currency amount (price * amount) \"deal_amount\":\"0.00000000\", //deal amount \"deal_percent\":\"0.00%\", //deal percentage \"unexecuted\":\"0.00000000\", //unexecuted amount \"status\":1 //Status,-1-fail, 0,1-to be dealt, 2-dealt partly, 3-dealt totally, 4- cancelled partly, 5-cancelled totally, 6-to be cancelled } ] }, \"cmd\":\"orderpending/orderPendingList\" } The order history POST https://api.bibox.com/v1/orderpending cmd: orderpending/pendingHistoryList Request parameter Name Necessary or not Type Description Default Value Range pair false string Trading pair BIX_BTC, ETH_BTC, ... account_type true integer Account type 0-spot account order_side false integer Trading side 1-Buy,2-Sell coin_symbol false string Trading Token BIX, EOS, ... currency_symbol false string Pricing Token BTC, USDT, ... page true integer The page number from the page 1 size true integer the amount in one page 1-50 hide_cancel false integer hide cancelled orders 0-not hide,1-hide example // Request { \"cmd\": \"orderpending/pendingHistoryList\", \"body\": { \"account_type\": 0, \"order_side\": 2, \"page\": 1, \"size\": 10, \"coin_symbol\": \"LTC\", \"currency_symbol\": \"BTC\" } } { \"url\":\"https://api.bibox.com/v1/orderpending\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"orderpending/pendingHistoryList\\\",\\\"body\\\":{\\\"account_type\\\":0,\\\"order_side\\\":2,\\\"page\\\":1,\\\"size\\\":10,\\\"coin_symbol\\\":\\\"LTC\\\",\\\"currency_symbol\\\":\\\"BTC\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"4e80fd525dbdebb74a60847308b50e37\" } } // Response { \"result\":{ \"count\":1, \"page\":1, \"items\":[ { \"id\":\"100055558128036\", \"createdAt\": 1512756997000, \"account_type\":0, \"coin_symbol\":\"LTC\", //Trading Token \"currency_symbol\":\"BTC\", //Pricing Token \"order_side\":2, //Trading side 1-Buy, 2-Sell \"order_type\":2, //2-limit order \"price\":\"0.00900000\", //order price \"amount\":\"1.00000000\", //order amount \"money\":\"0.00900000\", //currency amount (price * amount) \"deal_amount\":\"0.00000000\", //deal amount \"deal_percent\":\"0.00%\", //deal percentage \"unexecuted\":\"0.00000000\", //unexecuted amount \"status\":3 //Status,-1-fail, 0,1-to be dealt, 2-dealt partly, 3-dealt totally, 4- cancelled partly, 5-cancelled totally, 6-to be cancelled } ] }, \"cmd\":\"orderpending/pendingHistoryList\" } The order history detail POST https://api.bibox.com/v1/orderpending cmd: orderpending/orderDetail Request parameter Name Necessary or not Type Description Default Value Range id true string order id account_type true integer Account type 0-spot account example // Request { \"cmd\": \"orderpending/orderDetail\", \"body\": { \"id\": \"11221615825364891\" } } { \"url\":\"https://api.bibox.com/v1/orderpending\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"orderpending/orderDetail\\\",\\\"body\\\":{\\\"id\\\":\\\"11221615825364891\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"3eead4ae66c0767be2d87ac4105f0dee\" } } // Response { \"result\":{ \"sum\":\"0.00588746\", // sum of amount \"orderList\":[ { \"id\":\"2251799813844119243\", //deal id \"createdAt\":1561007144000, //deal timestamp \"account_type\":0, //spot account \"coin_symbol\":\"KAT\", //Trading Token \"currency_symbol\":\"ETH\", //Pricing Token \"order_side\":2, //Trading side 1-Buy, 2-Sell \"order_type\":2, //2-limit order \"price\":\"0.00001183\", //order price \"amount\":\"497.6722\", //order amount \"money\":\"0.00588746\", //currency amount (price * amount) \"fee\":\"0.00000000\", //fee amount \"pay_bix\":0, //pay bix for fee \"fee_symbol\":\"ETH\", //fee token symbol \"relay_id\":\"11221615825364891\" // order id } ] }, \"cmd\":\"orderpending/orderDetail\" } The order POST https://api.bibox.com/v1/orderpending cmd: orderpending/order Request parameter Name Necessary or not Type Description Default Value Range id true string order id account_type true integer Account type 0-spot account example // Request { \"cmd\": \"orderpending/order\", \"body\": { \"id\": \"100055558128036\" } } { \"url\":\"https://api.bibox.com/v1/orderpending\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"orderpending/order\\\",\\\"body\\\":{\\\"id\\\":\\\"100055558128036\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"970983d6d8ddf9c0db5181d4ce7b744b\" } } // Response { \"result\":{ \"id\":\"100055558128036\", \"createdAt\": 1512756997000, \"account_type\":0, \"coin_symbol\":\"LTC\", //Trading Token \"currency_symbol\":\"BTC\", //Pricing Token \"order_side\":2, //Trading side 1-Buy, 2-Sell \"order_type\":2, //2-limit order \"price\":\"0.00900000\", //order price \"amount\":\"1.00000000\", //order amount \"money\":\"0.00900000\", //currency amount (price * amount) \"deal_amount\":\"0.00000000\", //deal amount \"deal_percent\":\"0.00%\", //deal percentage \"unexecuted\":\"0.00000000\", //unexecuted amount \"status\":3 //Status, -1-fail, 0,1-to be dealt, 2-dealt partly, 3-dealt totally, 4- cancelled partly, 5-cancelled totally, 6-to be cancelled }, \"cmd\":\"orderpending/order\" } The dealed order history POST https://api.bibox.com/v1/orderpending cmd: orderpending/orderHistoryList Request parameter Name Necessary or not Type Description Default Value Range pair false string Trading pair BIX_BTC, ETH_BTC, ... account_type true integer Account type 0-spot account order_side false integer Trading side 1-Buy,2-Sell coin_symbol false string Trading Token BIX, EOS, ... currency_symbol false string Pricing Token BTC, USDT, ... page true integer The page number from the page 1 size true integer the amount in one page 1-50 example // Request { \"cmd\": \"orderpending/orderHistoryList\", \"body\": { \"account_type\": 0, \"order_side\": 2, \"page\": 1, \"size\": 10, \"coin_symbol\": \"LTC\", \"currency_symbol\": \"BTC\" } } { \"url\":\"https://api.bibox.com/v1/orderpending\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"orderpending/orderHistoryList\\\",\\\"body\\\":{\\\"account_type\\\":0,\\\"order_side\\\":2,\\\"page\\\":1,\\\"size\\\":10,\\\"coin_symbol\\\":\\\"LTC\\\",\\\"currency_symbol\\\":\\\"BTC\\\"}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"443c8f691f9072c5c0bd3258f4ce89a1\" } } // Response { \"result\":{ \"count\":1, \"page\":1, \"items\":[ { \"id\":\"100055558128033\", \"createdAt\": 1512756997000, \"account_type\":0, \"coin_symbol\":\"LTC\", \"currency_symbol\":\"BTC\", \"order_side\":2, \"order_type\":2, \"price\":\"0.00886500\", \"amount\":\"1.00000000\", \"money\":\"0.00886500\", \"fee\":0 } ] }, \"cmd\":\"orderpending/orderHistoryList\" } The dealed order history last Query the transaction records after the specified id number, and return 1000 records per page POST https://api.bibox.com/v1/orderpending cmd: orderpending/orderDetailsLast Request parameter Name Necessary or not Type Description Default Value Range pair false string pair BIX_BTC, ETH_BTC, ... account_type true integer account type 0-spot account id true string Id number at the beginning of the transaction record greater than \"1000000000\" page true integer The page number from the page 1 example // Request { \"cmd\": \"orderpending/orderDetailsLast\", \"body\": { \"account_type\": 0, \"id\": \"1000000000\", \"page\": 1, \"pair\": \"LTC_BTC\", } } { \"url\":\"https://api.bibox.com/v1/orderpending\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"orderpending/orderDetailsLast\\\",\\\"body\\\":{\\\"account_type\\\":0,\\\"id\\\":\\\"1000000000\\\",\\\"page\\\":1,\\\"pair\\\":\\\"LTC_BTC\\\"}}]\", \"apikey\":\"*****\", \"sign\":\"*****\" } } // Response { \"result\":[ { \"result\":{ \"count\":4, \"page\":1, \"items\":[ { \"id\":\"2251799818808964061\", \"createdAt\":1587004749000, \"account_type\":0, \"coin_symbol\":\"LTC\", \"currency_symbol\":\"BTC\", \"order_side\":1, \"order_type\":2, \"price\":\"0.00587833\", \"amount\":\"0.8497\", \"money\":\"0.00499481\", \"pay_bix\":1, \"fee_symbol\":\"BIX\", \"fee\":\"-0.26381928\", \"is_maker\":1, \"relay_id\":\"12557522307843276\" }, { \"id\":\"2251799818808964511\", \"createdAt\":1587004752000, \"account_type\":0, \"coin_symbol\":\"LTC\", \"currency_symbol\":\"BTC\", \"order_side\":1, \"order_type\":2, \"price\":\"0.00587833\", \"amount\":\"0.6864\", \"money\":\"0.00403488\", \"pay_bix\":1, \"fee_symbol\":\"BIX\", \"fee\":\"-0.21311705\", \"is_maker\":1, \"relay_id\":\"12557522307843276\" } ] }, \"cmd\":\"orderpending/orderDetailsLast\" } ] } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2021-01-20 "},"rest_api_transfer.html":{"url":"rest_api_transfer.html","title":"Restful API Transfer Assets","keywords":"","body":"Restful API Transfer Assets Query assets( apikey) Main assets POST https://api.bibox.com/v1/transfer cmd: transfer/mainAssets Request parameter Name Necessary or not Type Description Default Value Range select false integer integer View or not the asset details 0-The total assets of all tokens, 1-the asset details of all tokens example // Request { \"cmd\":\"transfer/mainAssets\", \"body\":{ \"select\":1 } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/mainAssets\\\",\\\"body\\\":{\\\"select\\\":1}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"f035f70b6084613946f0944aa620d8a8\" } } // Response sucess { \"result\":[ { \"result\":{ \"total_btc\":\"0.00034073\", //The total assets of all tokens, equivalent to BTC \"total_cny\":\"18.44\", //The total assets of all tokens, equivalent to CNY \"total_usd\":\"2.66\", //The total assets of all tokens, equivalent to USD \"assets_list\":[ //The asset details of tokens { \"coin_symbol\":\"BIX\", //tokens \"BTCValue\":\"0.00000000\", //equivalent to BTC \"CNYValue\":\"0.00\", //equivalent to CNY \"USDValue\":\"0.00\", //equivalent to USD \"balance\":\"0.00005540\", //Available \"freeze\":\"0.00000000\" //Freeze }, ... ] }, \"cmd\":\"transfer/mainAssets\" } ] } Spot Assets Reference link Contract Assets Reference link Credit Assets POST https://api.bibox.com/v1/transfer cmd: transfer/creditAssets Request parameter Name Necessary or not Type Description Default Value Range select false integer View or not the asset details 0-The total assets of all tokens, 1-the asset details of all tokens example // Request { \"cmd\":\"transfer/creditAssets\", \"body\":{ } } { \"url\":\"https://api.bibox.com/v1/transfer\", \"form\":{ \"cmds\":\"[{\\\"cmd\\\":\\\"transfer/creditAssets\\\",\\\"body\\\":{}}]\", \"apikey\":\"1e01c22ff8c59e9d98d93423817303f0e7c6d79d\", \"sign\":\"5fe1468b9d98f5b6879d8db1d46d766f\" } } // Response sucess { \"result\":[ { \"result\":{ \"total_btc\":\"0.00063800\", //The total assets of all tokens, equivalent to BTC \"total_cny\":\"34.55\", //The total assets of all tokens, equivalent to CNY \"total_usd\":\"5.00\", //The total assets of all tokens, equivalent to USD \"assets_list\":[ { \"balance\":\"0.00000000\", //Available \"freeze\":\"0.00000000\", //Freeze \"BTCValue\":\"0.00000000\", //equivalent to BTC \"CNYValue\":\"0.00\", //equivalent to RMB \"USDValue\":\"0.00\", //equivalent to USD \"pair\":\"EOS_USDT\", //Trading pair \"coin_symbol\":\"EOS\" //tokens }, { \"coin_symbol\":\"USDT\", \"pair\":\"EOS_USDT\", \"BTCValue\":\"0.00063800\", \"CNYValue\":\"34.55\", \"USDValue\":\"5.00\", \"balance\":\"5.00000000\", \"freeze\":\"0.00000000\" } ] }, \"cmd\":\"transfer/creditAssets\" } ] } Main Assets And Spot Assets(needs apikey) Main assets transfer to spot assets POST https://api.bibox.com/v2/assets/transfer/spot Request parameter Name Necessary or not Type Description Default Value Range symbol true string Trading pair ---- EOS,BTC... amount true double transfer amount ---- > 0 type true integer transfer type ---- 0 main assets -> spot assets; 1 spot assets -> main assets example // Request param: { \"type\": 0, \"amount\": \"100\", \"symbol\": 'USDT' } post body: { body: JSON.stringify(param), // stringify param apikey: yourApiKey, sign: 'signature you body with your apisecret ' } yourApiKey = '178bed72cc7dcdca538b756817a87666432673af'; yourSecret = \"3e412e42957b720d155b2c8798726a0e8ed80807\"; post body: { body: \"{\\\"type\\\":0,\\\"amount\\\":\\\"100\\\",\\\"symbol\\\":\\\"USDT\\\"}\", apikey: \"178bed72cc7dcdca538b756817a87666432673af\", sign: \"a8ac84f2e6c2ead3dac4e46cf9c6e01e\", //signature \"{\\\"type\\\":0,\\\"amount\\\":\\\"100\\\",\\\"symbol\\\":\\\"USDT\\\"}\" with yourSecret } // Response success { \"result\":{ \"id\":\"39030177501581312\", \"state\":0 // 0 success, other fail; } } // Response fail { \"error\":{ \"code\":\"2027\", \"msg\":\"账户余额不足\" } } Main Assets Transfer to Credit Assets(needs apikey) Main assets to credit assets POST https://api.bibox.com/v1/credit cmd: transferAssets/base2credit Request parameter Name Necessary or not Type Description Default Value Range coin_symbol true string tokens ---- EOS,BTC... amount true double transfer amount ---- > 0 pair true string Trading pair ---- EOS_USDT,BTC_USDT... example // Request { \"cmd\":\"transferAssets/base2credit\", \"body\":{ \"coin_symbol\":\"USDT\", \"amount\":5, \"pair\":\"EOS_USDT\" } } // Response sucess { \"result\":[ { \"result\":\"操作成功\", \"cmd\":\"transferAssets/base2credit\" } ] } Credit assets transfer to main assets POST https://api.bibox.com/v1/credit cmd: transferAssets/credit2base Request parameter Name Necessary or not Type Description Default Value Range coin_symbol true string tokens ---- EOS,BTC... amount true double amount ---- > 0 pair true string Trading pair ---- EOS_USDT,BTC_USDT...Trading pair example // Request { \"cmd\":\"transferAssets/credit2base\", \"body\":{ \"coin_symbol\":\"USDT\", \"amount\":5, \"pair\":\"EOS_USDT\" } } // Response sucess { \"result\":[ { \"result\":\"操作成功\", \"cmd\":\"transferAssets/credit2base\" } ] } Main Assets Transfer to Contract Assets(need apikey) Main Assets Transfer to Contract Assets Reference link Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2019-11-13 "},"restful_credit.html":{"url":"restful_credit.html","title":"Restful API Credit Trading","keywords":"","body":"Credit Api List Index GetLendOrder lendOrder/get GetBorrowOrder borrowOrder/get GetLendBook lendOrderbook/get GetLendAsset transferAssets/lendAssets GetBorrowAsset transferAssets/borrowAssets GetBorrowDepth borrowDepth/get Borrow borrowOrder/autobook Refund borrowOrder/refund PublishLendBook lendOrderbook/publish CancelLendBook lendOrderbook/cancel Trade trade/trade Cancel trade/cancel GetLendOrder lendOrder/get path: /v1/credit method: POST cmd: lendOrder/get Params Type Comment page int page size int size coin_symbol string symbol status list Type Request: { \"cmd\":\"lendOrder/get\", \"body\":{ \"page\":1, \"status\":[ 0, 1 ], \"coin_symbol\":\"USDT\", \"size\":1 } } Response: { \"result\": [ { \"result\": { \"count\": 2, \"page\": 1, \"items\": [ { \"id\": 14, \"user_id\": 8114202916, \"coin_id\": 60, \"coin_symbol\": \"USDT\", \"amount\": \"1000.00000000\", \"amount_receipt\": \"0.00000000\", \"interest_rate\": \"0.00200000\", \"insurance_rate\": \"0.10000000\", \"fee\": \"0.00000000\", \"insurance\": \"0.00000000\", \"interest\": \"2.33333324\", \"interest_receipt\": \"0.00000000\", \"period\": 7, \"expireAt\": \"2019-11-18T03:00:00.000Z\", \"status\": 0, \"createdAt\": \"2019-11-11T03:50:47.000Z\", \"days\": 1 } ], \"validSymbols\": [ \"USDT\" ] }, \"cmd\": \"lendOrder/get\" } ] } GetBorrowOrder borrowOrder/get path: /v1/credit method: POST cmd: borrowOrder/get ParamsName Require Type Comment Default Value coin_symbol true string coin USDT, EOS... pair true string position BTC_USDT, ETH_USDT, *_USDT-cross position status true int/Array status 0 unfill, 1 ok, 2 part Refund, 3-6 finish page true integer pase 1 size true integer size 1-50 Request: { \"cmd\":\"borrowOrder/get\", \"body\":{ \"page\":1, \"status\":[ 1, 2 ], \"size\":10, \"pair\":\"BTC_USDT\" } } Response: { \"result\": [ { \"result\": { \"count\": 2, \"page\": 1, \"items\": [ { \"id\": 539354, \"user_id\": 8114202916, \"coin_id\": 60, \"coin_symbol\": \"USDT\", \"pair\": \"BTC_USDT\", \"amount\": \"406.00000000\", \"amount_refund\": \"0.00000000\", \"interest_rate\": \"0.00010000\", \"interest_rate_hour\": \"0.00000417\", \"interest\": \"0.26559180\", \"interest_refund\": \"0.00000000\", \"period\": 7, \"expireAt\": \"2019-11-15T11:00:00.000Z\", \"status\": 1, \"createdAt\": \"2019-11-08T11:53:15.000Z\" } ], \"validSymbols\": [ { \"coin_symbol\": \"USDT\", \"pair\": \"BTC_USDT\" } ] }, \"cmd\": \"borrowOrder/get\" } ] } GetLendBook lendOrderbook/get path: /v1/credit method: POST cmd: lendOrderbook/get ParamsName Require Type Comment Default Value coin_symbol true string Symbol USDT, EOS, ... status true integer/integerArray status 0 unfill, 1 partfill, 2 fill page true integer page start at 1 size true integer size 1-50 Request: { \"cmd\":\"lendOrderbook/get\", \"body\":{ \"page\":1, \"status\":[ 0, 1 ], \"coin_symbol\":\"EOS\", \"size\":50 } } Response: { \"result\":{ \"count\":1, \"page\":1, \"items\":[ { \"id\":1, \"user_id\":10000000, \"coin_id\":61, \"coin_symbol\":\"EOS\", \"amount\":5, // amount \"amount_finish\":0, // fill amount \"interest_rate\":0.001, // rate \"period\":7, \"expireAt\":\"2018-12-29T10:59:18.000Z\", \"status\":0, \"createdAt\":\"2018-12-22T10:59:18.000Z\" } ], \"validSymbols\":[ \"EOS\" ] }, \"cmd\":\"lendOrderbook/get\" } GetLendAsset transferAssets/lendAssets path: /v1/credit method: POST cmd: transferAssets/lendAssets ParamsName Require Type Comment Default Value coin_symbol true string 交易coin USDT, EOS, ... Request: { \"cmd\":\"transferAssets/lendAssets\", \"body\":{ \"coin_symbol\":\"EOS\" } } Response: { \"result\":{ \"balance\":\"1.52319980\", // 可用余额 \"lend\":\"0.00000000\", // 待收贷款size \"lend_book\":\"0.00000000\", // 预订贷款size \"interest\":\"0.00000000\", // 待收利息 \"lend_receipt\":\"1.44000000\", // 已收贷款size \"interest_receipt\":\"0.16115200\" // 已收利息 }, \"cmd\":\"transferAssets/lendAssets\" } GetBorrowAssetInfo transferAssets/borrowAssets path: /v1/credit method: POST cmd: transferAssets/borrowAssets ParamsName Require Type Comment Default Value pair true string postion BTC_USDT, ETH_USDT, *_USDT-cross position Request: { \"cmd\":\"transferAssets/borrowAssets\", \"body\":{ \"pair\":\"BTC_USDT\", } } Response: { \"result\": [ { \"result\": { \"pair\": \"BTC_USDT\", \"currency_deposit\": \"8406.00000000\", \"currency_borrow\": \"506.34642529\", \"currency_can_borrow\": \"70590.53574710\", \"currency_borrow_book\": \"0\", \"margin_radio\": \"1660.13\", \"leverage_ratio\": 3, //杠杆倍数(废弃) \"max_leverage_ratio\": 10, //最大支持杠杆倍数(新) \"force_price\": \"0\", \"bust_price\": \"0\", \"items\": [ { \"coin_symbol\": \"BTC\", \"coin_id\": 42, \"balance\": \"0.00000000\", \"freeze\": \"0.00000000\", \"borrow\": \"0\", \"can_transfer_credit\": \"0.00000000\", \"can_transfer_main\": \"0\", \"can_borrow\": \"8.82381696\", \"borrow_book\": \"0\", \"force_price\": \"0\", \"bust_price\": \"0\", \"price\": \"8000\", \"interest\": \"0\", \"total\": \"0.00000000\" }, { \"coin_symbol\": \"USDT\", \"coin_id\": 60, \"balance\": \"8406.00000000\", \"freeze\": \"0.00000000\", \"borrow\": \"506.34642529\", \"can_transfer_credit\": \"7494.57643447\", \"can_transfer_main\": \"5000.00000000\", \"can_borrow\": \"70590.53574710\", \"borrow_book\": \"0\", \"force_price\": \"0\", \"bust_price\": \"0\", \"price\": \"1\", \"interest\": \"0.34642529\", \"total\": \"8406.00000000\" } ], \"current_leverage_radio\": \"2\", //当前杠杆倍数(新) \"force_deal_radio\": 110, //爆仓保证金率(新) \"alert_radio\": 115, //报警保证金率(新) \"safe_radio\": 200 //强平之后的保证金率(新) }, \"cmd\": \"transferAssets/borrowAssets\" } ] } GetBorrowDepth borrowDepth/get path: /v1/credit method: POST cmd: borrowDepth/get ParamsName Require Type Comment Default Value coin_symbol true string coin USDT, EOS, ... pair false string position BTC_USDT, ETH_USDT, ... Request: { \"cmd\":\"borrowDepth/get\", \"body\":{ \"coin_symbol\":\"EOS\", \"pair\":\"EOS_USDT\" } } Response: { \"result\":{ \"lend\":[ { \"interest_rate\":\"0.07\", \"total\":\"5.20000000\", \"number\":1 }, { \"interest_rate\":\"0.08\", \"total\":\"21657.73800000\", \"number\":19 } ], \"borrow\":[ { \"interest_rate\":\"0.01\", \"total\":\"5.00000000\", \"number\":1 } ], \"history\":[// 成交历史 { \"interest_rate\":0.0008, \"amount\":\"26.480\", \"createdAt\":\"2018-12-19T22:05:21.000Z\" }, { \"interest_rate\":0.0008, \"amount\":\"6000.000\", \"createdAt\":\"2018-12-19T10:24:27.000Z\" } ] }, \"cmd\":\"borrowDepth/get\" } Borrow borrowOrder/autobook path: /v1/credit method: POST cmd: borrowOrder/autobook ParamsName Require Type Comment Default Value coin_symbol true string coin EOS, BTC, USDT pair true string position BTC_USDT, *_USDT amount true double size Request: { \"cmd\":\"borrowOrder/autobook\", \"body\":{ \"coin_symbol\": \"BTC\", \"pair\": \"BTC_USDT\", \"amount\":\"5.0036\" } } Response: { \"result\":\"操作成功\", \"cmd\":\"borrowOrder/autobook\" } Refund borrowOrder/refund path: /v1/credit method: POST cmd: borrowOrder/refund ParamsName Require Type Comment Default Value coin_symbol true string coin EOS, BTC, USDT pair true string position BTC_USDT, *_USDT amount true double amount Request: { \"cmd\":\"borrowOrder/refund\", \"body\":{ \"coin_symbol\": \"BTC\", \"pair\": \"BTC_USDT\", \"amount\":\"5.0036\" } } Response: { \"result\":\"ok\", \"cmd\":\"borrowOrder/refund\" } PublishLendBook lendOrderbook/publish path: /v1/credit method: POST cmd: lendOrderbook/publish ParamsName Require Type Comment Default Value coin_symbol true string coin USDT, EOS, ... amount true double amount interest_rate true double rate is_insurance true integer insurance 0或1 force true integer 1 Request: { \"cmd\":\"lendOrderbook/publish\", \"body\":{ \"coin_symbol\":\"EOS\", \"amount\":\"5\", \"interest_rate\":0.001, \"is_insurance\":1, \"force\":1 } } Response: { \"result\":\"操作成功\", \"cmd\":\"lendOrderbook/publish\" } CancelLendBook lendOrderbook/cancel path: /v1/credit method: POST cmd: lendOrderbook/cancel ParamsName Require Type Comment Default Value orderbook_id true integer id Request: { \"cmd\":\"lendOrderbook/cancel\", \"body\":{ \"orderbook_id\":9064 } } Response: { \"result\":\"操作成功\", \"cmd\":\"lendOrderbook/cancel\" } Trade trade/trade path: /v1/credit method: POST cmd: trade/trade Params Type Comment pair string trade pair account_type integer Type 1-isolated 257-cross order_type integer 2-limit order_side integer 1buy 2sell price string min 0.00000001 amount string min 0.0001 money string Request: { \"cmd\":\"trade/trade\", \"body\":{ \"account_type\":1, \"pair\":\"BTC_USDT\", \"order_type\":2, \"price\":\"100\", \"amount\":\"1\", \"money\":\"100.0000\", \"order_side\":1 } } Response: { \"result\": [ { \"result\": 1, \"cmd\": \"trade/trade\" } ] } Cancel trade/cancel path: /v1/credit method: POST cmd: trade/cancel ParamsName Require Type Comment Default Value orders_id true string order_id Request: { \"cmd\": \"trade/cancel\", \"body\": { \"orders_id\": \"4631142976192513\" //委托单id } } Response: { \"result\":\"ok\", \"cmd\":\"trade/cancel\" } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2020-03-14 "},"ws_api_intro.html":{"url":"ws_api_intro.html","title":"WebSocket API description","keywords":"","body":"WebSocket API description WebSocket API Introduction WebSocket protocol is a new TCP-based network protocol. It enables the full-duplex communication of single TCP connection between client and server, the server sends singals to clients actively, which reduces the unnecessary expenses on frequent identity verifications. The greatest two advantages: The header data requested by double sides are small, which is about only 2 Bytes. Server will not return data passively after receiving the request of clients any more, it will send the new data to clients actively. The advantages of the above WebSocket protocol is very appropriate for cryptocurrencies market and trading real-time interface. Attention: WebSocket only supports market viewing, trading interface will be provided later. Access to the url Bibox market request url:wss://push.bibox.com/ The description of request and subscription 1. Access to the url Bibox market request url: wss://push.bibox.com/ Rate Limiting Policy: To improve data concurrent processing performance, a Websocket connection allows up to 20 channel subscriptions. If you need a large number of subscriptions, you can create multiple Websocket connections. 2. Data compression All data returned by WebSocket API are compressed by GZIP, which will be decompressed after client receiving the data. Pako is suggested. (【pako】 is a library supports compression and decompression) Note: Server performs a BASE64 encoding of compressed data, Client decodes BASE64 before decompression. Decompression Example (nodejs) let data = msg.data; // from Server let text = pako.inflate(Buffer.from(data, 'base64'), { to: 'string' }); let recvMsg = JSON.parse(text); // raw data 3. WebSocket Library 【ws】 is a WebSocket library under Node.js. 4. Ping message WebSocket API supports double side messages, both server and client can start ping message, pong message will be returned. WebSocket Server send ping message: {\"ping\": 1536743613834} WebSocket Client will be returned: {\"pong\": 1536743613834} Note: the value of \"pong\" is the value of \"ping\" in data returned. Note: After WebSocket Client and WebSocket Server connect, WenSocket Server will send a \"ping\" message to WebSocket Client every 10s (the frequency can be changed), if 2 ping messages are ignored by WebSocket Client. WebSocket Server will disconnect proactively. ┌────────┐ ┌────────┐ │ Client │ │ Server │ └───┬────┘ └───┬────┘ │ {\"ping\": 1536743613834} │ ││ │ │ Note: WebSocket Server will keep connecting if WebSocket Client send at least one of the two pings it received nearest. ┌────────┐ ┌────────┐ │ Client │ │ Server │ └───┬────┘ └───┬────┘ │ {\"ping\": 1523778470416} │ │Note: WebSocket Server will disconnect proactively after WebSocket Client ignores 2 ping messages. WebSocket Client sends ping message: {\"ping\": 1536743614839} WebSocket Server will return: {\"pong\": 1536743614839} Note: the value of \"pong\" is the value of \"ping\" in data returned. Note: if client don’t receive \"pong\" message after it sends N \"ping\" messages (N is set by client), then client needs to disconnect WebSocket, and reconnect. Note: If the client disconnects frequently, then please check the reply function of client and make sure the correct \"pong\" response to server. 5. Channel Format Use channel to Subcribe data, the grammar is as follows Channel Type Channel Format Description Kline biboxsub_spot$pairkline$period K line data, including the opening price, the highest price, the lowest price, the closing price, the trading volume in unit time interval, $period is Optional values: { 1min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 12hour, day, week } Market bibox_sub_spot_ALL_ALL_market market information, including the information of lastest price, the highest price in 24h, the lowest price in 24h, the trading volume in 24h of all trading pairs Depth biboxsub_spot$pair_depth the depth of handicap, return the lastest 200 pieces of information about trading depth Ticker biboxsub_spot$pair_ticker Ticker,return the information of lastest price, the lowest ask price and volume, the highest bid pirce and volume of specific trading pairs Deals biboxsub_spot$pair_deals trading records, including the information of trading price, trading volume, trading sides $pair a trading pair, must be capitalized,optional values: { BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT...... } 6. Subscribe(addChannel) Subscribe(addChannel) and step of receiving data ┌────────┐ ┌────────┐ │ Client │ │ Server │ └───┬────┘ └───┬────┘ │ {\"event\": \"addChannel\", | | \"channel\": \"xxx channel\"} │ ├─────────────────────────────────>│ | | │ {\"channel\": \"xxx channel\", | | \"data\": \"data of channel\"}│ │Note: After subscribing channel successfully, server will send the new corresponding data to client at a certain frequency when the corresponding data of channel updates. Subscribe Format After buliding the connection with WebSocket API, sending the data with the following format to server to subscribe data { \"event\": \"addChannel\", \"channel\": \"channel to sub\" } the correct subcribe { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_BIX_BTC_kline_1min\" } \"channel\" is channel format ,refer to channel format at \"5. Channel Format\". The example of subscribing success return data [{ \"channel\": \"bibox_sub_spot_BIX_BTC_kline_1min\", \"data_type\": 0, //Subscribe one time of returning total value sucessfully, then return increment value \"data\": [ { \"time\":1536310020000, \"open\":\"0.00006614\", \"high\":\"0.00006659\", \"low\":\"0.00006604\", \"close\":\"0.00006652\", \"vol\":\"74056.89597166\" }, { \"time\":1536310080000, \"open\":\"0.00006652\", \"high\":\"0.00006652\", \"low\":\"0.00006652\", \"close\":\"0.00006652\", \"vol\":\"100\" } ] }] \"data_type\" The type of data marked to be returned , 0-return total value, 1-return incremental value data description \"data\": { \"time\": the starting time of K line period, \"open\": the openging price, \"high\": The highest price, \"low\": the lowest price, \"close\": the closing price \"vol\": trading volume } Client will receive the incremental data as long as Kline updates, for example [{ \"channel\": \"bibox_sub_spot_BIX_BTC_kline_1min\", \"data_type\": 1, \"data\": [ { \"time\":1536310020000, \"open\":\"0.00006614\", \"high\":\"0.00006659\", \"low\":\"0.00006604\", \"close\":\"0.00006652\", \"vol\":\"74056.89597166\" }, { \"time\":1536310080000, \"open\":\"0.00006652\", \"high\":\"0.00006652\", \"low\":\"0.00006652\", \"close\":\"0.00006652\", \"vol\":\"100\" } ] }] Note: 2 closest k lines will be returned every time, when incremental value k line be returned example of subscribing wrongly subscribe wrongly (wrong pair, capitalized sensitively) { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_bix_btc_kline_1min\" } The example of subscribing wrongly return data { \"channel\": \"bibox_sub_spot_bix_btc_kline_1min\", \"error\": { \"code\": \"3009\", \"msg\":\"推送订阅channel不合法\" } } 7. Unsubscribe(removeChannel) Unsubscribe Format WebSocket Client can cancel the subscription, WebSocket Server will not send the data of this channel after the cancellation. The format of cancellation is as follows { \"event\": \"removeChannel\", \"channel\": \"xxx channel\" } the correct unsubcribe channel { \"event\": \"removeChannel\", \"channel\": \"bibox_sub_spot_BIX_BTC_kline_1min\" } Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2019-11-13 "},"ws_api_sub.html":{"url":"ws_api_sub.html","title":"WebSocket API Subscribe","keywords":"","body":"WebSocket API Subscribe Subscribe Kline channel: biboxsub_spot$pairkline$period After buliding the connection with WebSocket API, sending the data with the following format to server to subscribe data { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_$pair_kline_$period\" } Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT...... period true string K line period 1min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 12hour, day, week the example of subscribing correctly subscribe correctly { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_BIX_BTC_kline_1min\" } The example of subscribing success return data [{ \"channel\": \"bibox_sub_spot_BIX_BTC_kline_1min\", \"data_type\": 0, //Subscribe one time of returning total value sucessfully, then return increment value \"data\": [ { \"time\":1536310020000, \"open\":\"0.00006614\", \"high\":\"0.00006659\", \"low\":\"0.00006604\", \"close\":\"0.00006652\", \"vol\":\"74056.89597166\" }, { \"time\":1536310080000, \"open\":\"0.00006652\", \"high\":\"0.00006652\", \"low\":\"0.00006652\", \"close\":\"0.00006652\", \"vol\":\"100\" } ] }] \"data_type\" The type of data marked to be returned , 0-return total value, 1-return incremental value data description \"data\": { \"time\": the starting time of K line period, \"open\": the openging price, \"high\": The highest price, \"low\": the lowest price, \"close\": the closing price \"vol\": trading volume } Client will receive the incremental data as long as Kline updates, for example [{ \"channel\": \"bibox_sub_spot_BIX_BTC_kline_1min\", \"data_type\": 1, \"data\": [ { \"time\":1536310020000, \"open\":\"0.00006614\", \"high\":\"0.00006659\", \"low\":\"0.00006604\", \"close\":\"0.00006652\", \"vol\":\"74056.89597166\" }, { \"time\":1536310080000, \"open\":\"0.00006652\", \"high\":\"0.00006652\", \"low\":\"0.00006652\", \"close\":\"0.00006652\", \"vol\":\"100\" } ] }] Note: 2 closest k lines will be returned every time, when incremental value k line be returned example of subscribing wrongly subscribe wrongly (wrong pair, capitalized sensitively) { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_bix_btc_kline_1min\" } The example of subscribing wrongly return data { \"channel\": \"bibox_sub_spot_bix_btc_kline_1min\", \"error\": { \"code\": \"3009\", \"msg\":\"推送订阅channel不合法\" } } Subscribe Market channel: bibox_sub_spot_ALL_ALL_market After buliding the connection with WebSocket API, sending the data with the following format to server to subscribe data { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_ALL_ALL_market\" } subscribe correctly { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_ALL_ALL_market\" } The example of subscribing success return data [{ \"channel\": \"bibox_sub_spot_ALL_ALL_market\", \"data_type\": 0, \"data\": [ { \"id\":1, \"coin_symbol\":\"BIX\", \"currency_symbol\":\"BTC\", \"last\":\"0.00006604\", \"high\":\"0.00006712\", \"low\":\"0.00006421\", \"change\":\"+0.00000121\", \"percent\":\"+1.87%\", \"vol24H\":\"54475636\", \"amount\":\"3571.11\", \"last_cny\":\"2.91\", \"high_cny\":\"2.95\", \"low_cny\":\"2.83\", \"last_usd\":\"0.42\", \"high_usd\":\"0.43\", \"low_usd\":\"0.41\" }, { \"id\":2, \"coin_symbol\":\"BIX\", \"currency_symbol\":\"ETH\", \"last\":\"0.00190235\", \"high\":\"0.00192190\", \"low\":\"0.00181724\", \"change\":\"+0.00008058\", \"percent\":\"+4.42%\", \"vol24H\":\"32059017\", \"amount\":\"59861.18\", \"last_cny\":\"2.90\", \"high_cny\":\"2.93\", \"low_cny\":\"2.77\", \"last_usd\":\"0.42\", \"high_usd\":\"0.42\", \"low_usd\":\"0.40\" }, ... //others ] }] data description { \"id\": pair id \"coin_symbol\": Trading Token \"currency_symbol\": Pricing Token \"last\": 24h the lastest price \"high\": 24h the highest price \"low\": 24h the lowest price \"change\": 24h price change \"percent\": 24h price change percentage \"vol24H\": 24h trading volume \"amount\": 24h trading amount \"last_cny\": The lastest price equivelant to CNY \"high_cny\": The highest price equivelant to CNY \"low_cny\": The lowest price equivelant to CNY \"last_usd\": The lastest price equivelant to USD \"high_usd\": The highest price equivelant to USD \"low_usd\": The lowest price equivelant to USD } Client will receive the incremental data as long as Market updates, for example [{ \"channel\": \"bibox_sub_spot_ALL_ALL_market\", \"data_type\": 1, \"data\": [ { \"id\":1, \"coin_symbol\":\"BIX\", \"currency_symbol\":\"BTC\", \"last\":\"0.00006604\", \"high\":\"0.00006712\", \"low\":\"0.00006421\", \"change\":\"+0.00000121\", \"percent\":\"+1.87%\", \"vol24H\":\"54475636\", \"amount\":\"3571.11\", \"last_cny\":\"2.91\", \"high_cny\":\"2.95\", \"low_cny\":\"2.83\", \"last_usd\":\"0.42\", \"high_usd\":\"0.43\", \"low_usd\":\"0.41\" } ] }] Subscribe Depth channel: biboxsub_spot$pair_depth After buliding the connection with WebSocket API, sending the data with the following format to server to subscribe data { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_$pair_depth\" } Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT...... the example of subscribing correctly subscribe correctly { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_BIX_BTC_depth\" } The example of subscribing success return data [{ \"channel\": \"bibox_sub_spot_BIX_BTC_depth\", \"data_type\": 0, \"data\": { \"pair\":\"BIX_BTC\", \"update_time\":1536648343927, \"asks\":[ { \"price\":\"0.0000683\", \"volume\":\"1048.8046\" }, { \"price\":\"0.00006831\", \"volume\":\"1008.2509\" }, ... // other data ], \"bids\":[ { \"price\":\"0.00006801\", \"volume\":\"2.3472\" }, { \"price\":\"0.00006793\", \"volume\":\"0.3458\" }, ... // other data ] } }] datadescription \"bids\": The depth list of buyers \"asks\": The depth list of sellers { \"price\": order price, \"volume\": order amount } Client will receive the all measured data as long as Depth updates, for example [{ \"channel\": \"bibox_sub_spot_BIX_BTC_depth\", \"data_type\": 1, \"data\": { \"pair\":\"BIX_BTC\", \"update_time\":1536648343927, \"asks\":[ { \"price\":\"0.0000683\", \"volume\":\"1048.8046\" }, { \"price\":\"0.00006831\", \"volume\":\"1008.2509\" }, ... // other data ], \"bids\":[ { \"price\":\"0.00006801\", \"volume\":\"2.3472\" }, { \"price\":\"0.00006793\", \"volume\":\"0.3458\" }, ... // other data ] } }] Subscribe Deals channel: biboxsub_spot$pair_deals { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_$pair_deals\" } Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT...... the example of subscribing correctly subscribe correctly { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_BIX_BTC_deals\" } The example of subscribing success return data [{ \"channel\": \"bibox_sub_spot_BIX_BTC_deals\", \"data_type\": 0, \"data\":[ { \"id\":71890943, \"pair\":\"BIX_BTC\", \"price\":\"0.00006788\", \"amount\":\"9705.9732\", \"time\":1536648308000, \"side\":2 }, { \"id\":71890942, \"pair\":\"BIX_BTC\", \"price\":\"0.00006788\", \"amount\":\"11914.8712\", \"time\":1536648308000, \"side\":2 }, ... // other data ] }] data description { \"id\": Trading history id, \"pair\": Trading pair, \"price\": The average price of trading, \"amount\": trading amount, \"time\": trading timestamp, \"side\": Taker trading side, 1-Buy, 2-Sell } Client will receive the incremental data as long as Deals updates, for example [{ \"channel\": \"bibox_sub_spot_BIX_BTC_depth\", \"data_type\": 1, \"data\":[ { \"price\":\"0.00006788\", \"amount\":\"9705.9732\", \"time\":1536648308000, \"side\":2 }, { \"price\":\"0.00006788\", \"amount\":\"11914.8712\", \"time\":1536648308000, \"side\":2 }, ... // other data ] }] Subscribe Ticker channel: biboxsub_spot$pair_ticker { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_$pair_ticker\" } Name Necessary or not Type Description Default Value Range pair true string Trading pair BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT...... the example of subscribing correctly subscribe correctly { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_BIX_BTC_ticker\" } The example of subscribing success return data [{ \"channel\": \"bibox_sub_spot_BIX_BTC_ticker\", \"data_type\": 0, \"data\":{ \"pair\":\"BIX_BTC\", \"last\":\"0.00006837\", \"last_usd\":\"0.43\", \"last_cny\":\"2.96\", \"high\":\"0.00007401\", \"low\":\"0.00006628\", \"buy\":\"0.00006814\", \"buy_amount\":\"2654.5376\", \"sell\":\"0.00006876\", \"sell_amount\":\"170.3094\", \"vol\":\"48027601\", \"percent\":\"-6.73%\", \"timestamp\":1536650154258, \"base_last_cny\":\"2.96838961\" } }] data description \"data\":{ \"pair\": Trading pair \"last\": the lastest price \"last_cny\": The lastest price equivelant to CNY \"last_usd\": The lastest price equivelant to USD \"high\": 24h The highest price \"low\": 24h the lowest price \"buy\": The highest bid price \"buy_amount\": The highest bid amount \"sell\": The lowest ask price \"sell_amount\": The lowest ask amount \"vol\": 24h trading volume \"percent\": 24h price change percentage \"timestamp\": Timestamp \"base_last_cny\": The lastest trading price, equivalent to CNY (remains 8 decimals) } Client will receive the all measured data as long as Ticker updates, for example [{ \"channel\": \"bibox_sub_spot_BIX_BTC_ticker\", \"data_type\": 1, \"data\":{ \"pair\":\"BIX_BTC\", \"last\":\"0.00006837\", \"last_usd\":\"0.43\", \"last_cny\":\"2.96\", \"high\":\"0.00007401\", \"low\":\"0.00006628\", \"buy\":\"0.00006814\", \"buy_amount\":\"2654.5376\", \"sell\":\"0.00006876\", \"sell_amount\":\"170.3094\", \"vol\":\"48027601\", \"percent\":\"-6.73%\", \"timestamp\":1536650154258, \"base_last_cny\":\"2.96838961\" } }] Subscribe Login channel: bibox_sub_spot_ALL_ALL_login { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_ALL_ALL_login\", \"apikey\": \"thisisyourapikey\", \"sign\": \"thisissigneddata\" } Name Necessary or not Type Description Default Value Range apikey true string Your apikey sign true string Use your apisecret to sign the whole request data Note: Subscription Login channel will push user-related messages, including: assets, pending orders and history of orders Sign Steps 1.Before sign { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_ALL_ALL_login\", \"apikey\": \"thisisyourapikey\" } 2.Sort in ascending with the key of Object { \"apikey\": \"thisisyourapikey\", \"channel\": \"bibox_sub_spot_ALL_ALL_login\", \"event\": \"addChannel\" } 3.Format the data and sign let data = { \"apikey\": \"thisisyourapikey\", \"channel\": \"bibox_sub_spot_ALL_ALL_login\", \"event\": \"addChannel\" }; let secret = \"thisisyourapisecret\"; let sign = CryptoJS.HmacMD5(JSON.stringify(data), secret).toString(); // 签名结果 thisissigneddata 4.Append the signed data to the request params { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_ALL_ALL_login\", \"apikey\": \"thisisyourapikey\", \"sign\": \"thisissigneddata\" } the example of completed signature nodejs implements let CryptoJS = require(\"crypto-js\"); function getSign(data) { let secret = \"your apisecret\"; let sdic = Object.keys(data).sort();//sort in ascending let dataTmp = {}; for(let ki in sdic){ dataTmp[sdic[ki]] = data[sdic[ki]]; } return CryptoJS.HmacMD5(JSON.stringify(dataTmp), secret).toString(); } let data = { \"event\": \"addChannel\", \"channel\": 'bibox_sub_spot_ALL_ALL_login', \"apikey\": \"your apikey\" }; let sign = getSign(data);//return the signed data data.sign = sign; the example of subscribing correctly subscribe correctly { \"event\": \"addChannel\", \"channel\": \"bibox_sub_spot_ALL_ALL_login\", \"apikey\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\", \"sign\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\" } the successful response [{ \"channel\": \"bibox_sub_spot_ALL_ALL_login\", \"data_type\": 0, \"data\":{ result: '订阅成功' } }] Client will receive the incremental data as long as the user-related data(assets, pending orders and history of orders) updates, for example Normal account assets credit --> normal [{ \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", //push compressed data or not, 0-no, 1-yes \"data_type\":1, \"data\":{ \"assets\":{ //Type of Assets \"normal\":{ //Normal assets \"BIX\":{ \"balance\":\"497.59601765\", //Available \"freeze\":\"0.00000000\" //Freeze }, \"USDT\":{ \"balance\":\"20.52027574\", \"freeze\":\"22.12000000\" } } } } }] Credit account assets assets --> credit [{ \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"assets\":{ //Type of Assets \"credit\":{ //Credit assets \"BIX_USDT\":{ //Pair \"BIX\":{ \"balance\":\"681.74441804\", //Available \"freeze\":\"0.00000000\" //Freeze }, \"USDT\":{ \"balance\":\"0.21698199\", \"freeze\":\"0.00000000\" } }, \"BTC_USDT\":{ \"BTC\":{ \"balance\":\"100\", \"freeze\":\"0.00000000\" }, \"USDT\":{ \"balance\":\"10\", \"freeze\":\"0.00000000\" } } } } } }] Note: Credit account assets are distinguished by Pair. The same currencies under different pairs (such as the USDT in BIX_USDT and BTC_USDT) are not related to each other. Spot Pending orders orderpending [{ \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"orderpending\":{ //Type of Pending orders \"id\":159, \"createdAt\": 1512756997000, \"account_type\":0, \"coin_symbol\":\"LTC\", //Trading Token \"currency_symbol\":\"BTC\", //Pricing Token \"order_side\":2, //Trading side 1-Buy, 2-Sell \"order_type\":2, //2-limit order \"price\":\"0.00900000\", //order price \"amount\":\"1.00000000\", //order amount \"money\":\"0.00900000\", //currency amount (price * amount) \"deal_amount\":\"0.00000000\", //deal amount \"deal_percent\":\"0.00%\", //deal percentage \"unexecuted\":\"0.00000000\", //unexecuted amount \"status\":1 //Status, -1-rejected,1-to be dealt, 2-dealt partly, 3-dealt totally, 4- cancelled partly, 5-cancelled totally, 6-to be cancelled } } }] History of spot orders 关键字 history [{ \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"history\":{ //Type of History orders \"id\":\"123432223346763\", \"createdAt\": 1512756997000, \"account_type\":0, \"coin_symbol\":\"LTC\", \"currency_symbol\":\"BTC\", \"order_side\":2, \"order_type\":2, \"price\":\"0.00886500\", \"amount\":\"1.00000000\", \"money\":\"0.00886500\", \"relay_id\":\"11221615825364891\", // Order id \"fee\":0 } } }] Subscribe contract Kline channel: biboxsub_spot$pairkline$period (E.g bibox_sub_spot_4BTC_USDT_kline_1min) referance Subscribe Kline pair parameter of contract: BTCUSDT perpetual contract = 4BTC_USDT, ETHUSDT perpetual contract = 4ETH_USDT, by parity of reasoning data description \"data\": { \"time\": the starting time of a cycle of the k-line, \"count\": transanction completed, \"open\": opening price, \"high\": the highest price, \"low\": the lowest price, \"close\": closing price \"vol\": trading volume (Cont) } Subscribe contract Market channel: bibox_sub_spot_ALL_ALL_market referance Subscribe Market data description { \"id\": trading pair id \"coin_symbol\": trading token, for example: 4BTC, 4ETH \"currency_symbol\": pricing token \"last\": the latest price in 24h \"high\": the highest price in 24h \"low\": the lowest price in 24h \"change\": change in 24h \"percent\": change percent in 24h \"vol24H\": trading volume in 24h (Cont) \"amount\": trading amount in 24h (USDT) \"last_cny\": the latest price in CNY \"high_cny\": the highest price in CNY \"low_cny\": the lowest price in CNY \"last_usd\": the latest price in USD \"high_usd\": the highest price in USD \"low_usd\": the lowest price in USD } Subscribe contract Depth channel: biboxsub_spot$pair_depth (example:bibox_sub_spot_4BTC_USDT_depth) referance Subscribe Depth pair parameter of contract: BTCUSDT perpetual contract = 4BTC_USDT, ETHUSDT perpetual contract = 4ETH_USDT, by parity of reasoning data description \"bids\": buyer's depth list \"asks\": seller's depth list { \"price\": limit order price \"volume\": limit order size (Cont) } Subscribe contract Deals channel: biboxsub_spot$pair_deals (example:bibox_sub_spot_4BTC_USDT_deals) referance Subscribe Deals pair parameter of contract: BTCUSDT perpetual contract = 4BTC_USDT, ETHUSDT perpetual contract = 4ETH_USDT, by parity of reasoning data description { \"id\": transanction history id \"pair\": trading pair, 4BTC_USDT、4ETH_USDT... \"price\": average transaction price \"amount\": deal amount, \"time\": transaction time \"side\": transaction side, 1-open long, 2-open short } Subscribe contract Ticker biboxsub_spot$pair_ticker (example:bibox_sub_spot_4BTC_USDT_ticker) referance Subscribe Ticker pair parameter of contract: BTCUSDT perpetual contract = 4BTC_USDT, ETHUSDT perpetual contract = 4ETH_USDT, by parity of reasoning data description \"data\":{ \"pair\": trading pair \"last\": the latest transaction price \"last_cny\": the latest transaction price in CNY \"last_usd\": the latest transaction price in USD \"high\": the highest price in 24h \"low\": the lowest price in 24h \"buy\": the latest buy-1 price \"buy_amount\": buy-1 amount (Cont) \"sell\": the latest sell-1 price \"sell_amount\": sell-1 amount (Cont) \"vol\": transaction amount in 24h (Cont) \"percent\": change percent in 24h \"timestamp\": timestamp \"base_last_cny\": the latest transaction price in CNY (remaining 8 decimal places) } Subscribe contract Login bibox_sub_spot_ALL_ALL_login referance Subscribe Login The example of dealing returning data contract assets contract_assets [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"contract_assets\":{ \"user_id\":10101010, \"coin_symbol\":\"USDT\", \"balance\":\"99.1823\", // available balance \"freeze\":\"0.7899\", // frozen amount \"profit\":\"-3.6816\", \"margin\":\"0.7899\", // frozen margin \"imargin\":\"0.0000\" // frozen limit order amount } } } ] contract position contract_order contract_order [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"contract_order\":{ \"user_id\":10101010, \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // contract symbol \"order_side\":2, // position side, 1long, 2short \"price\":\"3949.7850\", // average open position price \"price_up\":\"4009.0200\", // average limit order price in long position \"price_down\":\"3946.0300\", // average limit order price in short position \"fee_rate\":\"0.0000\", \"contract\":2, // position size (Cont) \"margin\":\"1.5799\", // margin \"imargin\":\"0.0000\", // limit order amount \"icontract_up\":1, // uncompleted Cont of limit order in long position \"icontract_down\":0, // uncompleted Cont of limit order in short position \"leverage\":\"50\", // leverage, o represents Cross margin \"price_force\":\"4009.0318\", // forced liquidation price \"price_alert\":\"3989.2829\", // forced liquidation alart price \"profit\":\"-3.5492\" } } } ] contract order pending contract_pending [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"contract_pending\":{ \"id\":\"628754\", // order number \"user_id\":10101010, \"client_oid\": \"1589868279533\", \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // contract symbol \"order_side\":1, // 1long, 2short \"order_type\":1, \"price\":\"4009.0200\", // order price \"contract\":1, // order size \"order_from\":1, \"status\":3, // 0,1:uncompleted; 2:partly completed; 3:completed; 4: partly cancel; 5 cancel completed; 6,7 system cancel; >=100 order fail \"price_deal\":\"3952.5600\", // average transaction price \"contract_deal\":1, // completed Cont \"deal_count\":1, \"createdAt\":1550671734000, // order time \"updatedAt\":1550671734000 } } } ] transaction records contract_detail [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"contract_detail\":{ \"order_id\":\"628754\", // order id \"user_id\":10101010, \"coin_symbol\":\"USDT\", \"pair\":\"4BTC_USDT\", // contract symbol \"order_side\":1, // 1long, 2short \"order_type\":1, // 1market price, 2limit price \"order_from\":1, \"contract\":1, // deal number \"price\":\"4009.0200\", // open position price \"price_deal\":\"3952.5600\", // transaction price \"fee\":\"0.0000\", // transaction fee \"is_maker\":0, // maker or not \"is_cancel\":0, // canceled order or not \"is_persist\":0, \"force_sub\":0, \"createdAt\":1550671735000, // generation time \"updatedAt\":1550671735000 } } } ] position change records contract_deal_log { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"contract_deal_log\":{ \"id\":\"1125899906842966183\", \"user_id\":10040000, \"type\":\"1\", // 1 open orders,2 close orders,3 liquidation,4 ADL \"pair\":\"4ETH_USDT\", \"coin_symbol\":\"USDT\", \"price_open\":\"182.2091272149\", // position open price \"price\":\"181.1900\", // order open price \"price_deal\":\"181.1900\", // order deal price \"contract\":\"1\", // deal amount, maybe Subscribe indexMarket channel: bibox_sub_spot_ALL_ALL_indexMarket After buliding the connection with WebSocket API, sending the data with the following format to server to subscribe data { \"event\":\"addChannel\", \"channel\":\"bibox_sub_spot_ALL_ALL_indexMarket\", \"binary\":1 } Dealt correctly { \"event\":\"addChannel\", \"channel\":\"bibox_sub_spot_ALL_ALL_indexMarket\", \"binary\":1 } The example of dealing returning data successfully [ { \"id\":147, \"is_hide\":0, \"pair_type\":0, \"area_id\":15, \"coin_symbol\":\"ETH\", \"currency_symbol\":\"USDT\", \"last\":\"147.1849\", \"high\":\"148.3986\", \"low\":\"140.4113\", \"change\":\"-0.5364\", \"percent\":\"-0.36%\", \"vol24H\":\"43108\", \"amount\":\"6240970.83\", \"last_cny\":\"989.4382\", \"base_last_cny\":\"\", \"high_cny\":\"997.5971\", \"low_cny\":\"943.9036\", \"last_usd\":\"147.1848\", \"high_usd\":\"148.3985\", \"low_usd\":\"140.4113\" }, { \"id\":146, \"is_hide\":0, \"pair_type\":0, \"area_id\":15, \"coin_symbol\":\"BTC\", \"currency_symbol\":\"USDT\", \"last\":\"3955.1652\", \"high\":\"3993.1069\", \"low\":\"3880.6072\", \"change\":\"+6.1701\", \"percent\":\"+0.16%\", \"vol24H\":\"43109\", \"amount\":\"169654088.16\", \"last_cny\":\"26588.2733\", \"base_last_cny\":\"\", \"high_cny\":\"26843.3333\", \"low_cny\":\"26087.0635\", \"last_usd\":\"3955.1651\", \"high_usd\":\"3993.1068\", \"low_usd\":\"3880.6072\" } ] data description description { \"id\":147, \"is_hide\":0, \"pair_type\":0, \"area_id\":15, \"coin_symbol\":\"ETH\", // token symbol \"currency_symbol\":\"USDT\", // currency of price,USDTFUND stands for premium index \"last\":\"147.1867\", // the latest price \"high\":\"148.3986\", \"low\":\"140.4113\", \"change\":\"-0.5346\", \"percent\":\"-0.36%\", \"vol24H\":\"43109\", \"amount\":\"6241118.04\", \"last_cny\":\"989.4508\", \"base_last_cny\":\"\", \"high_cny\":\"997.5971\", \"low_cny\":\"943.9036\", \"last_usd\":\"147.1867\", \"high_usd\":\"148.3985\", \"low_usd\":\"140.4113\" } Client will receive data as long as the index updated, for example { \"id\":147, \"is_hide\":0, \"pair_type\":0, \"area_id\":15, \"coin_symbol\":\"ETH\", \"currency_symbol\":\"USDT\", \"last\":\"147.1867\", \"high\":\"148.3986\", \"low\":\"140.4113\", \"change\":\"-0.5346\", \"percent\":\"-0.36%\", \"vol24H\":\"43109\", \"amount\":\"6241118.04\", \"last_cny\":\"989.4508\", \"base_last_cny\":\"\", \"high_cny\":\"997.5971\", \"low_cny\":\"943.9036\", \"last_usd\":\"147.1867\", \"high_usd\":\"148.3985\", \"low_usd\":\"140.4113\" } Subscribe the price limit of taking contract orders channel: bibox_sub_spot_ALL_ALL_contractPriceLimit After buliding the connection with WebSocket API, sending the data with the following format to server to subscribe data { \"event\":\"addChannel\", \"channel\":\"bibox_sub_spot_ALL_ALL_contractPriceLimit\", \"binary\":1 } Dealt correctly { \"event\":\"addChannel\", \"channel\":\"bibox_sub_spot_ALL_ALL_contractPriceLimit\", \"binary\":1 } The example of dealing returning data successfully { \"4BTC_USDT\":{ \"min_up\":\"2964.4562\", \"max_up\":\"4090.9496\", \"min_down\":\"3814.2670\", \"max_down\":\"4940.7603\", \"market_up\":\"4090.9496\", \"market_down\":\"3814.2670\" }, \"4ETH_USDT\":{ \"min_up\":\"110.3038\", \"max_up\":\"155.1606\", \"min_down\":\"138.9828\", \"max_down\":\"183.8396\", \"market_up\":\"155.1606\", \"market_down\":\"138.9828\" } } data description { \"4BTC_USDT\":{ // contract symbol \"min_up\":\"2964.4562\", // minimum price of opening long \"max_up\":\"4090.9496\", // maximum price of opening long \"min_down\":\"3814.2670\", // minimum price of opening short \"max_down\":\"4940.7603\", // maximum price of opening short \"market_up\":\"4090.9496\", // maximum price of opening long at the market price \"market_down\":\"3814.2670\" // minimum price of opening short at the market price } } Client will receive data as long as the limit of order price updated, for example { \"4BTC_USDT\":{ \"min_up\":\"2964.4562\", \"max_up\":\"4090.9496\", \"min_down\":\"3814.2670\", \"max_down\":\"4940.7603\", \"market_up\":\"4090.9496\", \"market_down\":\"3814.2670\" }, \"4ETH_USDT\":{ \"min_up\":\"110.3038\", \"max_up\":\"155.1606\", \"min_down\":\"138.9828\", \"max_down\":\"183.8396\", \"market_up\":\"155.1606\", \"market_down\":\"138.9828\" } } Coin-based contract subscribing to Kline data wss://push.bibox.me/cbc channel: biboxsub_spot$pairkline$period (E.g bibox_sub_spot_5BTC_USD_kline_1min) referance Subscribe Kline example { event: 'addChannel', channel: 'bibox_sub_spot_5BTC_USD_kline_1min', binary: 0, ver: 8, } Pair parameters of coin-based contracts: BTCUSDT perpetual = 5BTC_USD, ETHUSDT perpetual = 5ETH_USD, and so on data description \"data\": { \"time\": the starting time of K line period, \"open\": the openging price, \"high\": The highest price, \"low\": the lowest price, \"close\": the closing price \"vol\": trading volume } Coin-based contract subscription mark price wss://push.bibox.me/cbc channel: biboxsub_spot$pairTAGPRICE_kline_1min (E.g bibox_sub_spot_5BTC_USDTAGPRICE_kline_1min) referance Subscribe Market example { event: 'addChannel', channel: 'bibox_sub_spot_5BTC_USDTAGPRICE_kline_1min', binary: 0, ver: 8, } Pair parameters of coin-based contracts: BTCUSDT perpetual = 5BTC_USD, ETHUSDT perpetual = 5ETH_USD, and so on data description \"data\": { \"time\": the starting time of K line period, \"open\": the openging price, \"high\": The highest price, \"low\": the lowest price, \"close\": the closing price \"vol\": ignore } Coin-based contract subscription depth wss://push.bibox.me/cbc channel: biboxsub_spot$pair_depth (E.g bibox_sub_spot_5BTC_USD_depth) referance Subscribe Depth example { event: 'addChannel', channel: 'bibox_sub_spot_5BTC_USD_depth', // depth binary: 0, ver: 3, } Pair parameters of coin-based contracts: BTCUSDT perpetual = 5BTC_USD, ETHUSDT perpetual = 5ETH_USD, and so on data description \"bids\": The depth list of buyers \"asks\": The depth list of sellers { \"price\": order price, \"volume\": order amount } Coin-based contract subscription deals records wss://push.bibox.me/cbc channel: biboxsub_spot$pair_deals (例:bibox_sub_spot_5BTC_USD_deals) referance 订阅 Deals 数据 example { event: 'addChannel', channel: 'bibox_sub_spot_5BTC_USD_deals', binary: 0, } Pair parameters of coin-based contracts: BTCUSDT perpetual = 5BTC_USD, ETHUSDT perpetual = 5ETH_USD, and so on data description { \"id\": Trading history id, \"pair\": Trading pair, \"price\": The average price of trading, \"amount\": trading amount, \"time\": trading timestamp, \"side\": Taker trading side, 1-Buy, 2-Sell } Coin-based contract subscription ticker wss://push.bibox.me/cbc biboxsub_spot$pair_ticker (例:bibox_sub_spot_5BTC_USD_ticker) referance Subscribe Ticker Pair parameters of coin-based contracts: BTCUSDT perpetual = 5BTC_USD, ETHUSDT perpetual = 5ETH_USD, and so on data description \"data\":{ \"pair\": Trading pair \"last\": the lastest price \"last_cny\": The lastest price equivelant to CNY \"last_usd\": The lastest price equivelant to USD \"high\": 24h The highest price \"low\": 24h the lowest price \"buy\": The highest bid price \"buy_amount\": The highest bid amount \"sell\": The lowest ask price \"sell_amount\": The lowest ask amount \"vol\": 24h trading volume \"percent\": 24h price change percentage \"timestamp\": Timestamp \"base_last_cny\": The lastest trading price, equivalent to CNY (remains 8 decimals) } Coin-based contract subscription user data wss://push.bibox.me/cbc bibox_sub_spot_ALL_ALL_login referance Subscribe user data Return data example Coin-based contract assets cbc_assets [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"cbc_assets\":{ \"b\":\"1\", \"c\":\"BTC\", \"u\":100006, \"f\":\"0\", \"m\":\"0\" } } } ] Coin-based contract position cbc_order [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"cbc_order\":{ \"pt\":\"0\", \"f\":\"0\", \"l\":\"10\", \"sd\":2, \"pa\":\"1.0006153088\", \"ui\":100006, \"fb0\":\"0\", \"pf\":\"1.0006148393\", \"md\":1, \"lc\":\"0\", \"pi\":\"5BTC_USD\", \"mg\":\"0\", \"hc\":\"0\", \"fb\":\"0\", \"po\":\"0\" } } } ] Coin-based contract pending order cbc_pending [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"cbc_pending\":{ \"f\":\"0\", \"dp\":\"0\", \"eq\":\"0\", \"p\":\"11692\", \"tif\":0, \"q\":\"1\", \"sd\":2, \"r\":0, \"s\":1, \"t\":1602750121093, \"ui\":100006, \"fz\":\"0.0000086786\", \"fb0\":\"0\", \"of\":4, \"pi\":\"5BTC_USD\", \"oi\":\"432108069716000\", \"coi\":\"1602750117690\", \"fb\":\"0\", \"po\":false } } } ] Coin-based contract deal records cbc_detail [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"cbc_detail\":{ \"oi\":\"432108069715999\",//order id \"ui\":\"100006\",//user id \"id\":\"1125899906842648855\",// record id \"coi\":\"1602750117684\",//client order id \"pi\":\"5BTC_USD\",//pair \"sd\":1,// \"s\":3,// \"ot\":2, \"of\":4,// order source \"q\":\"1\", \"p\":\"11692\",//target parice \"dp\":\"10655\",//deal price \"ep\":\"1\", \"f\":\"0.0000000657\",//fee \"fb\":\"0\",//bix deduction \"fb0\":\"0\",//Coupon deduction \"im\":0,//is maker \"t\":1602750121093//time } } } ] Coin-based contract position change records cbc_deal_log [ { \"channel\":\"bibox_sub_spot_ALL_ALL_login\", \"binary\":\"0\", \"data_type\":1, \"data\":{ \"cbc_deal_log\":{ \"id\":\"1125899906842654296\",// record id \"user_id\":100006,//user id \"type\":5,//Change type, 1 open position, 2 close position, 3 lighten position to reduce risk level, 4 liquidate position, 5ADL \"mode\":2,//position mode, 1 cross, 2 fixed \"pair\":\"5BTC_USD\",//pair \"price\":\"11247.6\",//proposed price \"hold_dx\":\"1\",//Change in position \"order_side\":2,// position side, 1 long, 2 short \"time\":1602755131000//time } } } ] Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2020-10-30 "},"error_code.html":{"url":"error_code.html","title":"Error code","keywords":"","body":"Error code code msg 2003 Cookie expired 2033 Operation failed! Order completed or canceled 2034 Operation failed! Please check parameter 2040 Operation failed! No record 2064 Canceling. Unable to cancel again 2065 Precatory price is exorbitant, please reset 2066 Precatory price is low , please reset 2067 Limit Order Only 2068 Min Amount:0.0001 2069 Market order can not be canceled 2078 unvalid order price 2085 the trade amount is low 2086 Abnormal account assets, trade is forbiden 2091 request is too frequency, please try again later 2092 Minimum amount not met 3000 Requested parameter incorrect 3002 Parameter cannot be null 3009 Illegal subscription channel 3010 websocket connection error 3017 Illegal subscribe event 3011 Interface does not support apikey request method 3012 Invalid apikey 3016 Trading pair error 3024 apikey authorization insufficient 3025 apikey signature verification failed 3026 apikey ip is restricted 3027 No apikey in your account 3028 Account apikey has exceeded the limit amount 3029 apikey ip has exceeded the limit amount 3033 query allow only one cmd 3034 maxinum cmds 3035 too many cmds 4000 the network is unstable now, please try again later 4003 The server is busy, please try again later Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2019-11-13 "}}