### Get User Positions Response Example Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading The response returns a list of position objects containing details such as leverage, margin, and take-profit/stop-loss configurations. ```json { "msg": "success", "code": 0, "data": [{ "positionID": "", // Position ID "symbol": "", // Trading pair "side": 0, // Position side (1: Buy, 2: Sell) "leverage": 0, // Leverage multiple used "price": "", // Average transaction price "amount": "", // Position quantity "frozenAmount": "", // Frozen quantity for liquidation "margin": "", // Margin held for the position "triggerType": 1, // Trigger type for take profit and stop loss: 1 = Transaction price, 2 = Index price "spPrice": "", // Take profit price "slPrice": "", // Stop loss price "openProfit": "", // Unrealized profit/loss "updatedAt": 0, // Timestamp "spSlModel": 0, // Take profit and stop loss model: 1 = Full take profit and stop loss, 2 = Partial take profit and stop loss "spType": 0, // Take profit type: 0 = Not set, 1 = Limit price, 2 = Market price "slType": 0, // Stop loss type: 0 = Not set, 1 = Limit price, 2 = Market price "spTriggerPrice": "", // Take profit trigger price "slTriggerPrice": "", // Stop loss trigger price "spSlPartData": [ // Partial take profit and stop loss data { "id": 0, "triggerType": 1, // Trigger type for take profit and stop loss "spPrice": "", // Take profit price "slPrice": "", // Stop loss price "amount": "", // Quantity for take profit and stop loss "spType": 1, // Take profit type: 0 = Not set, 1 = Limit price, 2 = Market price "slType": 1, // Stop loss type: 0 = Not set, 1 = Limit price, 2 = Market price "spTriggerPrice": "", // Take profit trigger price "slTriggerPrice": "" // Stop loss trigger price } ] }] } ``` -------------------------------- ### Order Request URL Example Source: https://apidoc.hibt.co/hibt-openapi-en/spot-trading-market-maker Example of a full REST API request URL for querying order details with query parameters. ```text https://api.hibt0.com/open-api/v1/trade/order?amount=0.12&direction=ASK&price=7126.4285&symbol=BTC_USDT&reqTime=1672502400000 ``` -------------------------------- ### Server Time Response Source: https://apidoc.hibt.co/hibt-openapi-cn Example response for the system time endpoint. ```json { "message": "success", "code": "0", "data": 1672502400000 } ``` -------------------------------- ### Sorted Request Parameters Source: https://apidoc.hibt.co/hibt-openapi-en/spot-trading-market-maker Example of request parameters sorted in ASCII order for signature calculation. ```text amount=0.12&direction=ASK&price=7126.4285&reqTime=1672502400000&symbol=BTC_USDT ``` -------------------------------- ### Retrieve Account Balance Response Source: https://apidoc.hibt.co/hibt-openapi-en/spot-trading-market-maker Example JSON response for the account balance endpoint. ```json { "message": "success", "code": "0", "data": [ { "coin": "USDT", "balance": 1000, "frozenBalance": 1000, "isLock": "IS_FALSE" },{ "coin": BTC, "balance": 1, "frozenBalance": 0.01, "isLock": "IS_TRUE" } ] } ``` -------------------------------- ### Order Query Request URL Source: https://apidoc.hibt.co/hibt-openapi-en Example URL for querying order details with query parameters. ```text https://api.hibt0.com/user-open-api/v1/trade/order?amount=0.12&direction=ASK&price=7126.4285&symbol=BTC/USDT&reqTime=1672502400000 ``` -------------------------------- ### Retrieve Completed Conditional Orders Response Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Example response structure for the GET /v2/entrust/finished endpoint. ```json { "msg": "success", "code": 0, "data": { "total": 100, // Total number of orders "page": 1, // Current page number "data": [{ "id": "", // Order ID "symbol": "", // Trading pair "leverage": 0, // Leverage "triggerType": 1, // Trigger type: 1 = Last price, 2 = Index price "triggerPrice": "", // Trigger price "status": 2, // Order status: 1 = Pending, 2 = Placed, 3 = Cancelled by user, 4 = Cancelled by system "side": 1, // Trading direction: 1 = Buy, 2 = Sell "price": "", // Order price "startPrice": "", // Trigger order price "amount": "", // Order quantity "spSlTriggerType": 0, // Take profit/stop loss trigger type "spPrice": "", // Preset take profit price "slPrice": "", // Preset stop loss price "isSetSp": false, // Is take profit set "isSetSl": false, // Is stop loss set "frozen": "", // Frozen margin "createdAt": 0, // Creation timestamp "updatedAt": 0 // Last update timestamp }] } } ``` -------------------------------- ### Trading Pairs Information Response Source: https://apidoc.hibt.co/hibt-openapi-cn Example response containing details for all available trading pairs. ```json { "message": "success", "code": "0", "data": [ { "symbol": "BTC/USDT", // 交易对 "baseCoinScale": 4, // 计价币数量精度 "coinScale": 4, // 商品币数量精度 "priceScale": 2, // 价格精度 "baseSymbol": "USDT", // 基础币 "coinSymbol":"BTC", // 计价币 "minTurnover": 10, // 最小挂单成交额 "minVolume": 0.001, // 最小下单量 "maxVolume": 50, // 最大下单量 "enable": 1 // 是否启用 }, { "symbol": "ETH/USDT", "baseCoinScale": 4, "coinScale": 4, "baseSymbol": "USDT", "coinSymbol":"ETH", "minTurnover": 10, "minVolume": 0.01, "maxVolume": 500, "enable": 1 } ] } ``` -------------------------------- ### POST /v1/trade/order Source: https://apidoc.hibt.co/hibt-openapi-en Example endpoint for placing a trade order, demonstrating parameter sorting and signature requirements. ```APIDOC ## POST /v1/trade/order ### Description Places a new spot trade order. This is a private interface requiring signature authentication. ### Method POST ### Endpoint /v1/trade/order ### Parameters #### Request Body - **amount** (decimal) - Required - The quantity of the base currency. - **direction** (string) - Required - Order side (e.g., ASK or BID). - **price** (decimal) - Required - The price per unit. - **symbol** (string) - Required - The trading pair (e.g., BTC/USDT). - **reqTime** (long) - Required - The latest server time obtained from /v1/common/systemTime. ### Request Example { "amount": 0.12, "direction": "ASK", "price": 7126.4285, "symbol": "BTC/USDT", "reqTime": 1672502400000 } ### Response #### Success Response (200) - **message** (string) - Status message. - **code** (string) - Status code. - **data** (object) - Order details. ``` -------------------------------- ### GET /v1/common/systemTime Source: https://apidoc.hibt.co/hibt-openapi-en Retrieves the current server timestamp. ```APIDOC ## GET /v1/common/systemTime ### Description Retrieves the current server timestamp. ### Method GET ### Endpoint /v1/common/systemTime ### Parameters This endpoint does not accept any parameters. ### Response #### Success Response (200) - **data** (long) - Server timestamp ### Response Example ```json { "message": "success", "code": "0", "data": 1672502400000 } ``` ``` -------------------------------- ### Get All Trading Pair Information Source: https://apidoc.hibt.co/hibt-openapi-en Fetches details for all available trading pairs. This includes precision settings, currency symbols, and trading limits. No authentication is needed. ```json { "message": "success", "code": "0", "data": [ { "symbol": "BTC/USDT", // Trading pair "baseCoinScale": 4, // Precision of quote currency amount "coinScale": 4, // Precision of base currency amount "priceScale": 2, // Price precision "baseSymbol": "USDT", // Quote currency "coinSymbol": "BTC", // Base currency "minTurnover": 10, // Minimum order value "minVolume": 0.001, // Minimum order quantity "maxVolume": 50, // Maximum order quantity "enable": 1 // Whether it is enabled }, { "symbol": "ETH/USDT", "baseCoinScale": 4, "coinScale": 4, "baseSymbol": "USDT", "coinSymbol": "ETH", "minTurnover": 10, "minVolume": 0.01, "maxVolume": 500, "enable": 1 } ] } ``` -------------------------------- ### Ticker Price Response Source: https://apidoc.hibt.co/hibt-openapi-cn Example response for the latest ticker price of a trading pair. ```json { "message": "success", "code": "0", "data": { "tickerPrice": 40000 } } ``` -------------------------------- ### GET /v2/market/symbols Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Retrieves a list of all available trading pairs and their configuration details. ```APIDOC ## GET /v2/market/symbols ### Description Retrieves a list of all available trading pairs and their configuration details including precision and minimum order amounts. ### Method GET ### Endpoint /v2/market/symbols ### Response #### Success Response (200) - **code** (integer) - Status code - **msg** (string) - Status message - **data** (array) - List of trading pairs #### Response Example { "msg": "success", "code": 0, "data": [ { "symbol": "", "supportTrade": true, "volumePrecision": 0, "pricePrecision": 0, "marketMiniAmount": "", "limitMiniAmount": "" } ] } ``` -------------------------------- ### Response Example for Unfinished Orders Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading The response returns a list of order objects containing details such as order status, type, side, and pricing information. ```json { "msg": "success", "code": 0, "data": [{ "id": "", // Order ID "customID": "", // Custom Order ID "symbol": "", // Trading Pair "type": 1, // Order Type: 1 = Limit, 2 = Market "action": 0, // Order Event: 0 = Open, 1 = Close, 2 = Stop Loss, 3 = Take Profit, 4 = Forced Close, 5 = FOK Forced Close, 6 = ADL Reduce Position, 7 = Add Position, 8 = Reverse Open, 9 = Margin Call "side": 1, // Trading Direction: 1 = Buy, 2 = Sell "positionID": "", // Position ID "price": "", // Order Price (only valid for limit orders) "leverage": 0, // Leverage "amount": "", // Order Quantity "frozen": "", // Frozen Margin "filledAmount": "", // Filled Quantity "filledPrice": "", // Average Filled Price "filledValue": "", // Filled Value "triggerType": 2, // Trigger Type for Stop Loss/Take Profit: 1 = Last Price, 2 = Index Price "spPrice": "", // Preset Take Profit Price "slPrice": "", // Preset Stop Loss Price "state": 1, // Order Status: 1 = Active, 2 = Filled, 3 = Cancelled, 4 = Partially Filled, 5 = Partially Filled & Cancelled, 6 = Cancelling "profit": "", // Realized Profit/Loss (for closed orders) "fee": "", // Original Fee "pointFee": "", // Fee Discounted by Points/Bonuses "pointProfit": "", // Profit/Loss Discounted by Points/Bonuses "closePrice": "", // Liquidation Price "triggerPrice": "", // Trigger Price "createdAt": 0, // Creation Timestamp "updatedAt": 0 // Last Update Timestamp }] } ``` -------------------------------- ### Retrieve All Trading Pairs API Response Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Example response for retrieving all available trading pairs, including details like symbol, trading support, and precision. ```json { "msg": "success", "code": 0, "data": [ { "symbol": "", // Trading pair symbol "supportTrade": true, // Whether trading is supported "volumePrecision": 0, // Precision of the trading volume (number of decimal places after the decimal point) "pricePrecision": 0, // Precision of the trading price (number of decimal places after the decimal point) "marketMiniAmount": "", // Minimum market order quantity for the trading pair "limitMiniAmount": "" // Minimum limit order quantity for the trading pair } ] } ``` -------------------------------- ### Open Position POST Request Body Example Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading This JSON object represents the body content for an Open Position POST request. Ensure all parameters are included and correctly formatted. ```json { "customID": "11111", // Your custom order ID "symbol": "btc_usdt", // Trading pair "type": 1, // 1: Limit order, 2: Market order "side": 1, // Direction: 1 for buy, 2 for sell "leverage": 10, // Leverage "price": "2660", // Order price (used for limit orders). Not required for market orders. "amount": "0.01", // Order quantity "triggerType": 2, // Trigger type for take-profit/stop-loss: 1 for trade price, 2 for index price. Can be omitted if not setting take-profit/stop-loss. "spPrice": "2770", // Preset take-profit price. Not required if not setting take-profit. "slPrice": "2450", // Preset stop-loss price. Not required if not setting stop-loss. "isSetSp": true, // Whether to set take-profit "isSetSl": true, // Whether to set stop-loss "timestamp": 1724916869475 // Current timestamp in milliseconds } ``` -------------------------------- ### Market Depth Response Source: https://apidoc.hibt.co/hibt-openapi-cn Example response for the order book depth data of a trading pair. ```json { "message": "success", "code": "0", "data": { "symbol" : "BTC/USDT", "timestamp" : "1723199363658", "bids" : [ [ "36074.99", "0.27225537" ], [ "36074.81", "0.00967628" ] ], "asks" : [ [ "36075.06", "0.55858424" ], [ "36075.24", "0.22475193" ] ] } } ``` -------------------------------- ### Get Account Balance Source: https://apidoc.hibt.co/hibt-openapi-en Retrieve the balance information for a specified currency. Requires authentication. ```json { "message": "success", "code": "0", "data": [ { "coin": "USDT", "balance": 1000, "frozenBalance": 1000, "isLock": "IS_FALSE" },{ "coin": "BTC", "balance": 1, "frozenBalance": 0.01, "isLock": "IS_TRUE" } ] } ``` -------------------------------- ### Request Signing and Authentication Source: https://apidoc.hibt.co/hibt-openapi-cn Examples of the request URL, sorted parameters, and the resulting HMAC SHA256 signature for a trade order request. ```text https://api.hibt0.com/user-open-api/v1/trade/order?amount=0.12&direction=ASK&price=7126.4285&symbol=BTC/USDT&reqTime=1672502400000 ``` ```text amount=0.12&direction=ASK&price=7126.4285&reqTime=1672502400000&symbol=BTC/USDT×tamp=1672502400000 ``` ```text 550ac73ace8c34372e0e1dd6631e890c7bd16697af8bb4e2908e966b50aba4e0 ``` -------------------------------- ### Get Rebate List Source: https://apidoc.hibt.co/hibt-openapi-en Retrieves a list of rebates earned by the user. This endpoint requires authentication and has a rate limit of 5 requests per second. ```json { "message": "success", "code": "0", "data": [ { "invitedUID": "123456", "parentUID": "45678", "coin": "BTC", "rebateAmount": 0.1, "rebateUsdtAmount": 0.1, "createTime": 1672502400000 } ] } ``` -------------------------------- ### GET /v1/common/systemTime Source: https://apidoc.hibt.co/hibt-openapi-cn Retrieves the current server time in milliseconds, which is required for generating valid request signatures. ```APIDOC ## GET /v1/common/systemTime ### Description Retrieves the current server time in milliseconds. ### Method GET ### Endpoint /v1/common/systemTime ### Response #### Success Response (200) - **data** (long) - Current server timestamp in milliseconds #### Response Example { "message": "success", "code": "0", "data": 1672502400000 } ``` -------------------------------- ### Open Order Request Body Example Source: https://apidoc.hibt.co/hibt-openapi-cn/he-yue-jiao-yi This JSON object represents the body of a POST request for placing an open order. Ensure all required fields are populated and the timestamp is current. ```json { "customID": "11111", //您的自定义订单id "symbol": "btc_usdt",//交易币对 "type": 1,// 1限价 2市价 "side": 1,// 方向 1 buy 2 shell "leverage": 10, //杠杆 "price": "2660", //下单价(限价委托使用) 非限价单不需要传此字段 "amount": "0.01", //下单量 "triggerType": 2, //止盈止损出发类型 1:成交价触发,2:指数价触发 不设置止盈止损可以不填 "spPrice":"2770", //预设止盈价格 不设置止盈 不需要传此字段 "slPrice":"2450", //预设止损价 不设置止损 不需要传此字段 "isSetSp": true, //是否止盈 "isSetSl": true, //是否止损 "timestamp": 1724916869475 //当前时间戳 ms } ``` -------------------------------- ### GET /v2/account/balanceRecord Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Retrieves a list of account balance records. Supports filtering by symbol, time range, event type, and limit. Authentication is required. ```APIDOC ## GET /v2/account/balanceRecord ### Description Retrieves a list of account balance records. Supports filtering by symbol, time range, event type, and limit. Authentication is required. ### Method GET ### Endpoint /v2/account/balanceRecord ### Parameters #### Query Parameters - **symbol** (string) - Optional - Trading pair - **startTime** (int64) - Optional - Start time in ms (interval: 30 days) - **endTime** (int64) - Optional - End time in ms (interval: 30 days) - **event** (int) - Optional - Event type: 1: Deposit, 2: Deduction, 3: Transfer In, 4: Transfer Out, 9: Funding Fee, 201: Open Long, 202: Open Short, 204: Close Long, 205: Close Short, 206: Forced Liquidation - **limit** (int) - Optional - Number of entries (default: 500, max: 1000) - **timestamp** (any) - Required - Current timestamp ### Response #### Success Response (200) - **msg** (string) - Success message - **code** (int) - Response code (0 for success) - **data** (array) - Array of balance record objects - **id** (string) - Transaction ID - **event** (int) - Type: 1: Deposit, 2: Withdrawal, 3: Transfer In, 4: Transfer Out, 9: Funding Fee, 201: Long Position Open, 202: Short Position Open, 204: Long Position Close, 205: Short Position Close, 206: Liquidation - **amount** (string) - Amount representing either balance-related operations or profit/loss for trading-related operations - **coin** (string) - Cryptocurrency - **fee** (string) - Transaction fee - **symbol** (string) - Associated trading pair - **note** (string) - Remarks - **createdAt** (int64) - Timestamp #### Response Example ```json { "msg": "success", "code": 0, "data": [ { "id": "", "event": 0, "amount": "", "coin": "", "fee": "", "symbol": "", "note": "", "createdAt": 0 } ] } ``` ``` -------------------------------- ### Get Bill List Source: https://apidoc.hibt.co/hibt-openapi-en Retrieve bill list data for a specified currency. Requires currency, start time, and end time as parameters. Authentication is necessary. ```json { "message": "success", "code": "0", "data": [ { "uid": "123456", "firstLevelBillType": 2, "secondLevelBillType": 4, "tradeType": 1, "amount": 15.00, "coinUnit": "USDT", "createTime": 1672502400000 } ] } ``` -------------------------------- ### Get Account Trade History Response Example Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading This JSON structure represents a successful response when retrieving account trade history. It includes details for each trade, such as order ID, symbol, type, side, price, quantity, and timestamps. ```json { "msg": "success", "code": 0, "data": [{ "id": "", // Order ID "symbol": "", // Contract identifier "type": 0, // Order type (1: Limit, 2: Market) "action": 0, // Order event (0: Open, 1: Close, 2: Stop Loss, 3: Take Profit, 4: Liquidation, 5: FOK Liquidation, 6: ADL Reduction, 7: Margin Increase, 8: Opposite Position, 9: Margin Call) "side": 0, // Trading direction (1: Buy, 2: Sell) "positionId": "", // Position ID "price": "", // Order price (only for Limit orders) "leverage": 0, // Leverage multiple "amount": "", // Order quantity "frozen": "", // Frozen margin (OpenPrice * Amount * BaseMarginRate) "filledAmount": "", // Filled quantity "filledPrice": "", // Weighted average price of filled orders "filledValue": "", // Total value of filled orders "triggerType": 0, // Trigger type for Take Profit and Stop Loss (1: Transaction price, 2: Index price) "spPrice": "", // Preset Take Profit price "slPrice": "", // Preset Stop Loss price "createdAt": 0, // Creation time "updatedAt": 0, // Last update time "state": 0, // Order state (1: Normal, 2: Completed, 3: Canceled, 4: Partially Filled, 5: Partially Filled & Canceled, 6: Canceling) "profit": "", // Realized profit/loss (for closed orders) "fee": "", // Transaction fee "pointFee": "", // Fee deduction using points (bonuses) "pointProfit": "", // Profit/loss deduction using points (bonuses) "closePrice": "" // Bankruptcy price }] } ``` -------------------------------- ### POST /open-api/v2/order/open Source: https://apidoc.hibt.co/hibt-openapi-cn/he-yue-jiao-yi Endpoint to place a new contract order. ```APIDOC ## POST /open-api/v2/order/open ### Description Places a new contract order (limit or market). ### Method POST ### Request Body - **customID** (string) - Required - Custom order ID - **symbol** (string) - Required - Trading pair (e.g., btc_usdt) - **type** (int) - Required - 1: Limit, 2: Market - **side** (int) - Required - 1: Buy, 2: Sell - **leverage** (int) - Required - Leverage multiplier - **price** (string) - Optional - Order price (required for limit orders) - **amount** (string) - Required - Order quantity - **triggerType** (int) - Optional - 1: Last price, 2: Index price - **spPrice** (string) - Optional - Take profit price - **slPrice** (string) - Optional - Stop loss price - **isSetSp** (boolean) - Optional - Enable take profit - **isSetSl** (boolean) - Optional - Enable stop loss - **timestamp** (long) - Required - Current timestamp in ms ### Request Example { "customID": "11111", "symbol": "btc_usdt", "type": 1, "side": 1, "leverage": 10, "price": "2660", "amount": "0.01", "timestamp": 1724916869475 } ### Response #### Success Response (200) - **msg** (string) - Status message - **code** (int) - Status code (0 for success) - **data** (object) - Response payload ``` -------------------------------- ### GET /v2/server/time Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Retrieves the current server time in milliseconds. ```APIDOC ## GET /v2/server/time ### Description Retrieves the current server time in milliseconds. ### Method GET ### Endpoint /v2/server/time ### Response #### Success Response (200) - **code** (integer) - Status code - **msg** (string) - Status message - **data** (object) - Contains serverTime #### Response Example { "code": 0, "msg": "success", "data": {"serverTime": 1724916869475} } ``` -------------------------------- ### GET /v2/entrust/unFinish Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Retrieves a list of all currently unfinished conditional orders. ```APIDOC ## GET /v2/entrust/unFinish ### Description Retrieves unfinished conditional orders. ### Method GET ### Endpoint /v2/entrust/unFinish ### Parameters #### Query Parameters - **symbol** (string) - Required - Trading pair - **timestamp** (number) - Required - Current timestamp ### Response #### Success Response (200) - **msg** (string) - Success message - **code** (number) - Status code - **data** (array) - List of unfinished orders #### Response Example { "msg": "success", "code": 0, "data": [{ "id": "", "symbol": "", "leverage": 0, "triggerType": 1, "triggerPrice": "", "status": 2, "side": 1, "price": "", "startPrice": "", "amount": "", "spSlTriggerType": 0, "spPrice": "", "slPrice": "", "isSetSp": false, "isSetSl": false, "frozen": "", "createdAt": 0, "updatedAt": 0 }] } ``` -------------------------------- ### POST /v1/trade/order Source: https://apidoc.hibt.co/hibt-openapi-en Places a new spot order. ```APIDOC ## POST /v1/trade/order ### Description Places a new spot order on the exchange. ### Method POST ### Endpoint /v1/trade/order ### Parameters #### Request Body - **symbol** (string) - Required - Trading pair - **price** (decimal) - Required - Price (set to 0 for market orders) - **amount** (decimal) - Required - Quantity - **direction** (integer) - Required - Direction (0-Buy; 1-Sell) - **type** (integer) - Required - Type (0-Market; 1-Limit) ### Response #### Success Response (200) - **data** (string) - Order ID ### Response Example { "message": "success", "code": "0", "data": "E1677226372826791936" } ``` -------------------------------- ### GET /v1/common/symbols Source: https://apidoc.hibt.co/hibt-openapi-cn Retrieves information about all available trading pairs on the platform. ```APIDOC ## GET /v1/common/symbols ### Description Returns a list of all supported trading pairs and their configuration details. ### Method GET ### Endpoint /v1/common/symbols ### Response #### Success Response (200) - **data** (array) - List of trading pair objects #### Response Example { "message": "success", "code": "0", "data": [ { "symbol": "BTC/USDT", "baseCoinScale": 4, "coinScale": 4, "priceScale": 2, "baseSymbol": "USDT", "coinSymbol": "BTC", "minTurnover": 10, "minVolume": 0.001, "maxVolume": 50, "enable": 1 } ] } ``` -------------------------------- ### GET /v2/account/order Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Retrieves the trade history for a specific account. Requires authentication. ```APIDOC ## GET /v2/account/order ### Description Retrieves the trade history for a specific account. Requires authentication. ### Method GET ### Endpoint /v2/account/order ### Parameters #### Query Parameters - **symbol** (string) - Required - Trading pair - **startTime** (int64) - Optional - Start time in seconds - **endTime** (int64) - Optional - End time in seconds - **limit** (int) - Optional - Number of entries (default: 500, max: 1000) - **timestamp** (timestamp) - Required - Current timestamp in ms ### Response #### Success Response (200) - **msg** (string) - Success message - **code** (int) - Response code (0 for success) - **data** (array) - Array of trade history objects - **id** (string) - Order ID - **symbol** (string) - Contract identifier - **type** (int) - Order type (1: Limit, 2: Market) - **action** (int) - Order event (0: Open, 1: Close, 2: Stop Loss, 3: Take Profit, 4: Liquidation, 5: FOK Liquidation, 6: ADL Reduction, 7: Margin Increase, 8: Opposite Position, 9: Margin Call) - **side** (int) - Trading direction (1: Buy, 2: Sell) - **positionId** (string) - Position ID - **price** (string) - Order price (only for Limit orders) - **leverage** (int) - Leverage multiple - **amount** (string) - Order quantity - **frozen** (string) - Frozen margin (OpenPrice * Amount * BaseMarginRate) - **filledAmount** (string) - Filled quantity - **filledPrice** (string) - Weighted average price of filled orders - **filledValue** (string) - Total value of filled orders - **triggerType** (int) - Trigger type for Take Profit and Stop Loss (1: Transaction price, 2: Index price) - **spPrice** (string) - Preset Take Profit price - **slPrice** (string) - Preset Stop Loss price - **createdAt** (int) - Creation time - **updatedAt** (int) - Last update time - **state** (int) - Order state (1: Normal, 2: Completed, 3: Canceled, 4: Partially Filled, 5: Partially Filled & Canceled, 6: Canceling) - **profit** (string) - Realized profit/loss (for closed orders) - **fee** (string) - Transaction fee - **pointFee** (string) - Fee deduction using points (bonuses) - **pointProfit** (string) - Profit/loss deduction using points (bonuses) - **closePrice** (string) - Bankruptcy price #### Response Example ```json { "msg": "success", "code": 0, "data": [ { "id": "", "symbol": "", "type": 0, "action": 0, "side": 0, "positionId": "", "price": "", "leverage": 0, "amount": "", "frozen": "", "filledAmount": "", "filledPrice": "", "filledValue": "", "triggerType": 0, "spPrice": "", "slPrice": "", "createdAt": 0, "updatedAt": 0, "state": 0, "profit": "", "fee": "", "pointFee": "", "pointProfit": "", "closePrice": "" } ] } ``` ``` -------------------------------- ### POST /v1/account/rebateInfo Source: https://apidoc.hibt.co/hibt-openapi-en Retrieves the rebate list for the user. ```APIDOC ## POST /v1/account/rebateInfo ### Description Retrieves the rebate information for the authenticated user. ### Method POST ### Endpoint /v1/account/rebateInfo ### Response #### Success Response (200) - **invitedUID** (long) - Invited user's UID - **parentUID** (long) - Inviter's (parent) UID - **createTime** (long) - Creation time (ms) - **coin** (string) - Rebate coin type - **rebateAmount** (decimal) - Rebate amount - **rebateUsdtAmount** (decimal) - Rebate amount in equivalent USDT ### Response Example { "message": "success", "code": "0", "data": [ { "invitedUID": "123456", "parentUID": "45678", "coin": "BTC", "rebateAmount": 0.1, "rebateUsdtAmount": 0.1, "createTime": 1672502400000 } ] } ``` -------------------------------- ### Retrieve All Trading Pairs Source: https://apidoc.hibt.co/hibt-openapi-en/spot-trading-market-maker Returns a list of all supported trading pairs and their respective configuration parameters. ```json { "message": "success", "code": "0", "data": [ { "symbol": "BTC/USDT", // Trading Pair "baseCoinScale": 4, // Quote Currency Quantity Precision "coinScale": 4, // Base Currency Quantity Precision "priceScale": 2, // Price Precision "baseSymbol": "USDT", // Quote Currency "coinSymbol":"BTC", // Base Currency "minTurnover": 10, // Minimum Order Execution Amount "minVolume": 0.001, // Min Order Quantity "maxVolume": 50, // Max Order Quantity "enable": 1 // Is Trading Supported }, { "symbol": "ETH/USDT", "baseCoinScale": 4, "coinScale": 4, "baseSymbol": "USDT", "coinSymbol":"ETH", "minTurnover": 10, "minVolume": 0.01, "maxVolume": 500, "enable": 1 } ] } ``` -------------------------------- ### GET /v1/market/depth Source: https://apidoc.hibt.co/hibt-openapi-cn Retrieves the order book depth for a specific trading pair. ```APIDOC ## GET /v1/market/depth ### Description Returns the current bid and ask depth for the specified trading pair. ### Method GET ### Endpoint /v1/market/depth ### Parameters #### Query Parameters - **symbol** (string) - Required - The trading pair - **depth** (integer) - Required - Number of levels to return (max 50) ### Response #### Success Response (200) - **bids** (array) - List of buy orders [price, quantity] - **asks** (array) - List of sell orders [price, quantity] #### Response Example { "message": "success", "code": "0", "data": { "symbol" : "BTC/USDT", "timestamp" : "1723199363658", "bids" : [ [ "36074.99", "0.27225537" ] ], "asks" : [ [ "36075.06", "0.55858424" ] ] } } ``` -------------------------------- ### Query Contract Specifications Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Returns the current contract specifications including price and currency. ```json { "msg":"success", "code":0, "data":[ { "contract_type": "okb_usdt", "contract_price": "123.45", //Last Price "contract_price_currency": "usdt" } ] } ``` -------------------------------- ### POST /v2/entrust/add Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Creates a new conditional order with optional take-profit and stop-loss settings. ```APIDOC ## POST /v2/entrust/add ### Description Creates a new conditional order. ### Method POST ### Endpoint /v2/entrust/add ### Request Body - **customID** (string) - Required - Custom order ID - **symbol** (string) - Required - Trading pair - **side** (number) - Required - Trade direction: 1 for buy, 2 for sell - **triggerType** (number) - Required - Trigger type: 1 for latest price, 2 for index price - **triggerPrice** (string) - Required - Trigger price - **amount** (string) - Required - Order quantity - **price** (string) - Required - Entrusted price - **leverage** (number) - Required - Leverage - **spSlTriggerType** (number) - Required - Take profit/stop loss trigger type: 1 for latest price, 2 for index price - **spPrice** (string) - Optional - Preset take-profit price - **slPrice** (string) - Optional - Preset stop-loss price - **IsSetSp** (boolean) - Required - Whether to set take profit - **IsSetSl** (boolean) - Required - Whether to set stop loss - **timestamp** (number) - Required - Current timestamp in milliseconds ### Request Example { "customID": "11111", "symbol": "btc_usdt", "side": 1, "triggerType": 1, "triggerPrice": "", "amount": "", "price": "", "leverage": 0, "spSlTriggerType": 0, "spPrice": "", "slPrice": "", "IsSetSp": false, "IsSetSl": false, "timestamp": 1724916869475 } ### Response #### Success Response (200) - **msg** (string) - Success message - **code** (number) - Status code - **data** (object) - Order details object #### Response Example { "msg": "success", "code": 0, "data": { "id": "", "symbol": "", "leverage": 0, "triggerType": 1, "triggerPrice": "", "status": 2, "side": 1, "price": "", "startPrice": "", "amount": "", "spSlTriggerType": 0, "spPrice": "", "slPrice": "", "isSetSp": false, "isSetSl": false, "frozen": "", "createdAt": 0, "updatedAt": 0 } } ``` -------------------------------- ### GET /v2/order/unFinish Source: https://apidoc.hibt.co/hibt-openapi-en/perpetual-contract-trading Retrieves a list of unfinished orders. Authentication is required to access this endpoint. ```APIDOC ## GET /v2/order/unFinish ### Description Retrieves a list of unfinished orders for the authenticated user. You can filter by symbol or specific identifiers like orderID, customID, or positionID. ### Method GET ### Endpoint /v2/order/unFinish ### Parameters #### Query Parameters - **symbol** (string) - Optional - Trading pair - **orderID** (string) - Optional - Order ID - **customID** (string) - Optional - Custom order ID - **positionID** (string) - Optional - Position ID - **timestamp** (long) - Required - Current timestamp in milliseconds ### Response #### Success Response (200) - **msg** (string) - Status message - **code** (integer) - Status code - **data** (array) - List of unfinished order objects #### Response Example { "msg": "success", "code": 0, "data": [{ "id": "", "customID": "", "symbol": "", "type": 1, "action": 0, "side": 1, "positionID": "", "price": "", "leverage": 0, "amount": "", "frozen": "", "filledAmount": "", "filledPrice": "", "filledValue": "", "triggerType": 2, "spPrice": "", "slPrice": "", "state": 1, "profit": "", "fee": "", "pointFee": "", "pointProfit": "", "closePrice": "", "triggerPrice": "", "createdAt": 0, "updatedAt": 0 }] } ```