# Table of Contents
- [Bitunix API Guide 2026: REST vs WebSocket for Automated Trading](#bitunix-api-guide-2026-rest-vs-websocket-for-automated-trading)
- [Sign - Open Platform](#sign-open-platform)
- [Public - Open Platform](#public-open-platform)
- [Tax filing - Open Platform](#tax-filing-open-platform)
- [User ws - Open Platform](#user-ws-open-platform)
- [User - Open Platform](#user-open-platform)
- [Ws - Open Platform](#ws-open-platform)
- [Err code - Open Platform](#err-code-open-platform)
- [Err code - Open Platform](#err-code-open-platform)
- [Order ws - Open Platform](#order-ws-open-platform)
- [Order - Open Platform](#order-open-platform)
- [Public ws - Open Platform](#public-ws-open-platform)
- [Tax data type codes - Open Platform](#tax-data-type-codes-open-platform)
- [Interface_Documentation - Open Platform](#interface-documentation-open-platform)
- [Order ws - Open Platform](#order-ws-open-platform)
- [Sign - Open Platform](#sign-open-platform)
- [Public - Open Platform](#public-open-platform)
- [Public ws - Open Platform](#public-ws-open-platform)
- [Order - Open Platform](#order-open-platform)
- [Tax data type codes - Open Platform](#tax-data-type-codes-open-platform)
- [Tax filing - Open Platform](#tax-filing-open-platform)
- [Interface_Documentation - Open Platform](#interface-documentation-open-platform)
- [User ws - Open Platform](#user-ws-open-platform)
- [User - Open Platform](#user-open-platform)
- [Ws - Open Platform](#ws-open-platform)
- [Index - Open Platform](#index-open-platform)
- [OpenApi | Bitunix](#openapi-bitunix)
- [API Introduction | OpenApi | Bitunix](#api-introduction-openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [Asset Query | OpenApi | Bitunix](#asset-query-openapi-bitunix)
- [transfer asset from main account to sub account | OpenApi | Bitunix](#transfer-asset-from-main-account-to-sub-account-openapi-bitunix)
- [transfer asset from subAccount to main account | OpenApi | Bitunix](#transfer-asset-from-subaccount-to-main-account-openapi-bitunix)
- [Get Depth | OpenApi | Bitunix](#get-depth-openapi-bitunix)
- [Get Funding Rate | OpenApi | Bitunix](#get-funding-rate-openapi-bitunix)
- [Get Funding Rate | OpenApi | Bitunix](#get-funding-rate-openapi-bitunix)
- [Get Kline | OpenApi | Bitunix](#get-kline-openapi-bitunix)
- [Get Trading Pairs | OpenApi | Bitunix](#get-trading-pairs-openapi-bitunix)
- [Change Log | OpenApi | Bitunix](#change-log-openapi-bitunix)
- [Get Tickers | OpenApi | Bitunix](#get-tickers-openapi-bitunix)
- [Get Funding Rate History | OpenApi | Bitunix](#get-funding-rate-history-openapi-bitunix)
- [Get History Positions | OpenApi | Bitunix](#get-history-positions-openapi-bitunix)
- [Get Pending Positions | OpenApi | Bitunix](#get-pending-positions-openapi-bitunix)
- [Cancel TP/SL Order | OpenApi | Bitunix](#cancel-tp-sl-order-openapi-bitunix)
- [Get Position Tiers | OpenApi | Bitunix](#get-position-tiers-openapi-bitunix)
- [Get History TP/SL Order | OpenApi | Bitunix](#get-history-tp-sl-order-openapi-bitunix)
- [Modify TP/SL Order | OpenApi | Bitunix](#modify-tp-sl-order-openapi-bitunix)
- [Cancel All Orders | OpenApi | Bitunix](#cancel-all-orders-openapi-bitunix)
- [Modify Position TP/SL Order | OpenApi | Bitunix](#modify-position-tp-sl-order-openapi-bitunix)
- [Close All Position | OpenApi | Bitunix](#close-all-position-openapi-bitunix)
- [Cancel Orders | OpenApi | Bitunix](#cancel-orders-openapi-bitunix)
- [Place TP/SL Order | OpenApi | Bitunix](#place-tp-sl-order-openapi-bitunix)
- [Flash Close Position | OpenApi | Bitunix](#flash-close-position-openapi-bitunix)
- [Batch Order | OpenApi | Bitunix](#batch-order-openapi-bitunix)
- [Get History Orders | OpenApi | Bitunix](#get-history-orders-openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [Modify Order | OpenApi | Bitunix](#modify-order-openapi-bitunix)
- [Get Order Detail | OpenApi | Bitunix](#get-order-detail-openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [Get Pending Orders | OpenApi | Bitunix](#get-pending-orders-openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [Get Pending TP/SL Order | OpenApi | Bitunix](#get-pending-tp-sl-order-openapi-bitunix)
- [Place Position TP/SL Order | OpenApi | Bitunix](#place-position-tp-sl-order-openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [Get History Trades | OpenApi | Bitunix](#get-history-trades-openapi-bitunix)
- [Place Order | OpenApi | Bitunix](#place-order-openapi-bitunix)
- [OpenApi | Bitunix](#openapi-bitunix)
- [تحديثات منتج Bitunix وسجل التغيير | أحدث الميزات](#-bitunix-)
- [ابحث عن مقالات العملات المشفرة والأخبار والرؤى | مدونة Bitunix](#-bitunix)
- [Bitunix | المعارض والمنتديات والفعاليات الرسمية](#bitunix-)
- [مركز المساعدة](#-)
- [أكاديمية Bitunix | تعلم تداول العملات المشفرة وسلسلة الكتل](#-bitunix-)
- [Únete a la revolución del cripto trading | Registrese | Bitunix](#-nete-a-la-revoluci-n-del-cripto-trading-registrese-bitunix)
- [Exchange de Derivados de Criptomonedas | Compra, Vende y Opera Criptomonedas | Bitunix](#exchange-de-derivados-de-criptomonedas-compra-vende-y-opera-criptomonedas-bitunix)
- [61,938.2 | BTCUSDT Futuros - Exchange de Criptomonedas | Bitunix](#61-938-2-btcusdt-futuros-exchange-de-criptomonedas-bitunix)
- [61,620.0 | BTCUSDC Futuros - Exchange de Criptomonedas | Bitunix](#61-620-0-btcusdc-futuros-exchange-de-criptomonedas-bitunix)
- [61,958.9 | BTCUSD Futuros - Exchange de Criptomonedas | Bitunix](#61-958-9-btcusd-futuros-exchange-de-criptomonedas-bitunix)
- [Comprar criptomonedas con un clic | Bitunix](#comprar-criptomonedas-con-un-clic-bitunix)
- [62232.02 | BTCUSDT Spot - Exchange de Criptomonedas | Bitunix](#62232-02-btcusdt-spot-exchange-de-criptomonedas-bitunix)
- [Join the Crypto Trading Revolution | Register | Bitunix](#join-the-crypto-trading-revolution-register-bitunix)
- [Depósito Bitunix Fiat: Deposite Fiat y conviértalo a Crypto](#dep-sito-bitunix-fiat-deposite-fiat-y-convi-rtalo-a-crypto)
- [Compra cripto con P2P Trading | BTC, USDT, ETH | Bitunix](#compra-cripto-con-p2p-trading-btc-usdt-eth-bitunix)
- [Compra cripto con tarjeta o transferencia | Terceros | Bitunix](#compra-cripto-con-tarjeta-o-transferencia-terceros-bitunix)
- [62,126.6 | BTCUSDT Futures Exchange - Crypto Futures | Bitunix](#62-126-6-btcusdt-futures-exchange-crypto-futures-bitunix)
- [0.1801 | ADAUSDT Spot - Exchange de Criptomonedas | Bitunix](#0-1801-adausdt-spot-exchange-de-criptomonedas-bitunix)
- [1.1279 | XRPUSDT Spot - Exchange de Criptomonedas | Bitunix](#1-1279-xrpusdt-spot-exchange-de-criptomonedas-bitunix)
- [0.07696 | DOGEUSDT Spot - Exchange de Criptomonedas | Bitunix](#0-07696-dogeusdt-spot-exchange-de-criptomonedas-bitunix)
- [0.7622 | SUIUSDT Spot - Exchange de Criptomonedas | Bitunix](#0-7622-suiusdt-spot-exchange-de-criptomonedas-bitunix)
- [Inversión automática al contado | Bitunix](#inversi-n-autom-tica-al-contado-bitunix)
- [Conversión cripto al instante | 0 comisiones y sin slippage | Bitunix](#conversi-n-cripto-al-instante-0-comisiones-y-sin-slippage-bitunix)
- [Compre criptomonedas con tarjeta de crédito/débito | Bitunix](#compre-criptomonedas-con-tarjeta-de-cr-dito-d-bito-bitunix)
- [81.85 | SOLUSDT Spot - Exchange de Criptomonedas | Bitunix](#81-85-solusdt-spot-exchange-de-criptomonedas-bitunix)
- [1738.65 | ETHUSDT Spot - Exchange de Criptomonedas | Bitunix](#1738-65-ethusdt-spot-exchange-de-criptomonedas-bitunix)
- [Ganancias cripto: planes de ahorro flexibles y con interés fijo | Bitunix](#ganancias-cripto-planes-de-ahorro-flexibles-y-con-inter-s-fijo-bitunix)
- [44.15 | LTCUSDT Spot - Exchange de Criptomonedas | Bitunix](#44-15-ltcusdt-spot-exchange-de-criptomonedas-bitunix)
- [Comercio de copias criptográficas | Bitunix](#comercio-de-copias-criptogr-ficas-bitunix)
- [Descripción general de las ganancias de Bitunix | Gestión de activos digitales](#descripci-n-general-de-las-ganancias-de-bitunix-gesti-n-de-activos-digitales)
- [Bitunix Programa de Invitación|Invita a amigos y gana recompensas](#bitunix-programa-de-invitaci-n-invita-a-amigos-y-gana-recompensas)
- [Centro de Campañas: eventos limitados y recompensas exclusivas | Bitunix](#centro-de-campa-as-eventos-limitados-y-recompensas-exclusivas-bitunix)
- [Programa VIP: recompensas exclusivas y descuentos en comisiones de trading | Bitunix](#programa-vip-recompensas-exclusivas-y-descuentos-en-comisiones-de-trading-bitunix)
- [Descarga la app de Bitunix para iOS y Android | Opera donde quieras](#descarga-la-app-de-bitunix-para-ios-y-android-opera-donde-quieras)
- [Centro de Tareas: completa tareas y gana recompensas | Bitunix](#centro-de-tareas-completa-tareas-y-gana-recompensas-bitunix)
- [Aumenta tus ingresos a través del programa de afiliados de Bitunix](#aumenta-tus-ingresos-a-trav-s-del-programa-de-afiliados-de-bitunix)
- [Presencia global de Bitunix | Expos, foros y eventos oficiales cripto](#presencia-global-de-bitunix-expos-foros-y-eventos-oficiales-cripto)
- [Actualizaciones de productos Bitunix y registro de cambios | Últimas características](#actualizaciones-de-productos-bitunix-y-registro-de-cambios-ltimas-caracter-sticas)
- [Comunidad Bitunix | Canales Oficiales en Redes Sociales](#comunidad-bitunix-canales-oficiales-en-redes-sociales)
- [Bitunix Whales Club | Servicios VIP exclusivos de trading y asesoramiento](#bitunix-whales-club-servicios-vip-exclusivos-de-trading-y-asesoramiento)
- [Token Splash: deposita y opera para ganar recompensas | Bitunix](#token-splash-deposita-y-opera-para-ganar-recompensas-bitunix)
- [API de Impuestos de Bitunix | Simplifica la Declaración de Criptoimpuestos en 2025](#api-de-impuestos-de-bitunix-simplifica-la-declaraci-n-de-criptoimpuestos-en-2025)
- [Prueba de Reservas Bitunix | Auditorías transparentes de activos](#prueba-de-reservas-bitunix-auditor-as-transparentes-de-activos)
- [Sobre Bitunix | Plataforma global de trading cripto](#sobre-bitunix-plataforma-global-de-trading-cripto)
- [Verifica tu cuenta Bitunix | Portal oficial de verificación](#verifica-tu-cuenta-bitunix-portal-oficial-de-verificaci-n)
- [Inversión Dual: obtén altos rendimientos en cripto | Bitunix](#inversi-n-dual-obt-n-altos-rendimientos-en-cripto-bitunix)
- [Estructura de comisiones Bitunix | Condiciones VIP para spot y futuros](#estructura-de-comisiones-bitunix-condiciones-vip-para-spot-y-futuros)
- [Envía tu feedback a Bitunix | Ayúdanos a mejorar la plataforma](#env-a-tu-feedback-a-bitunix-ay-danos-a-mejorar-la-plataforma)
- [Bitunix Chart Trading: Gráficos de Trading Avanzados y Herramientas para Futuros](#bitunix-chart-trading-gr-ficos-de-trading-avanzados-y-herramientas-para-futuros)
- [Bitunix Exchange | Better Liquidity, Better Trading | Trade Bitcoin, Ethereum & More Crypto](#bitunix-exchange-better-liquidity-better-trading-trade-bitcoin-ethereum-more-crypto)
- [Download Bitunix App for iOS & Android | Trade Anywhere](#download-bitunix-app-for-ios-android-trade-anywhere)
- [Crypto Futures Copy Trading | Bitunix Exchange](#crypto-futures-copy-trading-bitunix-exchange)
- [Bitunix Proof of Reserves (PoR) & Asset Transparency](#bitunix-proof-of-reserves-por-asset-transparency)
- [Conocimientos cripto e insights de mercado: guías y tutoriales | Bitunix Blog](#conocimientos-cripto-e-insights-de-mercado-gu-as-y-tutoriales-bitunix-blog)
- [Marketplace de trading cripto | Spot & Futuros | Bitunix](#marketplace-de-trading-cripto-spot-futuros-bitunix)
- [Bitunix Academy | Aprende sobre trading cripto y blockchain](#bitunix-academy-aprende-sobre-trading-cripto-y-blockchain)
- [Visión del mercado cripto y tendencias de trading | Bitunix](#visi-n-del-mercado-cripto-y-tendencias-de-trading-bitunix)
- [Centro de ayuda](#centro-de-ayuda)
- [Guía de operación](#gu-a-de-operaci-n)
- [Login the Crypto Trading World | Bitunix](#login-the-crypto-trading-world-bitunix)
- [تبادل المشتقات المشفرة | شراء وبيع وتداول العملات المشفرة | Bitunix](#-bitunix)
- [انضم إلى ثورة تداول العملات المشفرة | سجل | Bitunix](#-bitunix)
- [تسجيل الدخول إلى عالم تداول العملات المشفرة | Bitunix](#-bitunix)
- [1730.16 | ETHUSDT البورصة الفورية - العقود الآجلة للعملات المشفرة | Bitunix](#1730-16-ethusdt-bitunix)
- [62236.01 | BTCUSDT البورصة الفورية - العقود الآجلة للعملات المشفرة | Bitunix](#62236-01-btcusdt-bitunix)
- [62,209.9 | BTCUSDT تبادل العقود الآجلة - العقود الآجلة للعملات المشفرة | Bitunix](#62-209-9-btcusdt-bitunix)
- [81.85 | SOLUSDT البورصة الفورية - العقود الآجلة للعملات المشفرة | Bitunix](#81-85-solusdt-bitunix)
- [1.1286 | XRPUSDT البورصة الفورية - العقود الآجلة للعملات المشفرة | Bitunix](#1-1286-xrpusdt-bitunix)
- [0.07695 | DOGEUSDT البورصة الفورية - العقود الآجلة للعملات المشفرة | Bitunix](#0-07695-dogeusdt-bitunix)
- [44.14 | LTCUSDT البورصة الفورية - العقود الآجلة للعملات المشفرة | Bitunix](#44-14-ltcusdt-bitunix)
- [0.1799 | ADAUSDT البورصة الفورية - العقود الآجلة للعملات المشفرة | Bitunix](#0-1799-adausdt-bitunix)
- [0.7626 | SUIUSDT البورصة الفورية - العقود الآجلة للعملات المشفرة | Bitunix](#0-7626-suiusdt-bitunix)
- [نظرة عامة على أرباح Bitunix | إدارة الأصول الرقمية](#-bitunix-)
- [بنقرة واحدة شراء التشفير | Bitunix](#-bitunix)
- [إثبات احتياطي Bitunix | عمليات تدقيق الأصول الشفافة](#-bitunix-)
- [قم بتنمية دخلك من خلال برنامج Bitunix التابع](#-bitunix-)
- [حول Bitunix | منصة تداول العملات المشفرة العالمية](#-bitunix-)
- [هيكل رسوم Bitunix | أسعار VIP والعقود الآجلة](#-bitunix-vip-)
- [Bitunix Whales Club | خدمات تداول واستشارات VIP حصرية](#bitunix-whales-club-vip-)
- [Submit Feedback to Bitunix | Help Improve the Platform](#submit-feedback-to-bitunix-help-improve-the-platform)
- [تحميل تطبيق Bitunix لنظامي التشغيل iOS و Android | التجارة في أي مكان](#-bitunix-ios-android-)
- [Entra en el mundo del comercio de criptomonedas | Bitunix](#entra-en-el-mundo-del-comercio-de-criptomonedas-bitunix)
- [واجهة برمجة تطبيقات ضريبة Bitunix | تبسيط إعداد التقارير الضريبية للعملات المشفرة في عام 2025](#-bitunix-2025)
- [شراء العملات المشفرة من خلال تداول P2P | بيتكوين، دولار أمريكي، إيثريوم | Bitunix](#-p2p-bitunix)
- [التحقق من حسابات Bitunix | بوابة التحقق الرسمية](#-bitunix-)
- [شراء التشفير بالبطاقة أو التحويل | الطرف الثالث | Bitunix](#-bitunix)
- [Bitunix Earn: احصل على مكافآت التشفير](#bitunix-earn-)
- [برنامج دعوة Bitunix|ادعُ أصدقاءك واكسب مكافآت](#-bitunix-)
- [برنامج VIP: مكافآت حصرية وخصومات على رسوم التداول | Bitunix](#-vip-bitunix)
- [مركز المهام: أكمل المهام واحصل على المكافآت | Bitunix](#-bitunix)
- [تداول مخططات Bitunix: مخططات تداول متقدمة وأدوات العقود الآجلة](#-bitunix-)
- [مركز الحملات: فعاليات محدودة ومكافآت حصرية | Bitunix](#-bitunix)
- [إرسال الملاحظات إلى Bitunix | ساعد في تحسين المنصة](#-bitunix-)
- [62202 | BTCUSDT Spot Exchange | Live Chart & Trading | Bitunix](#62202-btcusdt-spot-exchange-live-chart-trading-bitunix)
- [81.56 | SOLUSDT Spot Exchange | Live Chart & Trading | Bitunix](#81-56-solusdt-spot-exchange-live-chart-trading-bitunix)
- [43.99 | LTCUSDT Spot Exchange | Live Chart & Trading | Bitunix](#43-99-ltcusdt-spot-exchange-live-chart-trading-bitunix)
- [0.0002324 | HMSTRUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-0002324-hmstrusdt-futuros-exchange-de-criptomonedas-bitunix)
- [0.029964 | TACUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-029964-tacusdt-futuros-exchange-de-criptomonedas-bitunix)
- [Trading Settings 1 - How to Set Position Size & Margin Mode](#trading-settings-1-how-to-set-position-size-margin-mode)
- [Trade Settings 3 - Take Profit, Stop Loss, and Close Position](#trade-settings-3-take-profit-stop-loss-and-close-position)
- [301.74 | TXNUSDT Futuros - Exchange de Criptomonedas | Bitunix](#301-74-txnusdt-futuros-exchange-de-criptomonedas-bitunix)
- [How to Choose Investment Targets in Crypto](#how-to-choose-investment-targets-in-crypto)
- [81.64 | SOLUSDT Futuros - Exchange de Criptomonedas | Bitunix](#81-64-solusdt-futuros-exchange-de-criptomonedas-bitunix)
- [1,738.51 | ETHUSDT Futuros - Exchange de Criptomonedas | Bitunix](#1-738-51-ethusdt-futuros-exchange-de-criptomonedas-bitunix)
- [IOTA Price Prediction 2026–2030](#iota-price-prediction-2026-2030)
- [NKN Price Prediction 2026–2030](#nkn-price-prediction-2026-2030)
- [935.95 | CATUSDT Futuros - Exchange de Criptomonedas | Bitunix](#935-95-catusdt-futuros-exchange-de-criptomonedas-bitunix)
- [88.00 | STRCUSDT Futuros - Exchange de Criptomonedas | Bitunix](#88-00-strcusdt-futuros-exchange-de-criptomonedas-bitunix)
- [4,187.79 | GOLD(XAU)USDT Futuros - Exchange de Criptomonedas | Bitunix](#4-187-79-gold-xau-usdt-futuros-exchange-de-criptomonedas-bitunix)
- [1.726 | GRAMUSDT Futuros - Exchange de Criptomonedas | Bitunix](#1-726-gramusdt-futuros-exchange-de-criptomonedas-bitunix)
- [Trading Signals in Crypto: How to Use Them Effectively](#trading-signals-in-crypto-how-to-use-them-effectively)
- [Aerodrome Finance AERO Price Prediction 2026–2030](#aerodrome-finance-aero-price-prediction-2026-2030)
- [Trading Settings 4 - Order Types and Methods](#trading-settings-4-order-types-and-methods)
- [70.618 | HYPEUSDT Futuros - Exchange de Criptomonedas | Bitunix](#70-618-hypeusdt-futuros-exchange-de-criptomonedas-bitunix)
- [API3 Price Prediction 2026–2030](#api3-price-prediction-2026-2030)
- [0.10399 | TAUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-10399-tausdt-futuros-exchange-de-criptomonedas-bitunix)
- [0.05997 | ZKPUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-05997-zkpusdt-futuros-exchange-de-criptomonedas-bitunix)
- [Bitunix Account - Security Authentication Failure Reset Guide](#bitunix-account-security-authentication-failure-reset-guide)
- [0.009249 | GPSUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-009249-gpsusdt-futuros-exchange-de-criptomonedas-bitunix)
- [0.06023 | ALCHUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-06023-alchusdt-futuros-exchange-de-criptomonedas-bitunix)
- [Using Coinglass Clearing Map | Developing Futures Strategies](#using-coinglass-clearing-map-developing-futures-strategies)
- [Virtuals Protocol: Pioneering Decentralized AI Agents and Intelligence](#virtuals-protocol-pioneering-decentralized-ai-agents-and-intelligence)
- [Token Splash Earning Guide](#token-splash-earning-guide)
- [Trading Settings 2 - Leverage in Futures Trading](#trading-settings-2-leverage-in-futures-trading)
- [Bittensor: The Decentralized Network for AI and Machine Learning](#bittensor-the-decentralized-network-for-ai-and-machine-learning)
- [0.72145 | MAGMAUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-72145-magmausdt-futuros-exchange-de-criptomonedas-bitunix)
- [Bitunix Principal-Easy Earn Investment Guide](#bitunix-principal-easy-earn-investment-guide)
- [Practical Analysis: Bottom-Fishing Pattern, the "W" Bottom Trading Strategy](#practical-analysis-bottom-fishing-pattern-the-w-bottom-trading-strategy)
- [Bitcoin Explained: Why It's the Digital Gold of the Crypto World](#bitcoin-explained-why-it-s-the-digital-gold-of-the-crypto-world)
- [Introduction to Technical Analysis Course (1): How to Draw Trendlines](#introduction-to-technical-analysis-course-1-how-to-draw-trendlines)
- [Introduction to Technical Analysis (2): Practical Application of Support and Resistance Levels](#introduction-to-technical-analysis-2-practical-application-of-support-and-resistance-levels)
- [5.914 | LABUSDT Futuros - Exchange de Criptomonedas | Bitunix](#5-914-labusdt-futuros-exchange-de-criptomonedas-bitunix)
- [0.42002 | SLXUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-42002-slxusdt-futuros-exchange-de-criptomonedas-bitunix)
- [How to Buy Cryptocurrency Using P2P Trading](#how-to-buy-cryptocurrency-using-p2p-trading)
- [How to Buy Crypto Instantly on Bitunix With One-Click Buy](#how-to-buy-crypto-instantly-on-bitunix-with-one-click-buy)
- [Buy Crypto in Seconds on Bitunix: A Beginner’s Guide to One-Click Buy](#buy-crypto-in-seconds-on-bitunix-a-beginner-s-guide-to-one-click-buy)
- [Crypto Wallet Address Explained: A Beginner's Guide](#crypto-wallet-address-explained-a-beginner-s-guide)
- [NEAR: From a High-Performance Public Blockchain to a Data Availability Layer That Challenges Ethereum at a Lower Dimension](#near-from-a-high-performance-public-blockchain-to-a-data-availability-layer-that-challenges-ethereum-at-a-lower-dimension)
- [PEPE: The Comeback of the Green Frog and the Pure Spirit of Meme Culture](#pepe-the-comeback-of-the-green-frog-and-the-pure-spirit-of-meme-culture)
- [Delta in Options Trading: Measure Risk and Directional Bias](#delta-in-options-trading-measure-risk-and-directional-bias)
- [Manta Network Forecast 2026-2030: MANTA Token Analysis](#manta-network-forecast-2026-2030-manta-token-analysis)
- [ZEN Token Forecast 2026-2030: Horizen Privacy Coin Outlook](#zen-token-forecast-2026-2030-horizen-privacy-coin-outlook)
- [Trading Psychology: Master Emotions for Better Results](#trading-psychology-master-emotions-for-better-results)
- [Market Depth in Crypto: How to Read the Order Book](#market-depth-in-crypto-how-to-read-the-order-book)
- [Coq Inu COQ Price Prediction 2026–2030](#coq-inu-coq-price-prediction-2026-2030)
- [IDO Explained: How Initial DEX Offerings Work for Investors](#ido-explained-how-initial-dex-offerings-work-for-investors)
- [GRT Token Forecast 2026-2030: The Graph Protocol Outlook](#grt-token-forecast-2026-2030-the-graph-protocol-outlook)
- [Practical Analysis: EMA Trading Strategy](#practical-analysis-ema-trading-strategy)
- [255.54 | TTWOUSDT Futuros - Exchange de Criptomonedas | Bitunix](#255-54-ttwousdt-futuros-exchange-de-criptomonedas-bitunix)
- [Crypto Recovery Phrase: Why It Matters and How to Protect It](#crypto-recovery-phrase-why-it-matters-and-how-to-protect-it)
- [Statistical Arbitrage in Crypto: A Quant Trader's Guide](#statistical-arbitrage-in-crypto-a-quant-trader-s-guide)
- [0.07685 | DOGEUSDT Spot Exchange | Live Chart & Trading | Bitunix](#0-07685-dogeusdt-spot-exchange-live-chart-trading-bitunix)
- [1731.32 | ETHUSDT Spot Exchange | Live Chart & Trading | Bitunix](#1731-32-ethusdt-spot-exchange-live-chart-trading-bitunix)
- [1INCH Token Forecast 2026-2030: DEX Aggregator Outlook](#1inch-token-forecast-2026-2030-dex-aggregator-outlook)
- [Bitunix VIP Membership Benefits Explained](#bitunix-vip-membership-benefits-explained)
- [Doji Candlestick: Meaning, Types, and Trading Signals](#doji-candlestick-meaning-types-and-trading-signals)
- [Render: The Decentralized GPU Network Powering Spatial Computing](#render-the-decentralized-gpu-network-powering-spatial-computing)
- [0.1754 | ADAUSDT Spot Exchange | Live Chart & Trading | Bitunix](#0-1754-adausdt-spot-exchange-live-chart-trading-bitunix)
- [0.7575 | SUIUSDT Spot Exchange | Live Chart & Trading | Bitunix](#0-7575-suiusdt-spot-exchange-live-chart-trading-bitunix)
- [Ethereum as the World Computer: Smart Contracts Powering the Decentralized Web](#ethereum-as-the-world-computer-smart-contracts-powering-the-decentralized-web)
- [Aster: Pushing Beyond Limits, the Next-Generation Leader in Decentralized Perpetual Futures](#aster-pushing-beyond-limits-the-next-generation-leader-in-decentralized-perpetual-futures)
- [Practical Analysis: MA Trading Strategy](#practical-analysis-ma-trading-strategy)
- [Bitunix Rewards Guide 1: Futures Bonus on Bitunix](#bitunix-rewards-guide-1-futures-bonus-on-bitunix)
- [1.1102 | XRPUSDT Spot Exchange | Live Chart & Trading | Bitunix](#1-1102-xrpusdt-spot-exchange-live-chart-trading-bitunix)
- [Essential Beginner’s Guide](#essential-beginner-s-guide)
- [Shooting Star Pattern: Spot Bearish Reversals in Crypto](#shooting-star-pattern-spot-bearish-reversals-in-crypto)
- [Bitunix Futures Grid Trading: Practical Strategies and Platform Operation Tips](#bitunix-futures-grid-trading-practical-strategies-and-platform-operation-tips)
- [Practical Analysis: Top Escape Pattern - "M" Top Trading Strategy](#practical-analysis-top-escape-pattern-m-top-trading-strategy)
- [0.07185 | THEUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-07185-theusdt-futuros-exchange-de-criptomonedas-bitunix)
- [Bitunix Activities](#bitunix-activities)
- [Supply and Demand Zones: A Crypto Trader's Strategy Guide](#supply-and-demand-zones-a-crypto-trader-s-strategy-guide)
- [Practical Analysis: K-line Box Trading Strategy](#practical-analysis-k-line-box-trading-strategy)
- [0.01044 | ARPAUSDT Futuros - Exchange de Criptomonedas | Bitunix](#0-01044-arpausdt-futuros-exchange-de-criptomonedas-bitunix)
- [Top 10 Most Common Questions About Crypto Futures Trading on Bitunix](#top-10-most-common-questions-about-crypto-futures-trading-on-bitunix)
- [Convert USDT to USD: Step-by-Step Guide](#convert-usdt-to-usd-step-by-step-guide)
- [Bitunix Products](#bitunix-products)
- [Crypto Earn: High-Yield Digital Asset Management | Bitunix](#crypto-earn-high-yield-digital-asset-management-bitunix)
- [3-Minute Quick Start to Futures Trading](#3-minute-quick-start-to-futures-trading)
- [Buy Crypto Instantly with Fiat | Credit Card & P2P | Bitunix](#buy-crypto-instantly-with-fiat-credit-card-p2p-bitunix)
- [Exchange de Derivados de Criptomonedas | Compra, Vende y Opera Criptomonedas | Bitunix](#exchange-de-derivados-de-criptomonedas-compra-vende-y-opera-criptomonedas-bitunix)
- [Informe Mensual | Bitunix Blog](#informe-mensual-bitunix-blog)
- [Buy Crypto via Third-Party Providers | Apple Pay & Bank Transfer | Bitunix](#buy-crypto-via-third-party-providers-apple-pay-bank-transfer-bitunix)
- [Campaign Center: Limited Events & Exclusive Rewards | Bitunix](#campaign-center-limited-events-exclusive-rewards-bitunix)
- [Buy Crypto with P2P Trading | BTC, USDT, ETH | Bitunix](#buy-crypto-with-p2p-trading-btc-usdt-eth-bitunix)
- [Bitunix Invite Program | Invite Friends to Earn Rewards](#bitunix-invite-program-invite-friends-to-earn-rewards)
- [Bitunix Copy Trading - Practical Strategy Guide](#bitunix-copy-trading-practical-strategy-guide)
- [Bitunix Earn | Earn Passive Income on USDT & BTC | Bitunix](#bitunix-earn-earn-passive-income-on-usdt-btc-bitunix)
- [Exchange de Derivados de Criptomonedas | Compra, Vende y Opera Criptomonedas | Bitunix](#exchange-de-derivados-de-criptomonedas-compra-vende-y-opera-criptomonedas-bitunix)
- [Task Center: Complete Tasks, Earn Rewards | Bitunix](#task-center-complete-tasks-earn-rewards-bitunix)
- [Exchange de Derivados de Criptomonedas | Compra, Vende y Opera Criptomonedas | Bitunix](#exchange-de-derivados-de-criptomonedas-compra-vende-y-opera-criptomonedas-bitunix)
- [Bitunix Rewards Guide 2: Fee Discount Voucher, APR Boost Voucher, and More](#bitunix-rewards-guide-2-fee-discount-voucher-apr-boost-voucher-and-more)
---
# Bitunix API Guide 2026: REST vs WebSocket for Automated Trading
PrincipianteGuía de operación
Bitunix API Guide: How to Build Automated Trading Systems
=========================================================
AG 2026/02/18 9Minuto 55.69K

**Article Summary**
-------------------
* This guide introduces the Bitunix API, a powerful tool for developers and algorithmic traders to interact with the exchange programmatically.
* It explains the two main types of APIs offered: the REST API for request-based actions (like placing orders) and the WebSocket API for real-time data streams (like live prices).
* The article outlines the key functionalities available through the API, including accessing market data, managing account balances, and executing trades automatically.
* A clear, step-by-step guide shows users how to generate their API keys securely and make their first authenticated API call.
* It concludes by positioning the Bitunix API as a robust, reliable, and well-documented tool for building sophisticated, automated trading systems.
Building an algorithmic and automated trading system in crypto is not simple. It requires considerable expertise and a solid understanding of how crypto markets behave. There are dozens of potential use cases for building and deploying automated trading systems using APIs, as well-designed [trading bots](https://blog.bitunix.com/en/trading-bots-guide-for-beginners/)
can often outperform human traders through speed, discipline, and consistency.
While the knowledge barrier remains relatively high, the process has become far more accessible thanks to the Bitunix API solution. The API streamlines development workflows and provides comprehensive [API documentation](https://openapidoc.bitunix.com/)
, making it easier for developers and traders to build custom trading systems and deploy them directly on the Bitunix platform.
This guide provides a detailed, step-by-step explanation of how to create your first API key, understand the available endpoints, and deploy automated trading strategies on the Bitunix [crypto exchange](https://www.bitunix.com/)
with confidence.
What Is an API and Why Use It for Trading?
------------------------------------------
Using an API might seem a little daunting at first, but it can be well worth the effort. An automated trading system can operate 24/7 and react to market movements without emotion, which gives it a considerable advantage over manual trading, especially in fast-moving crypto markets.
An API, or Application Programming Interface, is a set of rules that allows one software application to interact with another. In trading, APIs enable external programs, such as bots or custom dashboards, to interact directly with an exchange’s infrastructure.
In simple terms, APIs act as a communication bridge between two systems. Your trading bot sends instructions through the API, and the exchange responds with data or executes actions based on those requests.
[Crypto trading](https://blog.bitunix.com/en/crypto-trading-discipline-rules/)
platforms expose key functionality through APIs, including market data access, account information, and order execution. This allows traders to build systems that interact with the exchange without using the standard web interface.
### Why Use An API
* Automation: Run trading strategies continuously without manual input, removing emotional decision-making Speed: Place, modify, and cancel orders far faster than any human trader
* Customization: Build tailored tools, dashboards, and analytics specific to your strategy
* Backtesting: Pull historical market data to test, refine, and validate strategies before deploying them live

The Bitunix API: REST vs. WebSocket
-----------------------------------
The Bitunix API provides both REST and WebSocket APIs, giving developers the two tools they need to build successful automated trading systems. Each API serves a different purpose, and understanding how they work together is essential for building a reliable and high-performance trading infrastructure on Bitunix.
### REST
Professional trading systems almost always use REST and WebSocket APIs in combination. REST is used to send instructions and manage accounts, while WebSocket is used to continuously listen to market activity in real time. Using both together allows systems to react instantly to market changes while maintaining precise control over execution.
The REST API is designed for actions. It operates on a request-response model, meaning the client sends a request and the server returns a response. Typical use cases include placing orders, canceling orders, checking balances, and retrieving account information.
Because of this structure, the REST API is best suited for account management and trade execution. It is reliable, secure, and ideal for actions that do not require real-time streaming data but must be confirmed and recorded accurately.
### WebSocket
The [WebSocket API](https://websocket.org/reference/websocket-api)
, by contrast, provides a persistent, real-time data stream. Once connected, the server continuously pushes updates to the client without the need for repeated requests.
These push-based updates dramatically reduce latency and resource usage, making WebSocket the preferred choice for live market data, order book depth, price updates, and trade events. For automated trading systems that rely on speed and precision, WebSocket is essential.
In a typical automated trading system, WebSocket and REST work together in a complementary way. WebSocket streams live price data and order book updates in real time, allowing the system to detect trading signals the moment market conditions change. Once a signal is triggered, the REST API is used to place, modify, or cancel orders and to confirm execution and account balances.
What You Can Do with the Bitunix API
------------------------------------
The Bitunix API allows developers to build almost any form of automated trading system they can imagine. Due to the platform’s extensive feature set, which includes spot trading and leveraged futures, developers are not restricted to simple strategies. Instead, they can design systems that react dynamically to market conditions and execute trades with precision.
### Market Data Endpoints
Market data endpoints provide access to real-time and historical OHLCV data, live order book depth, and recent trade history for any trading pair. In practice, a trading bot might stream live prices and order book data to detect momentum shifts or liquidity gaps, while also pulling historical candles to validate signals against past performance.
### Account Management Endpoints
Account management endpoints allow systems to monitor balances, retrieve deposit and withdrawal history, and track overall account activity. This is useful for enforcing risk controls, such as pausing trading when balances fall below a threshold or adjusting position sizes based on available margin.
### Trading Endpoints
Trading endpoints enable full execution control, including placing market, limit, and stop-loss orders, canceling or querying open orders, and retrieving trade history and open positions. This allows bots to manage entries and exits precisely while maintaining visibility over current exposure.
When combined, these three endpoint groups form a complete trading loop. For example, a bot can use WebSocket market data to identify a breakout, confirm account balance through account endpoints, execute a trade using trading endpoints, and then manage the position in real time until exit conditions are met.
Getting Started - Your First Steps with the Bitunix API
-------------------------------------------------------
The first step to take before building your API is to [sign up](https://www.bitunix.com/register)
for a Bitunix account or [download](https://www.bitunix.com/download)
the application. Then you will need to navigate to the API section in your account. You will then need to select the purpose of the API, such as Trading API, [Copy Trading](https://www.bitunix.com/copy-trading/square)
API, or Bind Third-Party App.
**Step 1: Generate Your API Keys**
In the API menu, create a new key and give it a clear note/label such as “TradingBot” so you can identify it later. Bitunix will generate an APIKey and a SecretKey. The SecretKey is highly sensitive and is typically shown only once, so you must store it securely in a password manager or encrypted vault.
**Step 2: Bind IP Addresses (Recommended)**
If your trading system runs from a fixed server or VPS, add IP binding to restrict where the key can be used. Bitunix allows each key to bind up to 20 IP addresses, and multiple IPs can be entered, separated by commas. This is one of the most effective ways to reduce risk if a key is ever exposed.
**Step 3: Set Permissions Carefully**
Choose the minimum permissions required for your use case. If you are only pulling market data or building dashboards, select read-only permissions. If you plan to place trades, enable trading permissions. In most cases, you should avoid enabling withdrawal permissions, as withdrawals are the highest-risk permission category and are rarely needed for automated trading systems.
**Step 4: Complete Security Verification**
Bitunix requires security verification during API creation, typically through an email verification code. This step ensures that key creation is confirmed by the account owner and adds another security layer before the API becomes active.
**Step 5: Choose Your Language or Tool**
Select a development stack based on what you are building. Python is a common choice for bots and data analysis, while JavaScript is widely used for web dashboards and backend services. If you want to test requests quickly without writing code, tools like Postman are useful for validating endpoints, headers, and authentication logic before integrating into a full trading system.
**Step 6: Make an Authenticated Request**
Public endpoints generally provide market data without authentication, but private endpoints require signed requests using your APIKey and SecretKey. Bitunix uses a signing process that includes a timestamp and a nonce, and the signature is generated using double SHA-256 hashing. A simple first test is requesting your account balance through a private endpoint, which confirms that authentication, permissions, and signing are working correctly.
**Step 7: Build the Trading Workflow**
Once authentication is working, most developers build in stages: first market data streaming (often via WebSocket), then order execution (REST), then account and risk controls (balances, exposure limits, and logging). This structured approach helps you validate each component before moving to live trading and reduces the chance of costly errors.

### Additional Information
In addition to the core endpoints covered in this guide, the dedicated Bitunix API documentation provides detailed instructions for a wide range of advanced features. These include market data endpoints such as order book depth, funding rates, klines, tickers, and available trading pairs, as well as position management endpoints for retrieving open, pending, and historical positions.
The documentation also covers full take-profit and stop-loss functionality, allowing developers to place, modify, and cancel orders programmatically. This makes the Bitunix API suitable not only for basic bots, but also for sophisticated [futures](https://www.bitunix.com/contract-trade/BTCUSDT)
trading systems with dynamic risk management.
Final Thoughts on Bitunix API
-----------------------------
Using the Bitunix API to build trading systems unlocks a world of opportunities. Builders who use the Bitunix API benefit from detailed documentation and from the security and reliability of the exchange, which provides live [proof of reserves](https://www.bitunix.com/proof-of-reserve)
and maintains a $30 million [USDC Care Fund](https://support.bitunix.com/hc/en-us/articles/51553821795993-Bitunix-Official-Launch-of-Bitunix-Care-Fund)
. While this guide outlines how to build an automated trading system, additional support is available in the Bitunix API documentation.
FAQs
----
**Is using the Bitunix API free?**
Yes. The Bitunix API is free to use for all account holders and does not carry separate API usage fees.
**How do I keep my API keys secure?**
API keys should be stored securely in encrypted environments or password managers. Always enable IP whitelisting, restrict permissions to the minimum required, avoid withdrawal access, and never expose keys in public repositories or screenshots.
**What are API rate limits, and what are they on Bitunix?**
API rate limits control how frequently requests can be sent. Bitunix provides generous limits suitable for automated, high-frequency, and professional trading systems.
**What programming languages can I use with the Bitunix API?**
Any language supporting HTTP and WebSocket connections can be used, including Python, JavaScript, Go, Java, and C++.
**Is there an official SDK (Software Development Kit) for the Bitunix API?**
There is no mandatory SDK. The API is language-agnostic and designed to be accessed directly using standard HTTP and WebSocket libraries.
**What’s the difference between the testnet and mainnet API?**
The testnet allows developers to test strategies using simulated funds without financial risk, while the mainnet connects to live markets, real balances, and executes real trades.
**Can I use the API to access historical data for backtesting?**
Yes. Historical klines, trade history, and other market data can be retrieved through Bitunix API endpoints.
**What is a “signed” request and why is it necessary?**
A signed request uses cryptographic hashing to verify authenticity, ensuring that only authorized users can access private endpoints like balances and order execution.
**Where can I find the full Bitunix API documentation?**
The complete API documentation is available directly on the official Bitunix website under the API section.
**What should I do if my API key is compromised?**
Immediately delete the affected API key from your Bitunix account, review account activity, rotate credentials, enable stricter permissions, and reissue a new key with updated IP restrictions.
Glossary
--------
**API:** Interface that allows software systems to communicate.
**REST API:** Request-based API used for actions and commands.
**WebSocket:** Persistent connection for real-time data streaming.
**API Key:** Public identifier used to access API services.
**Secret Key:** Private key used to sign authenticated requests.
**Signed Request:** Authenticated API request verified cryptographically.
**Rate Limit:** Maximum number of API requests allowed.
**OHLCV:** Open, high, low, close, volume price data.
**Order Book:** Live list of buy and sell orders.
**About Bitunix**
-----------------
[Bitunix](https://www.bitunix.com/)
is a global cryptocurrency derivatives exchange trusted by over 3 million users across more than 100 countries. The platform is committed to providing a transparent, compliant, and secure trading environment for every user. Bitunix offers a fast registration process and a user-friendly verification system supported by mandatory KYC to ensure safety and compliance. With global standards of protection through [Proof of Reserves (POR)](https://www.bitunix.com/proof-of-reserve)
and the [Bitunix Care Fund](https://support.bitunix.com/hc/en-us/articles/51553821795993-Bitunix-Official-Launch-of-Bitunix-Care-Fund)
, Bitunix prioritizes user trust and fund security. The K-Line Ultra chart system delivers a seamless trading experience for both beginners and advanced traders, while leverage of up to 200x and deep liquidity make Bitunix one of the most dynamic platforms in the market.
Bitunix Global Accounts
[X](https://x.com/BitunixOfficial)
| [Telegram Announcements](https://t.me/Bitunixglobalofficial)
| [Telegram Global](https://t.me/bitunixglobal)
| [CoinMarketCap](https://coinmarketcap.com/community/profile/Bitunix/)
| [Instagram](https://www.instagram.com/bitunixglobal/)
| [Facebook](https://www.facebook.com/bitunixexchange)
| [LinkedIn](https://www.linkedin.com/company/bitunix/)
| [Reddit](https://www.reddit.com/r/bitunix/)
| [Medium](https://bitunix.medium.com/)
---
# Sign - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/sign/#signature-introduction)
Sign
====
### Signature Introduction[¶](https://www.bitunix.com/api-docs/spots/en_us/sign/#signature-introduction "Permanent link")
#### Restful API Signature Public Parameters[¶](https://www.bitunix.com/api-docs/spots/en_us/sign/#restful-api-signature-public-parameters "Permanent link")
**Headers:**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| api-key | string | Y | api-key applied |
| nonce | string | Y | Random string,32bits |
| timestamp | string | Y | Current timestamp, milliseconds |
| sign | string | Y | Singanture string |
Signature steps:
> 1. All queryParams are sorted in ascending ASCII order by Key, Example: String queryParams = "id=1uid=200"
> 2. Parameters in body, compressed into a string, **remember to remove all spaces**, Example:String body = {"uid":"2899","arr":\[{"id":1,"name":"maple"},{"id":2,"name":"lily"}\]}
> 3. Signature, needs to be encrypted 2 times
>
> > * String digest = SHA256(nonce + timestamp + api-key + queryParams + body)
> > * String sign = SHA256(digest + secretKey)
> > * Note: secretKey is together when applying for api-key. Please keep them safely and do not pass it around.
>
#### WebSocket API Singature Parameters[¶](https://www.bitunix.com/api-docs/spots/en_us/sign/#websocket-api-singature-parameters "Permanent link")
WebSocket API requests require authentication, and the following fields need to be included in all request parameter `params`:
| Name | Type | Mandatory | Description |
| --- | --- | --- | --- |
| `apiKey` | string | Y | API Key |
| `timestamp` | string | Y | Timestapmp |
| `nonce` | string | Y | Random string |
| `sign` | string | Y | Signature string |
Signature steps:
> 1. Sort all fields in `params` except the `sign`, `apiKey`, `timestamp`, `nonce` fields in ascending ASCII order by Key, **remember to remove all spaces**, Example: String params = "symbolBTC"
> 2. Signature, needs to be encrypted 2 times
>
> > * String digest = SHA256(nonce + timestamp + apiKey + params)
> > * String sign = SHA256(digest + secretKey)
> > * Note: secretKey is together when applying for apiKey. Please keep them safely and do not pass it around.
>
Back to top
---
# Public - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/public/#quick-start)
Public
======
[Quick Start](https://www.bitunix.com/api-docs/spots/en_us/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#quick-start "Permanent link")
----------------------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#restful-api "Permanent link")
--------------------------------------------------------------------------------------------------
### Public Interface[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#websocket-api "Permanent link")
------------------------------------------------------------------------------------------------------
### [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/en_us/ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#websocket-introduction "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#order-interface_1 "Permanent link")
* * *
#### 1\. Get latest price[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#1-get-latest-price "Permanent link")
> HTTP Requeset
>
> GET: /api/spot/v1/market/last\_price
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| symbol | string | Y | Pair |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | string | N | Last price |
* * *
#### 2\. Get depth data[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#2-get-depth-data "Permanent link")
> HTTP Request
>
> GET: /api/spot/v1/market/depth
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| symbol | string | Y | Trading pair |
| precision | number | Y | token precision |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Depth data |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| asks | object\[\] | N | asks order depth |
| bids | object\[\] | N | bids order depth |
| ts | string | N | timestamp |
asks/bids
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| price | string | N | Price |
| volume | string | N | Size |
* * *
#### 3\. Get K-Line data[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#3-get-k-line-data "Permanent link")
> HTTP Request
>
> GET: /api/spot/v1/market/kline
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| symbol | string | Y | Trading Pair |
| interval | string | Y | kline interval,Default is 1min(1,3,5,15,30,60,120,240,360,720,D,M,W) |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | K-Line data |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| symbol | string | N | Trading pair |
| open | string | N | Open price |
| high | string | N | Highest price |
| low | string | N | Lowest price |
| close | string | N | Last price |
| ts | string | N | kline Starting timeISO8601 |
* * *
#### 4\. Get K-Line history data[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#4-get-k-line-history-data "Permanent link")
> HTTP Request
>
> GET: /api/spot/v1/market/kline/history
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| symbol | string | Y | Trading Pair |
| interval | string | N | kline interval,Default is 1min(1,3,5,15,30,60,120,240,360,720,D,M,W) |
| endTime | string | N | End timestamp (seconds), open interval, such as 1696507201. If not transmitted, it defaults to the current time and does not include the latest data |
| limit | string | N | Number of K-Line data, 1-500,Default is 200 |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | K-Line data |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| symbol | string | N | Trading pair |
| open | string | N | Open price |
| high | string | N | Highest price |
| low | string | N | Lowest price |
| close | string | N | Last price |
| ts | string | N | kline Starting timeISO8601 |
* * *
#### 5\. Query trading pair data[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#5-query-trading-pair-data "Permanent link")
> HTTP Request
>
> GET: /api/spot/v1/common/coin\_pair/list
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| Null | | | |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object\[\] | N | Trading pair Data |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| id | string | N | id |
| base | string | N | Base token |
| quote | string | N | Quote token |
| basePrecision | string | N | Base token precision |
| quotePrecision | string | N | Quote token precision |
| minPrice | string | N | Minimun trading amount |
| minVolume | string | N | Minimum trading volume |
| isOpen | string | N | Whether the pair is open or not |
| isHot | string | N | Whether the pair is trending or not |
| isRecommend | string | N | Whether the pair is recommended or not |
| isShow | string | N | Whether the pair is found or not |
| tradeArea | string | N | Trading categories |
| sort | string | N | Sorting order |
| openTime | string | N | Trading pair open time |
| precisions | string\[\] | N | Precesion of the trading pair |
* * *
#### 6\. Query rate data[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#6-query-rate-data "Permanent link")
> HTTP Request
>
> GET: /api/spot/v1/common/rate/list
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| Null | | | |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object\[\] | N | Rate data |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| baseSymbol | string | N | Base token |
| quoteSymbol | string | N | Quote token |
| rate | string | N | Rate |
* * *
#### 7\. Query token data[¶](https://www.bitunix.com/api-docs/spots/en_us/public/#7-query-token-data "Permanent link")
> HTTP Request
>
> GET: /api/spot/v1/common/coin/coin\_network/list
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| Null | | | |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object\[\] | N | Token data |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| name | string | N | Token |
| fullName | string | N | Token full name |
| logo | string | N | Token icon |
| track | string | N | Categories |
| quotePrecision | string | N | Quote token precision |
| minPrice | string | N | Minumim order price |
| isOpen | string | N | Available for trading |
| isHot | string | N | Whether the token is trending |
| depositOpen | string | N | If deposit is open,0 means not,1 means deposit open; |
| isShow | string | N | Whether the token can be found |
| withdrawOpen | string | N | If withdrawal is open,0 means not, 1 means withdrawal open; |
| withdrawMin | string | N | Minimum withdrawal amount |
| withdrawMax | string | N | Maximum withdrawal amount |
| networks | object\[\] | N | Data of the the network of the token |
networks
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| contractPrecision | string | N | Token precision |
| contractAddress | string | N | Contract Address of the token |
| requireMemo | string | N | If memo is needed.0:No,1:Optional,2:Required |
| chain | string | N | Chain of the token |
| depositConfirm | string | N | How many blocks are needed for confirmation |
| addressRegular | string | N | Address regular verification |
| network | string | N | Name of Network |
| isOpen | string | N | Whether the network is open; 0:Close, 1:Open |
| depositOpen | string | N | If deposit is open,0 means not,1 means deposit open; |
| isShow | string | N | Whether the token can be found |
| withdrawOpen | string | N | If withdrawal is open,0 means not, 1 means withdrawal open; |
| withdrawMin | string | N | Minimum withdrawal amount |
| withdrawMax | string | N | Maximum withdrawal amount |
| depositMin | string | N | Minumum deposit amount |
{
"code": "0",
"msg": "Success",
"data": [\
{\
"name": "USDT",\
"fullName": "Tether",\
"logo": "https://image.xushidaifa.com/config/kv/358844.png",\
"track": "Metaverse",\
"isHot": 1,\
"isOpen": 1,\
"isShow": 1,\
"depositOpen": 1,\
"withdrawOpen": 1,\
"withdrawMin": "0",\
"withdrawMax": null,\
"networks": [\
{\
"contractPrecision": 6,\
"contractAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",\
"requireMemo": 0,\
"chain": "TRON",\
"depositConfirm": 20,\
"addressRegular": ".+",\
"network": "Tron (TRC-20)",\
"isOpen": 1,\
"isShow": 1,\
"depositOpen": 1,\
"withdrawOpen": 1,\
"withdrawMax": "3000000",\
"withdrawMin": "0.000001",\
"depositMin": "0.000001"\
}\
]\
}\
],
"success": true
}
* * *
Back to top
---
# Tax filing - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#quick-start)
Tax filing
==========
[Quick Start](https://www.bitunix.com/api-docs/spots/en_us/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#quick-start "Permanent link")
--------------------------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#restful-api "Permanent link")
------------------------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#order-interface "Permanent link")
### Tax Filing Interface[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#websocket-api "Permanent link")
----------------------------------------------------------------------------------------------------------
### [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/en_us/ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#websocket-introduction "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#order-interface_1 "Permanent link")
* * *
#### 1\. Query tax filing data (paginated)[¶](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/#1-query-tax-filing-data-paginated "Permanent link")
> [Sign](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/tax/filing/page
**API Description**
* Requires [signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
authentication. Returns tax filing data for the main account and its sub accounts associated with the current API Key.
* The response format matches the platform tax export, suitable for third-party tax tool integration.
* The time range `[startTime, endTime]` uses UTC in ISO8601 format (e.g. `2024-01-01T00:00:00Z`).
* `dataTypeCodes` is a list of tax data type codes; at least one item is required. Only enabled type codes in the system are supported. See [dataTypeCodes](https://www.bitunix.com/api-docs/spots/en_us/tax_data_type_codes/)
for details.
* Pagination starts from page 1. Default page size is 1000, maximum 1000.
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| startTime | string | Y | Query start time (UTC, ISO8601), e.g. `2024-01-01T00:00:00Z` |
| endTime | string | Y | Query end time (UTC, ISO8601), e.g. `2024-12-31T23:59:59Z` |
| dataTypeCodes | string\[\] | Y | [dataTypeCodes](https://www.bitunix.com/api-docs/spots/en_us/tax_data_type_codes/)
list, at least one item |
| page | number | N | Page number, starts from 1, default 1 |
| pageSize | number | N | Page size, default 1000, maximum 1000 |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Paginated result |
Data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| records | object\[\] | Y | Tax filing data list |
| total | number | Y | Total count |
| current | number | Y | Current page |
| size | number | Y | Page size |
| pages | number | Y | Total pages |
Records
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| date | string | Y | Transaction time (UTC) |
| labelEn | string | Y | Transaction type label |
| account | string | Y | Account |
| outgoingAsset | string | Y | Outgoing asset |
| outgoingAmount | string | Y | Outgoing amount |
| incomingAsset | string | Y | Incoming asset |
| incomingAmount | string | Y | Incoming amount |
| feeAsset | string | Y | Fee asset |
| feeAmount | string | Y | Fee amount |
| typeId | string | Y | Type ID |
| txId | string | Y | On-chain transaction ID |
| fromAddress | string | Y | From address |
| toAddress | string | Y | To address |
| network | string | Y | Network |
| referenceId | string | Y | Reference ID |
| comment | string | Y | Comment |
> Note: If amount, address, or other fields have no corresponding data, `—` is returned.
* * *
Back to top
---
# User ws - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#quick-start)
User ws
=======
[Quick Start](https://www.bitunix.com/api-docs/spots/en_us/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#quick-start "Permanent link")
-----------------------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#restful-api "Permanent link")
---------------------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#websocket-api "Permanent link")
-------------------------------------------------------------------------------------------------------
### [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/en_us/ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#websocket-introduction "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#public-interface_1 "Permanent link")
### User Interface[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#order-interface_1 "Permanent link")
* * *
#### 1\. Query account balance[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#1-query-account-balance "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "user.account",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Type | Mandatory | Description |
| --- | --- | --- | --- |
| None | | | |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [//Account Information\
{\
"coin": "BTC",//Coin\
"balance": 10000.00,//Balance\
"balanceLocked": 1000.00//Locked Balance\
}\
]
}
* * *
#### 2\. Get user information[¶](https://www.bitunix.com/api-docs/spots/en_us/user-ws/#2-get-user-information "Permanent link")
Same semantics as [REST user · Get user information](https://www.bitunix.com/api-docs/spots/en_us/user/)
: returns the `uid` for the API key; for a sub-account key, returns the linked master account `uid`. Signing rules are in [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/en_us/ws/)
.
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "user.info",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Type | Mandatory | Description |
| --- | --- | --- | --- |
| None | | | |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"uid": 681979174
}
}
The `data` object follows the same contract as REST: `uid` is int64 and may be `null`.
* * *
Back to top
---
# User - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/user/#quick-guide)
User
====
[Quick Guide](https://www.bitunix.com/api-docs/spots/en_us/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#quick-guide "Permanent link")
--------------------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#restful-api "Permanent link")
------------------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#public-interface "Permanent link")
### User Interface[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#websocket-api "Permanent link")
----------------------------------------------------------------------------------------------------
### [WebSocket Guide](https://www.bitunix.com/api-docs/spots/en_us/ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#websocket-guide "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#order-interface_1 "Permanent link")
* * *
#### 1\. Checking account balance[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#1-checking-account-balance "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> GET: /api/spot/v1/user/account
**Request Parameters**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| None | | | |
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Errod Code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object\[\] | N | Account Information |
data
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| coin | string | Y | Token |
| balance | number | Y | Balance |
| balanceLocked | number | Y | In Use |
#### 2\. Get user information[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#2-get-user-information "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> GET: /api/spot/v1/user/info
**API Description**
* Requires [signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
authentication and returns information for the user bound to the current API key.
* You can also use **WebSocket** with `method` = `user.info`; the `data` shape matches below—see [User Interface (WebSocket)](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
.
* **`uid`**: The user identifier in the Open API. With a **master** account API key, this is that master account’s `uid`. With a **sub-account** API key, this is the `uid` of the **linked master account** (so integrations can align on one user id per master account).
* If the user or linked master account cannot be resolved, the response follows [error codes](https://www.bitunix.com/api-docs/spots/en_us/err_code/)
.
* `uid` may be `null`; rely on the actual response and handle nulls in your integration.
**Request Parameters**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| None | | | |
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error Code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | User information |
data
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| uid | int64 | N | User `uid`; with a sub-account API key, the linked master account `uid`; may be null |
{
"code": "0",
"msg": "result.success",
"data": {
"uid": 681979174
},
"success": true
}
#### 3\. Submit withdrawal request[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#3-submit-withdrawal-request "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/withdraw
**API Description**
* You can only withdraw to address or accounts that have added under quick-withdrawal. You can set up the quick-withdrawal address on the webesite or application.A
* Tag or MEMO: Some tokens like XRP will require a Tag or MEMO, or payment\_id. This is the only string that matching your deposit address. Please make sure you have enter the correct information, otherwise your assets may be lost.
* Only the apikey that has enabled withdrawal permission can be used to withdraw. Otherwise it will be rejected.
**Request Parameters(Rules: 10 times/1 second(IP)**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| coin | string | Y | Token
You can get this in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData)
Interface |
| network | string | Y | Network |
| address | string | Y | Withdrawal address |
| amount | decimal | Y | Withdrawal amount
Withdrawal Amount(Withdrawal amount - fee = Actual amount)
Decimals can be found in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData)
interface. |
| memo | string | N | Tag or memo |
{
"coin": "TRX",
"network": "Tron (TRC-20)",
"address": "TJmW5D1p1LnMdTMmxuY1VELHht7v5HV7rU",
"amount": 20.00
}
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Withdrawal Order ID |
data
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| withdrawId | string | Y | WIthdrawal Order ID |
{
"code": "0",
"msg": "result.success",
"data": "1909879608889339906",
"success": true
}
#### 4\. Cancel Withdrawal[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#4-cancel-withdrawal "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/withdraw/cancel
**API Description**
* When it's under manual review and on the intial reviewing stage, it can be canceled Once it's approved or it's on the network, it can't be canceled.
**Request Parameters(Rules: 10 times/1 second(IP)**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| withdrawId | string | Y | Withdrawal Order ID |
{
"withdrawId": "1909879608889339906"
}
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error Code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Null |
{
"code": "0",
"msg": "result.success",
"data": null,
"success": true
}
#### 5\. Initiate Internal Transfer[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#5-initiate-internal-transfer "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/inside\_transfer
**API Description**
* Only the apikey that has enabled withdrawal permission can be used to withdraw. Otherwise it will be rejected.
**Request Parameters(Rules: 10 times/1 second(IP)**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| outBizId | string(32) | N | External service provider business ID, used as an idempotency parameter. |
| coin | string | Y | Token
You can get this in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData)
interface |
| amount | decimal | Y | Transfer amount
Decimals can be found in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData) |
| toType | string | Y | Method
`uid` via UID
`phone` via mobile number
`email` via email |
| toUid | int64 | N | UID |
| toPhoneCountryCode | string | N | Area code |
| toPhoneNumber | string | N | Mobile number |
| toEmail | string | N | Email address |
| remark | string(256) | N | Remark |
{
"coin": "USDT",
"amount": 10,
"toType": "uid",
"toUid": 681979174
}
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | string | Y | Internal Transfer Order ID |
data
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| insideTransferId | string | Y | Order ID |
{
"code": "0",
"msg": "result.success",
"data": "1909921053381820417",
"success": true
}
#### 6\. Cancel Internal Transfer[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#6-cancel-internal-transfer "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/inside\_transfer/cancel
**API Description**
* When it's under manual review and on the intial reviewing stage, it can be canceled Once it's approved, it can't be canceled.
**Request Parameters(Rules: 10 times/1 second(IP)**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| insideTransferId | string | Y | Internal Transfer Order ID
It can be acquired by using [RequestInternalTransfer](https://www.bitunix.com/api-docs/spots/en_us/user/#RequestInternalTransfer)
interface |
{
"insideTransferId": "1909921053381820417"
}
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | description |
| data | object | N | Order ID |
data
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| insideTransferId | string | Y | Order ID |
{
"code": "0",
"msg": "result.success",
"data": null,
"success": true
}
#### 7\. Request Withdrawal History(Withdrawal and Internal Transfer Included)[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#7-request-withdrawal-historywithdrawal-and-internal-transfer-included "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/withdraw\_transfer/page
**Request Parameters(Rules: 10 times/1 second(IP)**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| id | string | N | Withdrawal Order ID / Internal Transfer Order ID |
| outBizId | string | N | External service provider business ID |
| coin | string | N | Token
You can get this in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData)
interface |
| transactionHash | string | N | TxID
Valid only when the type is `withdraw` |
| type | string | N | Withdrawal Type
`withdraw` = Withdrawal
`inside_transfer_out` = Internal Transfer |
| startTime | int64 | N | Starting time of the request, Unix timestamp, e.g., 1597026383085 |
| endTime | int64 | N | Ending time of the request, Unix timestamp, e.g., 1597026683085 |
| remark | string | N | Remark (Precise query) |
| limit | int32 | N | Number of results. Default: 100. Maximum: 100. Returns 100 if not specified. |
{
"id": "1909877667383767042",
"limit": 10
}
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error Code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Withdrawal / Internal Transfer Records |
data
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| id | string | Y | Withdrawal Order ID / Internal Transfer Order ID |
| outBizId | string | N | External service provider business ID |
| coin | string | Y | Token Name |
| network | string | Y | Network |
| amount | decimal | Y | Actual Receiving Amount |
| feeCoin | string | Y | Fee Token |
| fee | decimal | Y | Fee |
| type | string | Y | Type
`withdraw`: On-chain withdrawal
`inside_transfer_out`: Internal Transfer |
| toAddress | string | N | Address(It will only be returned when `type=withdraw`) |
| transactionHash | string | N | TxID (It will only be returned when `type=withdraw`) |
| toType | string | N | Method
`uid`:Via ID
`phone`:Via Mobile Number
`email`:Via Email |
| toUid | int64 | N | Receiving UID(It will only be returned when `toType=uid`) |
| toPhoneCountryCode | string | N | Area Code(It will only be returned when `toType=phone`) |
| toPhoneNumber | string | N | Mobile(It will only be returned when `toType=phone`) |
| toEmail | string | N | Email(It will only be returned when`toType=email`) |
| remark | string(256) | N | Remark |
| status | string | Y | Status
`verification`:Pending user security authentication (security verification needs to be done in the client's withdrawal list).
`pending`:Pending
`cancelled`:Cancelled
`success`:Completed
`fail`:Failed |
| ctime | int64 | Y | Time of the request creation,Unix timestamp. For example:`1597026383085` |
{
"code": "0",
"msg": "result.success",
"data": [\
{\
"id": "1909877667383767042",\
"outBizId": "123456789",\
"type": "withdraw",\
"coin": "TRX",\
"amount": "19.00000000000000000000",\
"status": "pending",\
"ctime": 1744185294000,\
"network": "Tron (TRC-20)",\
"address": "TJmW5D1p1LnMdTMmxuY1VELHht7v5HV7rU",\
"transactionHash": null,\
"feeCoin": null,\
"fee": null,\
"memo": null,\
"toType": null,\
"toUid": null,\
"toPhoneCountryCode": null,\
"toPhoneNumber": null,\
"toEmail": null,\
"remark": null\
}\
],
"success": true
}
#### 8\. Transfer[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#8-transfer "Permanent link")
> [Siganature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/funds\_transfer
**API Description**
* Transfer of different types of fudns within personal account. For example, transfering funds from spot account to futures account.
**Request Parameters(Rules: 10 times/1 second(IP)**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| type | string | Y | Transfer Type
`spot_futures` From spot account to futures account
`futures_spot` From futures account to spot account |
| coin | String | Y | Token
You can get this in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData)
interface |
| amount | decimal | Y | Transfer amount
Decimals can be found in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData)
interface |
{
"type": "spot_futures",
"coin": "USDT",
"amount": 100.01
}
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error Code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | string | Y | Transfer Order ID |
data
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| transferId | string | Y | Transfer Order ID |
{
"code": "0",
"msg": "result.success",
"data": "1909902180506972162",
"success": true
}
#### 9\. Get Deposit Records (On-chain Deposit + Internal Transfer)[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#9-get-deposit-records-on-chain-deposit-internal-transfer "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/deposit/page
**API Description**
**Request Parameters (Rate Limit: 10 requests/second per IP)**
| Parameter Name | Type | Required | Description |
| --- | --- | --- | --- |
| id | string | No | Deposit ID / Transfer ID |
| coin | string | No | Coin
You can obtain it via the [Query Coin Info](https://www.bitunix.com/api-docs/spots/en_us/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
API |
| type | string | No | Deposit Type
`deposit`: On-chain deposit
`inside_transfer_in`: Internal transfer |
| transactionHash | string | No | Transaction hash (applies only for `deposit`) |
| startTime | int64 | No | Query start time, Unix timestamp, e.g., 1597026383085 |
| endTime | int64 | No | Query end time, Unix timestamp, e.g., 1597026683085 |
| limit | int32 | No | Number of records to return, maximum 100, default is 100 if not provided |
{
"type": "",
"transactionHash": "",
"coin": "USDT",
"limit": 10
}
**Response Data**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| code | number | Yes | [Error Code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Yes | Description |
| data | object | No | Withdrawal / Transfer Records |
**data**
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| id | string | Yes | Deposit ID / Transfer ID |
| transactionHash | string | No | Transaction ID (returned only when `type=deposit`) |
| coin | string | Yes | Coin name |
| network | string | No | Network (returned only when `type=deposit`) |
| type | string | Yes | Deposit type
`deposit`: On-chain deposit
`inside_transfer_in`: Internal transfer |
| fromAddress | string | Yes | Sender address
`deposit`: On-chain sender address
`inside_transfer_in`: Sender user ID |
| toAddress | string | Yes | Recipient address
`deposit`: On-chain recipient address
`inside_transfer_in`: Recipient user ID |
| amount | decimal | Yes | Actual credited amount |
| status | string | Yes | Deposit status
`pending`: Processing
`cancelled`:cancel
`success`: Successful
`fail`: Failed |
| ctime | int64 | Yes | Creation time, Unix timestamp, e.g., `1597026383085` |
{
"code": "0",
"msg": "Success",
"data": [\
{\
"id": 1909903708907155457,\
"transactionHash": null,\
"coin": "USDT",\
"network": null,\
"type": "inside_transfer_in",\
"fromAddress": "989541187",\
"toAddress": "681979174",\
"amount": "10.00000000",\
"status": "pending",\
"ctime": 1744191503000\
},\
{\
"id": 1909903532977074178,\
"transactionHash": null,\
"coin": "USDT",\
"network": null,\
"type": "inside_transfer_in",\
"fromAddress": "989541187",\
"toAddress": "681979174",\
"amount": "10.00000000",\
"status": "pending",\
"ctime": 1744191461000\
},\
{\
"id": 487067,\
"transactionHash": "d829e32be84907a4dfb5bee5dcdaee6b637be287f8db52817860e7169003b92d",\
"coin": "USDT",\
"network": "Tron (TRC-20)",\
"type": "deposit",\
"fromAddress": "TB73gtW1hsTxxA9XUYKLSJKTSHw6Jk53eH",\
"toAddress": "TPKhSAEy84qvpomF5wF7h5ih1WmbmupXor",\
"amount": "1000.00000000",\
"status": "success",\
"ctime": 1742892246000\
}\
],
"success": true
}
#### 10\. Get Deposit Address[¶](https://www.bitunix.com/api-docs/spots/en_us/user/#10-get-deposit-address "Permanent link")
> [Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/deposit/address
**Request Parameters (Rate Limit: 10 requests/second per IP)**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| coin | string | Y | Token
You can get this in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData)
interface |
| network | string | Y | Network
You can get this in [QueryTokenData](https://www.bitunix.com/api-docs/spots/en_us/public/#QueryTokenData)
interface |
{
"coin": "USDT",
"network": "Tron (TRC-20)"
}
**Return**
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error Code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object\[\] | N | Deposit Address List |
data
| Parameter | Type | Mandatory | Notes |
| --- | --- | --- | --- |
| coin | string | Y | Token |
| network | string | Y | Network |
| address | string | Y | Deposit Address |
| memo | string | N | Memo/Tag |
{
"code": "0",
"msg": "result.success",
"data": [\
{\
"coin": "USDT",\
"network": "Tron (TRC-20)",\
"address": "TPKhSAEy84qvpomF5wF7h5ih1WmbmupXor",\
"memo": null\
}\
],
"success": true
}
* * *
Back to top
---
# Ws - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/ws/#quick-start)
Ws
==
[Quick Start](https://www.bitunix.com/api-docs/spots/en_us/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#quick-start "Permanent link")
------------------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#restful-api "Permanent link")
----------------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#websocket-api "Permanent link")
--------------------------------------------------------------------------------------------------
### WebSocket Introduction[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#websocket-introduction "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#order-interface_1 "Permanent link")
#### WebSocket API Introduction[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#websocket-api-introduction "Permanent link")
* Base URL for the wss interfaces listed here: wss://openapi.bitunix.com:443/ws-api/v1
* Timestamps are millisecond timestamps unless otherwise noted
* All field names and values are case sensitive.
* websocket connections are valid for 24 hours, please be careful to handle reconnections in case of disconnection.
#### Request Format[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#request-format "Permanent link")
WebSocket API requests must be transmitted in Json format in text frames, where a text frame message represents one request, example:
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "market.last_price",
"params": {
"symbol": "BTC",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "477eda21f570dd4e2f7392b729254d12bc2d403d1150d0b6cfdb52191267550c"
}
}
**String Explaination**
| Name | Type | Mandatory | Description |
| --- | --- | --- | --- |
| `id` | int/string/null | Y | Request ID, used to match the response to the corresponding request |
| `method` | string | Y | Request Method |
| `params` | object | Y | Request Parameter |
* `id` field can be any string, number, timestamp, etc., and is used to identify the request, and is returned in the response as is.
* `method` field is the request method.
* `params` field is the request parameters, according to the different request methods, the parameters are different, in any order.
#### Response Format[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#response-format "Permanent link")
WebSocket API requests must be transmitted in Json format in text frames, where a text frame message represents one request, example:
* Success example:
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": "10000.00"
}
* Failed example:
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "1",
"msg": "invalid symbol",
"data": null
}
**String Exmplaination**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| `id` | int/string/null | Y | Request ID |
| `code` | string | Y | Response code,"0" means success,others are error codes |
| `msg` | string | Y | Response descrtiption |
| `data` | object | N | Returns data, which varies depending on the request method and may be null |
#### Authentication[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#authentication "Permanent link")
WebSocket API requests require authentication and need to include the following fields in all request parameters:
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| `apiKey` | string | Y | API Key |
| `timestamp` | string | Y | Timestamp |
| `nonce` | string | Y | Random String |
| `sign` | string | Y | Signature String,Please refer to[Signature](https://www.bitunix.com/api-docs/spots/en_us/sign/#websocket-apiSigantureParameters) |
#### Connection Test[¶](https://www.bitunix.com/api-docs/spots/en_us/ws/#connection-test "Permanent link")
WebSocket API connection test. The test can be performed in the following ways:
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "ping",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
Back to top
---
# Err code - Open Platform
Err code
========
| Error code | Description |
| --- | --- |
| 0 | Success |
| 2 | Parameter error |
| 500 | System error |
| 100004 | app-key not found |
| 10016 | User does not exist |
| 70003 | Missing Parameters |
| 100008 | Request expired |
| 100005 | Parameter signature error |
| 10058 | volume precision error |
| 110041 | Interface access times are too fast |
| 110007 | Withdrawal amount cannot be less than the current fee |
| 110008 | Only withdrawals to whitelisted addresses are allowed |
Back to top
---
# Err code - Open Platform
Err code
========
| 错误码 | 错误说明 |
| --- | --- |
| 0 | 成功 |
| 2 | 参数错误 |
| 500 | 系统错误 |
| 100004 | app-key不存在 |
| 10016 | 用户不存在 |
| 70003 | 缺少参数 |
| 100008 | 请求时间过期 |
| 100005 | 参数签名错误 |
| 10058 | 数量精度错误 |
| 110041 | 接口访问次数过快 |
| 110007 | 提现金额不能小于当前手续费 |
| 110008 | 只能提币到免认证地址 |
Back to top
---
# Order ws - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_1)
Order ws
========
[快速入门](https://www.bitunix.com/api-docs/spots/zh_cn/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_1 "Permanent link")
--------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#restful-api "Permanent link")
----------------------------------------------------------------------------------------------------
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_2 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_3 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_4 "Permanent link")
### [报税数据接口](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#websocket-api "Permanent link")
--------------------------------------------------------------------------------------------------------
### [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#websocket "Permanent link")
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_6 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_7 "Permanent link")
### 订单接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#_8 "Permanent link")
* * *
#### 1\. 下单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#1 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.place_order",
"params": {
"side": 1,
"type": 1,
"volume": "100",
"price": "10000",
"symbol": "BTCUSDT",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| side | number | Y | 交易方向(1卖出2买入) |
| type | number | Y | 交易类型(1:限价交易 2:市价交易) |
| volume | string | Y | 委托量,限价时,基础币数量。市价时,计价币数量 |
| price | string | Y | 委托价 |
| symbol | string | Y | 币对 |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"orderId": "123456",//订单号
"side": 1,//交易方向(1卖出2买入)
"type": 1,//交易类型(1:限价交易 2:市价交易)
"volume": "100",//委托量
"price": "10000",//委托价
"symbol": "BTCUSDT",//币对
"placeStatus": "1"//下单是否成功, 1成功
}
}
* * *
#### 2\. 批量下单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#2 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.place_order.batch",
"params": {
"orderList": [\
{\
"side": 1,\
"type": 1,\
"volume": "100",\
"price": "10000",\
"symbol": "BTCUSDT"\
},\
{\
"side": 2,\
"type": 1,\
"volume": "100",\
"price": "10000",\
"symbol": "BTCUSDT"\
}\
],
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderList | object\[\] | Y | 下单集合 |
orderList
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| side | number | Y | 交易方向(1卖出2买入) |
| type | number | Y | 交易类型(1:限价交易 2:市价交易) |
| volume | string | Y | 委托量,限价时,基础币数量。市价时,计价币数量 |
| price | string | Y | 委托价 |
| symbol | string | Y | 币对 |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [\
{\
"orderId": "123456",//订单号\
"side": 1,//交易方向(1卖出2买入)\
"type": 1,//交易类型(1:限价交易 2:市价交易)\
"volume": "100",//委托量\
"price": "10000",//委托价\
"symbol": "BTCUSDT",//币对\
"placeStatus": "1"//下单是否成功, 1成功\
}\
]
}
* * *
#### 3\. 撤单/批量撤单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#3 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.cancel",
"params": {
"orderIdList": [\
{\
"orderId": "123456",\
"symbol": "BTCUSDT"\
}\
],
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderIdList | object\[\] | Y | 撤单集合 |
orderIdList
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单id |
| symbol | string | Y | 币对 |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": null
}
* * *
#### 4\. 查询撮合订单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#4 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.deal.list",
"params": {
"orderId": "123456",
"symbol": "BTCUSDT",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单ID |
| symbol | string | Y | 币对 |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"volume": "100",//成交数量
"price": "10000",//成交价格
"fee": "0.1",//手续费
"feeCoin": "BTC",//手续费币种
"role": "1",//角色(1-Maker 2-Taker)
"ctime": "2019-01-01T00:00:00Z",//成交时间(ISO8601)
"id": "123456"//撮合订单id
}
}
* * *
#### 5\. 查询历史委托订单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#5 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.history.page",
"params": {
"page": 1,
"pageSize": 10,
"startTime": "2019-01-01T00:00:00Z",
"endTime": "2019-01-01T00:00:00Z",
"status": "2",
"side": "1",
"type": "1",
"symbol": "BTCUSDT",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| page | number | N | 第几页 |
| pageSize | number | N | 每页条数 |
| startTime | string | N | 订单创建起始时间(ISO8601) |
| endTime | string | N | 订单创建结束时间(ISO8601) |
| status | string | N | 订单状态(1未成交,2已成交,3部分成交,4已撤单,7部分成交/已撤单) |
| side | string | N | 交易方向(1卖出2买入) |
| type | string | N | 订单类型(1限价2市价) |
| symbol | string | Y | 币对 |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"total": 100,
"pageNum": 1,
"pageSize": 10,
"data": [\
{\
"orderId": "123456",//订单ID\
"userId": "123456",//用户ID\
"orderType": "1",//订单类型,1.限价,2.市价\
"amount": "100",//委托总价值 (计价币)\
"dealAmount": "100",//成交数量\
"volume": "100",//已成交价值 (计价币)\
"leftAmount": "100",//剩余价值 (计价币)\
"volume": "100",//委托数量 (基准币)\
"dealVolume": "100",//已成交数量 (基准币)\
"leftVolume": "100",//剩余数量 (基准币)\
"status": "2",//订单状态(1未成交,2已成交,3部分成交,4已撤单,7部分成交/已撤单)\
"type": "1",//1.限价,2.市价\
"side": "1",//交易方向(1卖出2买入)\
"price": "10000",//委托价格\
"avgPrice": "10000",//平均成交价格\
"progress": "100",//成交百分比 单位为1% 15.8为15.8%\
"ctime": "2019-01-01T00:00:00Z",//订单创建时间\
"utime": "2019-01-01T00:00:00Z",//订单修改时间\
"base": "BTC",//基准币\
"quote": "USDT",//计价币\
"symbol": "BTCUSDT",//币对\
"fee": "0.1",//手续费\
"feeCoin": "BTC"//手续费币种\
}\
]
}
}
* * *
#### 6\. 查询当前委托订单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/#6 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.pending.list",
"params": {
"symbol": "BTCUSDT",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对 |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [\
{\
"orderId": "123456",//订单ID\
"userId": "123456",//用户ID\
"orderType": "1",//订单类型,1.限价,2.市价\
"amount": "100",//委托总价值 (计价币)\
"dealAmount": "100",//成交数量\
"volume": "100",//已成交价值 (计价币)\
"leftAmount": "100",//剩余价值 (计价币)\
"volume": "100",//委托数量 (基准币)\
"dealVolume": "100",//已成交数量 (基准币)\
"leftVolume": "100",//剩余数量 (基准币)\
"status": "2",//订单状态(1未成交,2已成交,3部分成交,4已撤单,7部分成交/已撤单)\
"type": "1",//1.限价,2.市价\
"side": "1",//交易方向(1卖出2买入)\
"price": "10000",//委托价格\
"avgPrice": "10000",//平均成交价格\
"progress": "100",//成交百分比 单位为1% 15.8为15.8%\
"ctime": "2019-01-01T00:00:00Z",//订单创建时间\
"utime": "2019-01-01T00:00:00Z",//订单修改时间\
"base": "BTC",//基准币\
"quote": "USDT",//计价币\
"symbol": "BTCUSDT",//币对\
"fee": "0.1",//手续费\
"feeCoin": "BTC"//手续费币种\
}\
]
}
* * *
Back to top
---
# Order - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_1)
Order
=====
[快速入门](https://www.bitunix.com/api-docs/spots/zh_cn/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_1 "Permanent link")
-----------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#restful-api "Permanent link")
-------------------------------------------------------------------------------------------------
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_2 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_3 "Permanent link")
### 订单接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_4 "Permanent link")
### [报税数据接口](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#websocket-api "Permanent link")
-----------------------------------------------------------------------------------------------------
### [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#websocket "Permanent link")
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_6 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_7 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#_8 "Permanent link")
* * *
#### 1\. 下单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#1 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/order/place\_order
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| side | number | Y | 交易方向(1卖出2买入) |
| type | number | Y | 交易类型(1:限价交易 2:市价交易) |
| volume | string | Y | 委托量,限价时,计价币数量。市价时,基础币数量 |
| price | string | Y | 委托价 |
| symbol | string | Y | 币对 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 订单信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单号 |
| side | number | Y | 交易方向(1卖出2买入) |
| type | number | Y | 交易类型(1:限价交易 2:市价交易) |
| volume | string | Y | 委托量,限价时,计价币数量。市价时,基础币数量 |
| price | string | Y | 委托价 |
| symbol | string | Y | 币对 |
| placeStatus | string | Y | 下单是否成功, 1成功 |
* * *
#### 2\. 批量下单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#2 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/order/place\_order/batch
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderList | object\[\] | Y | 下单集合 |
orderList
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| side | number | Y | 交易方向(1卖出2买入) |
| type | number | Y | 交易类型(1:限价交易 2:市价交易) |
| volume | string | Y | 委托量,限价时,基础币数量。市价时,计价币数量 |
| price | string | Y | 委托价 |
| symbol | string | Y | 币对 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object\[\] | N | 下单集合信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单号 |
| side | number | Y | 交易方向(1卖出2买入) |
| type | number | Y | 交易类型(1:限价交易 2:市价交易) |
| volume | string | Y | 委托量 |
| price | string | Y | 委托价 |
| symbol | string | Y | 币对 |
| placeStatus | string | Y | 下单是否成功, 1成功 |
* * *
#### 3\. 撤单/批量撤单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#3 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/order/cancel
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderIdList | object\[\] | Y | 撤单集合 |
orderIdList
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单id |
| symbol | string | Y | 币对 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | |
* * *
#### 4\. 查询撮合订单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#4 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/order/deal/list
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单ID |
| symbol | string | Y | 币对 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 订单信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| volume | string | Y | 成交数量 |
| price | string | Y | 成交价格 |
| fee | string | Y | 手续费 |
| feeCoin | string | Y | 手续费币种 |
| role | string | Y | 角色(1-Maker 2-Taker) |
| ctime | string | Y | 成交时间(ISO8601) |
| id | string | Y | 撮合订单id |
* * *
#### 5\. 查询历史委托订单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#5 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/order/history/page
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| page | number | N | 第几页 |
| pageSize | number | N | 每页条数 |
| startTime | string | N | 订单创建起始时间(ISO8601) |
| endTime | string | N | 订单创建结束时间(ISO8601) |
| status | string | N | 订单状态(1未成交,2已成交,3部分成交,4已撤单,7部分成交/已撤单) |
| side | string | N | 交易方向(1卖出2买入) |
| type | string | N | 订单类型(1限价2市价) |
| symbol | string | Y | 币对 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 订单信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| total | number | Y | 总条数 |
| pageNum | string | Y | 第几页 |
| pageSize | object | N | 每页条数 |
| data | object\[\] | N | 订单信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单ID |
| userId | string | Y | 用户ID |
| orderType | string | Y | 订单类型,1.限价,2.市价 |
| amount | string | Y | 委托总价值 (计价币) |
| dealAmount | string | Y | 成交数量 |
| volume | string | Y | 已成交价值 (计价币) |
| leftAmount | string | Y | 剩余价值 (计价币) |
| volume | string | Y | 委托数量 (基准币) |
| dealVolume | string | Y | 已成交数量 (基准币) |
| leftVolume | string | Y | 剩余数量 (基准币) |
| status | string | Y | 订单状态(1未成交,2已成交,3部分成交,4已撤单,7部分成交/已撤单) |
| type | string | Y | 1.限价,2.市价 |
| side | string | Y | 交易方向(1卖出2买入) |
| price | string | Y | 委托价格 |
| avgPrice | string | Y | 平均成交价格 |
| progress | string | Y | 成交百分比 单位为1% 15.8为15.8% |
| ctime | string | Y | 订单创建时间 |
| utime | string | Y | 订单修改时间 |
| base | string | Y | 基准币 |
| quote | string | Y | 计价币 |
| symbol | string | Y | 币对 |
| fee | string | Y | 手续费 |
| feeCoin | string | Y | 手续费币种 |
* * *
#### 6\. 查询当前委托订单[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#6 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/order/pending/list
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object\[\] | N | 订单信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单ID |
| userId | string | Y | 用户ID |
| orderType | string | Y | 订单类型,1.限价,2.市价 |
| amount | string | Y | 委托总价值 (计价币) |
| dealAmount | string | Y | 成交数量 |
| volume | string | Y | 已成交价值 (计价币) |
| leftAmount | string | Y | 剩余价值 (计价币) |
| volume | string | Y | 委托数量 (基准币) |
| dealVolume | string | Y | 已成交数量 (基准币) |
| leftVolume | string | Y | 剩余数量 (基准币) |
| status | string | Y | 订单状态(1未成交,2已成交,3部分成交,4已撤单,7部分成交/已撤单) |
| type | string | Y | 1.限价,2.市价 |
| side | string | Y | 交易方向(1卖出2买入) |
| price | string | Y | 委托价格 |
| avgPrice | string | Y | 平均成交价格 |
| progress | string | Y | 成交百分比 单位为1% 15.8为15.8% |
| ctime | string | Y | 订单创建时间 |
| utime | string | Y | 订单修改时间 |
| base | string | Y | 基准币 |
| quote | string | Y | 计价币 |
| symbol | string | Y | 币对 |
| fee | string | Y | 手续费 |
| feeCoin | string | Y | 手续费币种 |
* * *
#### 7\. 查询订单详情[¶](https://www.bitunix.com/api-docs/spots/zh_cn/order/#7 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> GET: /api/spot/v1/order/detail
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单ID |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object\[\] | N | 订单信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| orderId | string | Y | 订单ID |
| userId | string | Y | 用户ID |
| orderType | string | Y | 订单类型,1.限价,2.市价 |
| amount | string | Y | 委托总价值 (计价币) |
| dealAmount | string | Y | 成交数量 |
| volume | string | Y | 已成交价值 (计价币) |
| leftAmount | string | Y | 剩余价值 (计价币) |
| volume | string | Y | 委托数量 (基准币) |
| dealVolume | string | Y | 已成交数量 (基准币) |
| leftVolume | string | Y | 剩余数量 (基准币) |
| status | string | Y | 订单状态(1未成交,2已成交,3部分成交,4已撤单,7部分成交/已撤单) |
| type | string | Y | 1.限价,2.市价 |
| side | string | Y | 交易方向(1卖出2买入) |
| price | string | Y | 委托价格 |
| avgPrice | string | Y | 平均成交价格 |
| progress | string | Y | 成交百分比 单位为1% 15.8为15.8% |
| ctime | string | Y | 订单创建时间 |
| utime | string | Y | 订单修改时间 |
| base | string | Y | 基准币 |
| quote | string | Y | 计价币 |
| symbol | string | Y | 币对 |
| fee | string | Y | 手续费 |
| feeCoin | string | Y | 手续费币种 |
* * *
Back to top
---
# Public ws - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_1)
Public ws
=========
[快速入门](https://www.bitunix.com/api-docs/spots/zh_cn/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_1 "Permanent link")
---------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#restful-api "Permanent link")
-----------------------------------------------------------------------------------------------------
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_2 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_3 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_4 "Permanent link")
### [报税数据接口](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#websocket-api "Permanent link")
---------------------------------------------------------------------------------------------------------
### [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#websocket "Permanent link")
### 公共接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_6 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_7 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#_8 "Permanent link")
* * *
#### 1\. 查询最新成交价[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#1 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "market.last_price",
"params": {
"symbol": "BTC",
"nonce": "17832",
"timestamp": 1724285700000,
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对 |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": "10000.00" //最新成交价
}
* * *
#### 2\. 查询深度数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#2 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "market.depth",
"params": {
"symbol": "BTC",
"precision": 5,
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对 |
| precision | number | Y | 精度 |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"asks": [//卖盘\
{\
"price": "10000.00",//委托价\
"volume": "10.00"//委托量\
}\
],
"bids": [//买盘\
{\
"price": "9990.00",//委托价\
"volume": "10.00"//委托量\
}\
],
"ts": "1724285700000"//时间戳
}
}
* * *
#### 3\. 查询K线数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#3-k "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "market.kline",
"params": {
"symbol": "BTC",
"interval": "1",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对 |
| interval | string | Y | kline粒度,默认1min(1,3,5,15,30,60,120,240,360,720,D,M,W) |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"symbol": "BTC",//币对
"open": "10000.00",//开盘价
"high": "10010.00",//最高价
"low": "9990.00",//最低价
"close": "10000.00",//最新价
"ts": "1724285700000"//kline开始时间ISO8601
}
}
* * *
#### 4\. 查询币对数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#4 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "common.coin_pair.list",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [\
{\
"id": "1",//id\
"base": "BTC",//基准币\
"quote": "USDT",//计价币\
"basePrecision": "8",//基准币精度\
"quotePrecision": "2",//计价币精度\
"minPrice": "0.01",//最小交易额\
"minVolume": "0.001",//最小交易量\
"isOpen": "1",//是否开放\
"isHot": "1",//是否热门\
"isRecommend": "1",//是否推荐\
"isShow": "1",//是否显示\
"tradeArea": "USDT",//交易区\
"sort": "1",//排序\
"openTime": "2020-01-01 00:00:00",//开放时间\
"precisions": [//交易精度\
"0.01",\
"0.001"\
]\
}\
]
}
* * *
#### 5\. 查询汇率数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#5 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "common.rate.list",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [//汇率数据\
{\
"baseSymbol": "USD",//基准币\
"quoteSymbol": "CNY",//计价币\
"rate": "6.5"//汇率\
}\
]
}
* * *
#### 6\. 查询币种数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/#6 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "common.coin.coin_network.list",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [//币种数据\
{\
"name": "BTC",//币种\
"fullName": "Bitcoin",//币种全称\
"logo": "https://www.bitunix.com/logo.png",//币种图标\
"track": "BTC",//赛道\
"quotePrecision": "8",//计价币精度\
"minPrice": "0.01",//最小交易额\
"isOpen": "1",//是否开放\
"isHot": "1",//是否热门\
"depositOpen": "1",//是否开放充值,0关闭充值,1开放充值;\
"isShow": "1",//是否可见\
"withdrawOpen": "1",//是否开启提现,0关闭提现,1开启提现;\
"withdrawMin": "0.001",//最小提币数量\
"withdrawMax": "1000.00",//最大提币数量\
"networks": [//币种的网络相关数据\
{\
"contractPrecision": "8",//合约精度\
"contractAddress": "0x1234567890",//币种合约地址\
"requireMemo": "0",//是否需要memo.0:不必填,1:选填,2:必填\
"chain": "ETH",//币种所在链\
"depositConfirm": "3",//充币确认数\
"addressRegular": "0x[0-9a-fA-F]{40}",//地址正则\
"network": "ETH",//网络名称\
"isOpen": "1",//是否开启;0关闭,1开启\
"depositOpen": "1",//是否开放充值,0关闭充值,1开放充值;\
"isShow": "1",//是否可见\
"withdrawOpen": "1",//是否开启提现,\
"withdrawMin": "0.001",//最小提币数量\
"withdrawMax": "1000.00",//最大提币数量\
"depositMin": "0.001"//单笔充币最小值\
}\
]\
}\
]
}
* * *
Back to top
---
# Tax data type codes - Open Platform
Tax data type codes
===================
| Code | Description |
| --- | --- |
| BUY\_ORDER | Buy Order |
| SELL\_ORDER | Sell Order |
| CONVERT | Convert |
| CONVERT\_SMALL\_BALANCE | Convert Small Balance |
| FIAT\_EXCHANGE | Fiat Exchange |
| FIAT\_DEPOSIT | Fiat Deposit |
| FIAT\_WITHDRAWAL | Fiat Withdrawal |
| BANK\_TRANSFER\_BUY | Bank Transfer Buy |
| P2P\_BUY | P2P Buy |
| P2P\_SELL | P2P Sell |
| CARD\_DEPOSIT | Card Deposit |
| THIRD\_PARTY | Third-Party |
| DEPOSIT | Deposit |
| WITHDRAWAL | Withdrawal |
| INTERNAL\_TRANSFER | Internal Transfer |
| TRANSFER | Transfer |
| MAIN\_SUB\_ACCOUNT\_TRANSFER | Main / Sub Account Transfer |
| TRANSFER\_COPY\_TRADING | Transfer (Copy Trading) |
| TRANSFER\_BOT | Transfer (Bot) |
| EVENT\_CONTRACT\_ORDER | Event Contract Order |
| EVENT\_CONTRACT\_PAYMENT | Event Contract Payment |
| EVENT\_CONTRACT\_CANCELLATION | Event Contract Cancellation |
| REFERRAL\_COMMISSION | Referral Commission |
| REFERRAL\_CASHBACK | Referral Cashback |
| GIFTS\_REWARDS | Gifts & Rewards |
| OTHER\_REWARDS | Other Rewards |
| TRADING\_BONUS | Trading Bonus |
| REWARD\_TOKENS | Reward Tokens |
| FORTUNE\_BONUS\_WITHDRAWAL | Fortune Bonus Withdrawal |
| EVENT\_REGISTRATION\_FEE | Event Registration Fee |
| EVENT\_REGISTRATION\_FEE\_REFUND | Event Registration Fee Refund |
| PROFIT\_SHARED | Profit Shared |
| LEAD\_TRADER\_INCOME | Lead Trader Income |
| PNL | PnL |
| LIQUIDATION\_SETTLEMENT | Liquidation Settlement |
| NEGATIVE\_BALANCE\_COMPENSATION | Negative Balance Compensation |
| FUNDING\_COST | Funding Cost |
| GURANTEED\_SL\_FEE | Guranteed SL Fee |
| REPAY | Repay |
| CONVERT\_EXCHANGE | Futures Convert |
| TRIAL\_FUND | Trial Fund |
| BONUS\_REDEMPTION | Bonus Redemption |
| FORTUNE\_FUND | Fortune Fund |
| FORTUNE\_FUND\_RECALLED | Fortune Fund Recalled |
| FORTUNE\_FUND\_PROFIT\_SHARE | Fortune Fund Profit Share |
| FORTUNE\_FUND\_WITHDRAWAL | Fortune Fund Withdrawal |
| GIFT\_FUND\_WITHDRAWAL | Gift Fund Withdrawal |
| COUPON\_MARGIN\_TRANSFER | Coupon Margin Transfer |
| COUPON\_MARGIN\_RECALL | Coupon Margin Recall |
| COUPON\_POSITION\_PNL | Coupon Position PnL |
| COUPON\_POSITION\_LIQUIDATION | Coupon Position Liquidation |
| FUTURES\_EVENT\_CONTRACT\_ORDER | Futures Event Contract Order |
| FUTURES\_EVENT\_CONTRACT\_PAYMENT | Futures Event Contract Payment |
| FUTURES\_EVENT\_CONTRACT\_CANCEL | Futures Event Contract Cancel |
| LIQUIDATION\_SETTLEMENT\_SUB\_ACCOUNT | Liquidation Settlement(Sub Account) |
| FLEXIBLE\_SUBSCRIPTION | Flexible Subscription |
| FLEXIBLE\_REDEMPTION | Flexible Redemption |
| FIXED\_TERM\_SUBSCRIPTION | Fixed-term Subscription |
| FIXED\_TERM\_REDEMPTION | Fixed Term Redemption |
| EARNINGS | Earnings |
| DUAL\_PRODUCT\_SUBSCRIPTION | Dual Product Subscription |
| DUAL\_PRODUCT\_SETTLEMENT | Dual Product Settlement |
| CARD\_TRANSFER\_IN | Card Transfer In |
| CARD\_TRANSFER\_OUT | Card Transfer Out |
| CARD\_PAYMENT | Card Payment |
| CARD\_REFUND | Card Refund |
| CARD\_REVERSAL | Card Reversal |
| CARD\_CASHBACK | Card Cashback |
| CARD\_FX\_FEE | Card FX Fee |
| CARD\_SMALL\_VALUE\_FEE | Card Small-Value Fee |
| CARD\_CREDIT | Card Credit |
| CARD\_SETTLEMENT\_ADVANCE | Card Settlement Advance |
| CARD\_ADVANCE\_REPAYMENT | Card Advance Repayment |
| CARD\_REWARD | Card Reward |
| CARD\_MANUAL\_ADJUSTMENT\_IN | Card Manual Adjustment In |
| CARD\_MANUAL\_ADJUSTMENT\_OUT | Card Manual Adjustment Out |
| CFD\_TRANSFER | CFD Transfer |
| CFD\_SWAP\_FEE | CFD Swap Fee |
| CFD\_REALIZED\_PNL | CFD Realized PnL |
| CFD\_DIVIDEND | CFD Dividend |
| CFD\_LIQUIDATION | CFD Liquidation |
| CFD\_COMPENSATION | CFD Compensation |
Back to top
---
# Interface_Documentation - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/#quick-start)
Interface\_Documentation
========================
Quick Start[¶](https://www.bitunix.com/api-docs/spots/#quick-start "Permanent link")
-------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/#restful-api "Permanent link")
-------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/public/)
[¶](https://www.bitunix.com/api-docs/spots/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/user/)
[¶](https://www.bitunix.com/api-docs/spots/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/order/)
[¶](https://www.bitunix.com/api-docs/spots/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/#websocket-api "Permanent link")
-----------------------------------------------------------------------------------------
### [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/ws/)
[¶](https://www.bitunix.com/api-docs/spots/#websocket-introduction "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/#order-interface_1 "Permanent link")
* * *
#### Preparing for Access[¶](https://www.bitunix.com/api-docs/spots/#preparing-for-access "Permanent link")
If you need to use the API, please [login](https://www.bitunix.com/login)
to complete the application of the API key and the configuration, and then develop and trade according to the details of this document.
You can click [here](https://www.bitunix.com/account/apiManagement)
to create an API key.
Please make sure to remember the following information after you have successfully created the API Key:
* APIKey: Identity for API transactions, generated by random algorithm.
* SecretKey: private key, randomly generated by the system, used for signature generation.
> Risks: These two keys are closely related to the security of your account, please keep in mind that do not disclose them to others at any time. Any leakage of these two keys may cause loss of your assets. If you find any leakage of APIKey, please delete the APIKey as soon as possible.
#### Interface Type[¶](https://www.bitunix.com/api-docs/spots/#interface-type "Permanent link")
* Public
* Private Interface
##### Public Interface[¶](https://www.bitunix.com/api-docs/spots/#public-interface_2 "Permanent link")
> Public interface can be used to obtain configuration information and market data. Public requests can be invoked without authentication.
##### private interface[¶](https://www.bitunix.com/api-docs/spots/#private-interface "Permanent link")
> Private interface can be used for order management and account management. Each private request must be \[signed\] ( sign.md) using a canonical form of authentication. The private interface requires authentication using your APIKey.
#### API domain name[¶](https://www.bitunix.com/api-docs/spots/#api-domain-name "Permanent link")
You can do this yourself using the Rest API access method.
| Domain Name | REST API |
| --- | --- |
| Primary Domain | https://openapi.bitunix.com |
#### API Validation[¶](https://www.bitunix.com/api-docs/spots/#api-validation "Permanent link")
The header of all REST requests must contain the following keys:
* api-key: api-key of the request
* nonce: random string, 32-bit, generated by the caller
* timestamp: current timestamp, milliseconds
* sign: signature string (see [signature](https://www.bitunix.com/api-docs/spots/sign/)
description)
* Content-Type: Uniformly set to application/json.
#### Interaction Request[¶](https://www.bitunix.com/api-docs/spots/#interaction-request "Permanent link")
All requests are based on the Https protocol, the Content-Type in the POST request header should be set to: ' application/json'.
##### Description of Interaction Request[¶](https://www.bitunix.com/api-docs/spots/#description-of-interaction-request "Permanent link")
* Request parameter: encapsulate the parameter according to the request parameter of the interface.
* Submit request parameters: submit the encapsulated request parameters to the server via GET/POST.
* Server Response: The server first performs parameter security verification on the user request data and returns the response data in JSON format to the user according to the business logic after passing the verification.
* Data Processing: Process the response data from the server.
##### Success[¶](https://www.bitunix.com/api-docs/spots/#success "Permanent link")
HTTP status code 200 indicates a successful response and may contain content. If the response contains content, it will be displayed in the corresponding return content.
##### Common Error Codes[¶](https://www.bitunix.com/api-docs/spots/#common-error-codes "Permanent link")
* 400 Bad Request - Invalid request format
* 403 Forbidden - You do not have access to the requested resource.
* 404 Not Found No request found
* 500 Internal Server Error - We had a problem with our server Server internal error; if failed body with error description message
* See [Error Code](https://www.bitunix.com/api-docs/spots/err_code/)
for more details.
#### standardized specification[¶](https://www.bitunix.com/api-docs/spots/#standardized-specification "Permanent link")
##### Timestamp[¶](https://www.bitunix.com/api-docs/spots/#timestamp "Permanent link")
The timestamp in the request signature is in milliseconds and is standardized to UTC time. The timestamp of the request must be within 60 seconds of the API service time, otherwise the request will be considered expired and rejected.
##### Request Formats[¶](https://www.bitunix.com/api-docs/spots/#request-formats "Permanent link")
Currently there are only two request formats: GET and POST.
* GET: Parameters are transferred to the server via queryString in the path.
* POST: Parameters are transferred to the server by sending body in json format.
* * *
Back to top
---
# Order ws - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#quick-start)
Order ws
========
[Quick Start](https://www.bitunix.com/api-docs/spots/en_us/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#quick-start "Permanent link")
------------------------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#restful-api "Permanent link")
----------------------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#websocket-api "Permanent link")
--------------------------------------------------------------------------------------------------------
### [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/en_us/ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#websocket-introduction "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#user-interface_1 "Permanent link")
### Order Interface[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#order-interface_1 "Permanent link")
* * *
#### 1\. Place Order[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#1-place-order "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.place_order",
"params": {
"side": 1,
"type": 1,
"volume": "100",
"price": "10000",
"symbol": "BTCUSDT",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| side | number | Y | Side(1: Sell 2: Buy) |
| type | number | Y | Order type(1:Limit 2:Market) |
| volume | string | Y | when put limit order, **volume** means base coin's quantity,
when put market order, **volume** means quote coin's quantity |
| price | string | Y | Order Price |
| symbol | string | Y | Trading Pair |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"orderId": "123456",//OrderID
"side": 1,//Side(1: Sell 2: Buy)
"type": 1,//Order type(1:Limit 2:Market)
"volume": "100",//Amount
"price": "10000",//Order Price
"symbol": "BTCUSDT",//Trading Pair
"placeStatus": "1"//Whether order is placed successfully, 1: Success
}
}
* * *
#### 2\. Batch Order[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#2-batch-order "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.place_order.batch",
"params": {
"orderList": [\
{\
"side": 1,\
"type": 1,\
"volume": "100",\
"price": "10000",\
"symbol": "BTCUSDT"\
},\
{\
"side": 2,\
"type": 1,\
"volume": "100",\
"price": "10000",\
"symbol": "BTCUSDT"\
}\
],
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| orderList | object\[\] | Y | All orders |
orderList
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| side | number | Y | Side(1: Sell 2: Buy) |
| type | number | Y | Order type(1:Limit 2:Market) |
| volume | string | Y | when put limit order, **volume** means base coin's quantity,
when put market order, **volume** means quote coin's quantity |
| price | string | Y | Order Price |
| symbol | string | Y | Trading Pair |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [\
{\
"orderId": "123456",//OrderID\
"side": 1,//Side(1: Sell 2: Buy)\
"type": 1,//Order type(1:Limit 2:Market)\
"volume": "100",//Amount\
"price": "10000",//Order Price\
"symbol": "BTCUSDT",//Trading Pair\
"placeStatus": "1"//Whether order is placed successfully, 1: Success\
}\
]
}
* * *
#### 3\. Cancel order / Batch cancel[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#3-cancel-order-batch-cancel "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.cancel",
"params": {
"orderIdList": [\
{\
"orderId": "123456",\
"symbol": "BTCUSDT"\
}\
],
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| orderIdList | object\[\] | Y | All canceled orders |
orderIdList
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| symbol | string | Y | Trading Pair |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": null
}
* * *
#### 4\. Query matching order[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#4-query-matching-order "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.deal.list",
"params": {
"orderId": "123456",
"symbol": "BTCUSDT",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| symbol | string | Y | Trading Pair |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"volume": "100",//Filled Amount
"price": "10000",//Filled Price
"fee": "0.1",//Fee
"feeCoin": "BTC",//Fee Token
"role": "1",//Type(1-Maker 2-Taker)
"ctime": "2019-01-01T00:00:00Z",//Filled Time(ISO8601)
"id": "123456"//Matching Order ID
}
}
* * *
#### 5\. Query order history[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#5-query-order-history "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.history.page",
"params": {
"page": 1,
"pageSize": 10,
"startTime": "2019-01-01T00:00:00Z",
"endTime": "2019-01-01T00:00:00Z",
"status": "2",
"side": "1",
"type": "1",
"symbol": "BTCUSDT",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| page | number | N | Page |
| pageSize | number | N | Items per page |
| startTime | string | N | Order creation start time(ISO8601) |
| endTime | string | N | Order creation end time(ISO8601) |
| status | string | N | Status(1: Unfilled, 2: Filled, 3: Partially Filled, 4: Canceled, 7: Partially Filled anc canceled) |
| side | string | N | Side(1: Sell 2: Buy) |
| type | string | N | Order Type(1Limit2Market) |
| symbol | string | Y | Trading Pair |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"total": 100,
"pageNum": 1,
"pageSize": 10,
"data": [\
{\
"orderId": "123456",//Order ID\
"userId": "123456",//User UID\
"orderType": "1",//Order Type,1.Limit,2.Market\
"amount": "100",//Order Value(Base Token)\
"dealAmount": "100",//Filled Amount\
"volume": "100",//Filled Value(Pricing Token)\
"leftAmount": "100",//Remaining Value(Pricing Token)\
"volume": "100",//Order Amount(Base token)\
"dealVolume": "100",//Filled Amount (Base token)\
"leftVolume": "100",//Remaining Amount (Base token)\
"status": "2",//Status(1: Unfilled, 2: Filled, 3: Partially Filled, 4: Canceled, 7: Partially Filled anc canceled)\
"type": "1",//1.Limit,2.Market\
"side": "1",//Side(1: Sell 2: Buy)\
"price": "10000",//Order Price\
"avgPrice": "10000",//Average Filled Price\
"progress": "100",//Filled Percentage Unit: 1%, 15.8 means 15.8%\
"ctime": "2019-01-01T00:00:00Z",//Order Creatio Time\
"utime": "2019-01-01T00:00:00Z",//Order Edit Time\
"base": "BTC",//Base token\
"quote": "USDT",//Pricing Token\
"symbol": "BTCUSDT",//Trading Pair\
"fee": "0.1",//Fee\
"feeCoin": "BTC"//Fee Token\
}\
]
}
}
* * *
#### 6\. Query current orders[¶](https://www.bitunix.com/api-docs/spots/en_us/order-ws/#6-query-current-orders "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "order.pending.list",
"params": {
"symbol": "BTCUSDT",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| symbol | string | Y | Trading Pair |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [\
{\
"orderId": "123456",//Order ID\
"userId": "123456",//UID\
"orderType": "1",//Order Type,1.Limit,2.Market\
"amount": "100",//Order Value(Base Token)\
"dealAmount": "100",//Filled Amount\
"volume": "100",//Filled Value(Pricing Token)\
"leftAmount": "100",//Remaining Value(Pricing Token)\
"volume": "100",//Order Amount(Base token)\
"dealVolume": "100",//Filled Amount (Base token)\
"leftVolume": "100",//Remaining Amount (Base token)\
"status": "2",//Status(1: Unfilled, 2: Filled, 3: Partially Filled, 4: Canceled, 7: Partially Filled anc canceled)\
"type": "1",//1.Limit,2.Market\
"side": "1",//Side(1: Sell 2: Buy)\
"price": "10000",//Order Price\
"avgPrice": "10000",//Average Filled Price\
"progress": "100",//Filled Percentage Unit: 1%, 15.8 means 15.8%\
"ctime": "2019-01-01T00:00:00Z",//Order Creation Time\
"utime": "2019-01-01T00:00:00Z",//Order Edit Time\
"base": "BTC",//Base token\
"quote": "USDT",//Pricing Token\
"symbol": "BTCUSDT",//Trading Pair\
"fee": "0.1",//Fee\
"feeCoin": "BTC"//Fee Token\
}\
]
}
* * *
Back to top
---
# Sign - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/sign/#_1)
Sign
====
### 接口签名说明[¶](https://www.bitunix.com/api-docs/spots/zh_cn/sign/#_1 "Permanent link")
#### Restful API签名公共请求参数[¶](https://www.bitunix.com/api-docs/spots/zh_cn/sign/#restful-api "Permanent link")
**Headers:**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| api-key | string | Y | 申请的api-key |
| nonce | string | Y | 随机字符串,32位 |
| timestamp | string | Y | 当前时间戳,毫秒 |
| sign | string | Y | 签名字符串 |
签名步骤:
> 1. 所有queryParams按照Key的ASCII升序排列,示例: String queryParams = "id=1uid=200"
> 2. body中的参数,压缩成一个字符串,**切记去掉所有空格**,示例:String body = {"uid":"2899","arr":\[{"id":1,"name":"maple"},{"id":2,"name":"lily"}\]}
> 3. 签名,需要加密2次
>
> > * String digest = SHA256(nonce + timestamp + api-key + queryParams + body)
> > * String sign = SHA256(digest + secretKey)
> > * 注意:secretKey是申请api-key的时候,一起的,注意保管,无需传递~~~~
>
#### WebSocket API签名相关参数[¶](https://www.bitunix.com/api-docs/spots/zh_cn/sign/#websocket-api "Permanent link")
WebSocket API请求需要进行身份验证,在所有的请求参数`params`中需要包含以下字段:
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| `apiKey` | string | Y | API Key |
| `timestamp` | string | Y | 时间戳 |
| `nonce` | string | Y | 随机字符串 |
| `sign` | string | Y | 签名字符串 |
签名步骤:
> 1. 将`params`中的除了`sign`, `apiKey`, `timestamp`, `nonce`字段之外的所有字段按照Key的ASCII升序排列,示例: String params = "symbolBTC"
> 2. 签名,需要加密2次
>
> > * String digest = SHA256(nonce + timestamp + api-key + params)
> > * String sign = SHA256(digest + secretKey)
> > * 注意:secretKey是申请api-key的时候,一起的,注意保管
>
Back to top
---
# Public - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_1)
Public
======
[快速入门](https://www.bitunix.com/api-docs/spots/zh_cn/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_1 "Permanent link")
------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#restful-api "Permanent link")
--------------------------------------------------------------------------------------------------
### 公共接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_2 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_3 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_4 "Permanent link")
### [报税数据接口](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#websocket-api "Permanent link")
------------------------------------------------------------------------------------------------------
### [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#websocket "Permanent link")
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_6 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_7 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#_8 "Permanent link")
* * *
#### 1\. 查询最新成交价[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#1 "Permanent link")
> HTTP请求
>
> GET: /api/spot/v1/market/last\_price
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | string | N | 最新成交价 |
* * *
#### 2\. 查询深度数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#2 "Permanent link")
> HTTP请求
>
> GET: /api/spot/v1/market/depth
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对 |
| precision | number | Y | 精度 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 深度数据 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| asks | object\[\] | N | 卖盘 |
| bids | object\[\] | N | 买盘 |
| ts | string | N | 时间戳 |
asks/bids
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| price | string | N | 委托价 |
| volume | string | N | 委托量 |
* * *
#### 3\. 查询K线数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#3-k "Permanent link")
> HTTP请求
>
> GET: /api/spot/v1/market/kline
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对 |
| interval | string | Y | kline粒度,默认1min(1,3,5,15,30,60,120,240,360,720,D,M,W) |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | K线数据 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | N | 币对 |
| open | string | N | 开盘价 |
| high | string | N | 最高价 |
| low | string | N | 最低价 |
| close | string | N | 最新价 |
| ts | string | N | kline开始时间ISO8601 |
* * *
#### 4\. 查询K线历史数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#4-k "Permanent link")
> HTTP请求
>
> GET: /api/spot/v1/market/kline/history
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | Y | 币对,如:BTCUSDT |
| interval | string | N | kline粒度,默认1min(1,3,5,15,30,60,120,240,360,720,D,M,W) |
| endTime | string | N | 结束时间戳(秒),开区间,如1696507201,不传则默认为当前时间,不包含最新一条数据 |
| limit | string | N | 条数, 1-500,默认200 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | K线数据 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| symbol | string | N | 币对 |
| open | string | N | 开盘价 |
| high | string | N | 最高价 |
| low | string | N | 最低价 |
| close | string | N | 最新价 |
| ts | string | N | kline开始时间ISO8601 |
* * *
#### 5\. 查询币对数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#5 "Permanent link")
> HTTP请求
>
> GET: /api/spot/v1/common/coin\_pair/list
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object\[\] | N | 币对数据 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| id | string | N | id |
| base | string | N | 基准币 |
| quote | string | N | 计价币 |
| basePrecision | string | N | 基准币精度 |
| quotePrecision | string | N | 计价币精度 |
| minPrice | string | N | 最小交易额 |
| minVolume | string | N | 最小交易量 |
| isOpen | string | N | 是否开放 |
| isHot | string | N | 是否热门 |
| isRecommend | string | N | 是否推荐 |
| isShow | string | N | 是否显示 |
| tradeArea | string | N | 交易区 |
| sort | string | N | 排序 |
| openTime | string | N | 开放时间 |
| precisions | string\[\] | N | 交易精度 |
* * *
#### 6\. 查询汇率数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#6 "Permanent link")
> HTTP请求
>
> GET: /api/spot/v1/common/rate/list
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object\[\] | N | 汇率数据 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| baseSymbol | string | N | 基准币 |
| quoteSymbol | string | N | 计价币 |
| rate | string | N | 汇率 |
* * *
#### 7\. 查询币种数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/public/#7 "Permanent link")
> HTTP请求
>
> GET: /api/spot/v1/common/coin/coin\_network/list
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object\[\] | N | 币种数据 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| name | string | N | 币种 |
| fullName | string | N | 币种全称 |
| logo | string | N | 币种图标 |
| track | string | N | 赛道 |
| quotePrecision | string | N | 计价币精度 |
| minPrice | string | N | 最小交易额 |
| isOpen | string | N | 是否开放 |
| isHot | string | N | 是否热门 |
| depositOpen | string | N | 是否开放充值,0关闭充值,1开放充值; |
| isShow | string | N | 是否可见 |
| withdrawOpen | string | N | 是否开启提现,0关闭提现,1开启提现; |
| withdrawMin | string | N | 最小提币数量 |
| withdrawMax | string | N | 最大提币数量 |
| networks | object\[\] | N | 币种的网络相关数据 |
networks
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| contractPrecision | string | N | 合约精度 |
| contractAddress | string | N | 币种合约地址 |
| requireMemo | string | N | 是否需要memo.0:不必填,1:选填,2:必填 |
| chain | string | N | 币种所在链 |
| depositConfirm | string | N | 充币确认数 |
| addressRegular | string | N | 地址正则 |
| network | string | N | 网络名称 |
| isOpen | string | N | 是否开启;0关闭,1开启 |
| depositOpen | string | N | 是否开放充值,0关闭充值,1开放充值; |
| isShow | string | N | 是否可见 |
| withdrawOpen | string | N | 是否开启提现,0关闭提现,1开启提现; |
| withdrawMin | string | N | 最小提币数量 |
| withdrawMax | string | N | 最大提币数量 |
| depositMin | string | N | 单笔充币最小值 |
{
"code": "0",
"msg": "Success",
"data": [\
{\
"name": "USDT",\
"fullName": "Tether",\
"logo": "https://image.xushidaifa.com/config/kv/358844.png",\
"track": "Metaverse",\
"isHot": 1,\
"isOpen": 1,\
"isShow": 1,\
"depositOpen": 1,\
"withdrawOpen": 1,\
"withdrawMin": "0",\
"withdrawMax": null,\
"networks": [\
{\
"contractPrecision": 6,\
"contractAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",\
"requireMemo": 0,\
"chain": "TRON",\
"depositConfirm": 20,\
"addressRegular": ".+",\
"network": "Tron (TRC-20)",\
"isOpen": 1,\
"isShow": 1,\
"depositOpen": 1,\
"withdrawOpen": 1,\
"withdrawMax": "3000000",\
"withdrawMin": "0.000001",\
"depositMin": "0.000001"\
}\
]\
}\
],
"success": true
}
* * *
Back to top
---
# Public ws - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#quick-start)
Public ws
=========
[Quick Start](https://www.bitunix.com/api-docs/spots/en_us/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#quick-start "Permanent link")
-------------------------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#restful-api "Permanent link")
-----------------------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#websocket-api "Permanent link")
---------------------------------------------------------------------------------------------------------
### [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/en_us/ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#websocket-introduction "Permanent link")
### Public Interface[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#order-interface_1 "Permanent link")
* * *
#### 1\. Get latest price[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#1-get-latest-price "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "market.last_price",
"params": {
"symbol": "BTC",
"nonce": "17832",
"timestamp": 1724285700000,
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Type | Mandatory | Description |
| --- | --- | --- | --- |
| symbol | string | Y | Pair |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": "10000.00" //Latest Price
}
* * *
#### 2\. Get depth data[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#2-get-depth-data "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "market.depth",
"params": {
"symbol": "BTC",
"precision": 5,
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Paremeter**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| symbol | string | Y | Trading pair |
| precision | number | Y | token precision |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"asks": [//Sell\
{\
"price": "10000.00",//Order Price\
"volume": "10.00"//Order Quantity\
}\
],
"bids": [//Buy\
{\
"price": "9990.00",//Order Price\
"volume": "10.00"//Order Quantity\
}\
],
"ts": "1724285700000"//Timestamp
}
}
* * *
#### 3\. Get K-Line Data[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#3-get-k-line-data "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "market.kline",
"params": {
"symbol": "BTC",
"interval": "1min",
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Paremeter**
| Name | Types | Mandatory | Descrtiption |
| --- | --- | --- | --- |
| symbol | string | Y | Trading Pairs |
| interval | string | Y | kline interval,default: 1min(1,3,5,15,30,60,120,240,360,720,D,M,W) |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"symbol": "BTC",//Trading Pair
"open": "10000.00",//Open Price
"high": "10010.00",//Highest PRice
"low": "9990.00",//Lowest Price
"close": "10000.00",//Close Price
"ts": "1724285700000"//kline Starting Time ISO8601
}
}
* * *
#### 4\. Query trading pair data[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#4-query-trading-pair-data "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "common.coin_pair.list",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameters**
| Name | Types | Mandatory | Descriptio |
| --- | --- | --- | --- |
| None | | | |
**Return**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [\
{\
"id": "1",//id\
"base": "BTC",//Base Token\
"quote": "USDT",//Pricing Token\
"basePrecision": "8",//Base Token Precision\
"quotePrecision": "2",//Pricing Token Precision\
"minPrice": "0.01",//Minimum trading value\
"minVolume": "0.001",//Minimum trading quantity\
"isOpen": "1",//Open or closed for trading\
"isHot": "1",//Trending or not\
"isRecommend": "1",//Recommended or not\
"isShow": "1",//Display or hidden\
"tradeArea": "USDT",//Trading Zone\
"sort": "1",//Order\
"openTime": "2020-01-01 00:00:00",//Open Time\
"precisions": [//Trading Precision\
"0.01",\
"0.001"\
]\
}\
]
}
* * *
#### 5\. Query rate data[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#5-query-rate-data "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "common.rate.list",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameter**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| None | | | |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [//Exchange rate\
{\
"baseSymbol": "USD",//Base currency\
"quoteSymbol": "CNY",//Pricing currency\
"rate": "6.5"//Rate\
}\
]
}
* * *
#### 6\. Query Token Data[¶](https://www.bitunix.com/api-docs/spots/en_us/public-ws/#6-query-token-data "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "common.coin.coin_network.list",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**Parameter**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| None | | | |
**Response**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [//Token Data\
{\
"name": "BTC",//Token\
"fullName": "Bitcoin",//Token name\
"logo": "https://www.bitunix.com/logo.png",//Logo\
"track": "BTC",//Tracks\
"quotePrecision": "8",//Base token\
"minPrice": "0.01",//Minimum amount\
"isOpen": "1",//Open or closed for trading\
"isHot": "1",//Trending or not\
"depositOpen": "1",//Deposit is open or not,0: deposit closed,1: deposit open;\
"isShow": "1",//Display or hidden\
"withdrawOpen": "1",//Withdrawal is open or not,0: closed,1: open;\
"withdrawMin": "0.001",//Minimum Withdrawal Quantity\
"withdrawMax": "1000.00",//Maximum Withdrawal Quantity\
"networks": [//Network Information\
{\
"contractPrecision": "8",//Contract Precision\
"contractAddress": "0x1234567890",//Contract Address\
"requireMemo": "0",//Memo required.0:not required,1:optional,2:required\
"chain": "ETH",//Blockchain\
"depositConfirm": "3",//Deposit Confirmations\
"addressRegular": "0x[0-9a-fA-F]{40}",//Address Format Requirement\
"network": "ETH",//Network Name\
"isOpen": "1",//Open or closed;0:closed,1:open\
"depositOpen": "1",//eposit is open or not,0: deposit closed,1: deposit open;\
"isShow": "1",//Display or hidden\
"withdrawOpen": "1",//Withdrawal is open or not\
"withdrawMin": "0.001",//Minimum Withdrawal Quantity\
"withdrawMax": "1000.00",//Maximum Withdrawal Quantity\
"depositMin": "0.001"//Minimum Deposit Quantity\
}\
]\
}\
]
}
* * *
Back to top
---
# Order - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/order/#quick-start)
Order
=====
[Quick Start](https://www.bitunix.com/api-docs/spots/en_us/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#quick-start "Permanent link")
---------------------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#restful-api "Permanent link")
-------------------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#user-interface "Permanent link")
### Order Interface[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#websocket-api "Permanent link")
-----------------------------------------------------------------------------------------------------
### [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/en_us/ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#websocket-introduction "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#order-interface_1 "Permanent link")
* * *
#### 1\. Place order[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#1-place-order "Permanent link")
> [Sign](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/order/place\_order
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| side | number | Y | Side (1 Sell 2 Buy) |
| type | number | Y | Order Type(1:Limit 2:Market) |
| volume | string | Y | when put limit order, **volume** means quote coin's quantity,
when put market order, **volume** means base coin's quantity |
| price | string | Y | Price |
| symbol | string | Y | Trading pair |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Order details |
Data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| side | number | Y | Side (1 Sell 2 Buy) |
| type | number | Y | Order Type(1:Limit 2:Market) |
| volume | string | Y | when put limit order, **volume** means quote coin's quantity,
when put market order, **volume** means base coin's quantity |
| price | string | Y | Price |
| symbol | string | Y | Trading pair |
| placeStatus | string | Y | Whether the order was successful or not, 1 Success |
* * *
#### 2\. Batch Order[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#2-batch-order "Permanent link")
> [Sign](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/order/place\_order/batch
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderList | object\[\] | Y | Batch Order |
orderList
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| side | number | Y | Side (1 Sell 2 Buy) |
| type | number | Y | Order Type(1:Limit 2:Market) |
| volume | string | Y | when put limit order, **volume** means base coin's quantity,
when put market order, **volume** means quote coin's quantity |
| price | string | Y | Price |
| symbol | string | Y | Trading pair |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object\[\] | N | Batch order details |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| side | number | Y | Side (1 Sell 2 Buy) |
| type | number | Y | Order Type(1:Limit 2:Market) |
| volume | string | Y | Amount |
| price | string | Y | Price |
| symbol | string | Y | Trading pair |
| placeStatus | string | Y | Whether the order was successful or not, 1 Success |
* * *
#### 3\. Cancel order / Batch cancel[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#3-cancel-order-batch-cancel "Permanent link")
> [Sign](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/order/cancel
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderIdList | object\[\] | Y | Orders cancelled |
orderIdList
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| symbol | string | Y | Pairs |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | |
* * *
#### 4\. Query matching orders[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#4-query-matching-orders "Permanent link")
> [Sign](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/order/deal/list
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| symbol | string | Y | Trading Pair |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Order details |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| volume | string | Y | Amount |
| price | string | Y | Price |
| fee | string | Y | Fee |
| feeCoin | string | Y | Token of fees |
| role | string | Y | Role(1-Maker 2-Taker) |
| ctime | string | Y | Filled time(ISO8601) |
| id | string | Y | Matching Order id |
* * *
#### 5\. Query order history[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#5-query-order-history "Permanent link")
> [Sign](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/order/history/page
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| page | number | N | Page number |
| pageSize | number | N | Display amount |
| startTime | string | N | Order creation starting time(ISO8601) |
| endTime | string | N | Order cereation ending time (ISO8601) |
| status | string | N | Order status(1 Unfilled,2 Filled,3 Partially filled,4 Cancelled,7 Partially filled/Canceled) |
| side | string | N | Side (1Sell2Buy) |
| type | string | N | Order type(1 Limit, 2 Market) |
| symbol | string | Y | Trading pair |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Order details |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| total | number | Y | Total number |
| pageNum | string | Y | Page number |
| pageSize | object | N | Items displayed |
| data | object\[\] | N | Order details |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| userId | string | Y | UID |
| orderType | string | Y | Order type,1.Limit,2.Market |
| amount | string | Y | Total value (Quote token) |
| dealAmount | string | Y | Filled quantity |
| volume | string | Y | Filled value (Quote token) |
| leftAmount | string | Y | Remaining value (Quote token) |
| volume | string | Y | Order qty (Base token) |
| dealVolume | string | Y | Filled qty (Base token) |
| leftVolume | string | Y | Remaining qty (Base token) |
| status | string | Y | Order status(1 Unfilled,2 Filled,3 Partially filled,4 Cancelled,7 Partially filled/Canceled) |
| type | string | Y | 1.Limit,2.Market |
| side | string | Y | Side (1 Sell 2 Buy) |
| price | string | Y | Order price |
| avgPrice | string | Y | Avg price |
| progress | string | Y | Filled percentage Unit:1% 15.8 means 15.8% |
| ctime | string | Y | Order creation time |
| utime | string | Y | Order edit time |
| base | string | Y | Base token |
| quote | string | Y | Quote token |
| symbol | string | Y | Trading pair |
| fee | string | Y | Fee |
| feeCoin | string | Y | Token of fee |
* * *
#### 6\. Query current orders[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#6-query-current-orders "Permanent link")
> [Sign](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> POST: /api/spot/v1/order/pending/list
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| symbol | string | Y | Trading pair |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Order details |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| userId | string | Y | UID |
| orderType | string | Y | Order type,1.Limte,2.Market |
| amount | string | Y | Total value (Quote token) |
| dealAmount | string | Y | Filled qty |
| volume | string | Y | Filled value (Quote token) |
| leftAmount | string | Y | Remaining value (Quote token) |
| volume | string | Y | Order qty (Base token) |
| dealVolume | string | Y | Filled qty (Base token) |
| leftVolume | string | Y | Remaining qty (Base token) |
| status | string | Y | Order status(1 Unfilled,2 Filled,3 Partially filled,4 Cancelled,7 Partially filled/Canceled) |
| type | string | Y | 1.Limite,2.Market |
| side | string | Y | Side (1 Sell 2 Buy) |
| price | string | Y | Price |
| avgPrice | string | Y | Average price |
| progress | string | Y | Filled percentage Unit:1% 15.8 means 15.8% |
| ctime | string | Y | Order creation time |
| utime | string | Y | Order edit time |
| base | string | Y | Base token |
| quote | string | Y | Quote token |
| symbol | string | Y | Trading Pair |
| fee | string | Y | Fee |
| feeCoin | string | Y | Token of fee |
* * *
#### 7\. Query order detail[¶](https://www.bitunix.com/api-docs/spots/en_us/order/#7-query-order-detail "Permanent link")
> [Sign](https://www.bitunix.com/api-docs/spots/en_us/sign/)
>
> HTTP Request
>
> GET: /api/spot/v1/order/detail
**Parameters**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderId | string | Y | order ID |
**Returned Data**
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| code | number | Y | [Error code](https://www.bitunix.com/api-docs/spots/en_us/err_code/) |
| msg | string | Y | Description |
| data | object | N | Order details |
data
| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| orderId | string | Y | Order ID |
| userId | string | Y | UID |
| orderType | string | Y | Order type,1.Limte,2.Market |
| amount | string | Y | Total value (Quote token) |
| dealAmount | string | Y | Filled qty |
| volume | string | Y | Filled value (Quote token) |
| leftAmount | string | Y | Remaining value (Quote token) |
| volume | string | Y | Order qty (Base token) |
| dealVolume | string | Y | Filled qty (Base token) |
| leftVolume | string | Y | Remaining qty (Base token) |
| status | string | Y | Order status(1 Unfilled,2 Filled,3 Partially filled,4 Cancelled,7 Partially filled/Canceled) |
| type | string | Y | 1.Limite,2.Market |
| side | string | Y | Side (1 Sell 2 Buy) |
| price | string | Y | Price |
| avgPrice | string | Y | Average price |
| progress | string | Y | Filled percentage Unit:1% 15.8 means 15.8% |
| ctime | string | Y | Order creation time |
| utime | string | Y | Order edit time |
| base | string | Y | Base token |
| quote | string | Y | Quote token |
| symbol | string | Y | Trading Pair |
| fee | string | Y | Fee |
| feeCoin | string | Y | Token of fee |
* * *
Back to top
---
# Tax data type codes - Open Platform
Tax data type codes
===================
| 代码 | 说明 |
| --- | --- |
| BUY\_ORDER | 交易买单 |
| SELL\_ORDER | 交易卖单 |
| CONVERT | 闪兑 |
| CONVERT\_SMALL\_BALANCE | 小额资产兑换 |
| FIAT\_EXCHANGE | 法币兑换 |
| FIAT\_DEPOSIT | 法币充值 |
| FIAT\_WITHDRAWAL | 法币提现 |
| BANK\_TRANSFER\_BUY | 银行转账买币 |
| P2P\_BUY | P2P买入 |
| P2P\_SELL | P2P卖出 |
| CARD\_DEPOSIT | 银行卡充值 |
| THIRD\_PARTY | 三方买币 |
| DEPOSIT | 充币 |
| WITHDRAWAL | 提币 |
| INTERNAL\_TRANSFER | 站内转账 |
| TRANSFER | 划转 |
| MAIN\_SUB\_ACCOUNT\_TRANSFER | 主子账号划转 |
| TRANSFER\_COPY\_TRADING | 划转(跟单) |
| TRANSFER\_BOT | 划转(机器人) |
| EVENT\_CONTRACT\_ORDER | 事件合约订单 |
| EVENT\_CONTRACT\_PAYMENT | 事件合约支付 |
| EVENT\_CONTRACT\_CANCELLATION | 事件合约取消 |
| REFERRAL\_COMMISSION | 邀请返佣 |
| REFERRAL\_CASHBACK | 邀请返现 |
| GIFTS\_REWARDS | 系统赠币 |
| OTHER\_REWARDS | 其他奖励 |
| TRADING\_BONUS | 交易额赠金 |
| REWARD\_TOKENS | 奖励赠币 |
| FORTUNE\_BONUS\_WITHDRAWAL | 发财金提取 |
| EVENT\_REGISTRATION\_FEE | 活动报名费 |
| EVENT\_REGISTRATION\_FEE\_REFUND | 活动报名费返回 |
| PROFIT\_SHARED | 分润 |
| LEAD\_TRADER\_INCOME | 带单收入 |
| PNL | 平仓盈亏 |
| LIQUIDATION\_SETTLEMENT | 强平清算 |
| NEGATIVE\_BALANCE\_COMPENSATION | 穿仓补偿 |
| FUNDING\_COST | 资金费用 |
| GURANTEED\_SL\_FEE | 保证止损费用 |
| REPAY | 付息 |
| CONVERT\_EXCHANGE | 兑换 |
| TRIAL\_FUND | 体验金 |
| BONUS\_REDEMPTION | 体验金兑换 |
| FORTUNE\_FUND | 发财金 |
| FORTUNE\_FUND\_RECALLED | 发财金回收 |
| FORTUNE\_FUND\_PROFIT\_SHARE | 发财金分润 |
| FORTUNE\_FUND\_WITHDRAWAL | 发财金提现 |
| GIFT\_FUND\_WITHDRAWAL | 赠金提现 |
| COUPON\_MARGIN\_TRANSFER | 卡券保证金转入 |
| COUPON\_MARGIN\_RECALL | 卡券保证金回收 |
| COUPON\_POSITION\_PNL | 卡券仓位盈亏(盈利) |
| COUPON\_POSITION\_LIQUIDATION | 券仓位强平 |
| FUTURES\_EVENT\_CONTRACT\_ORDER | 事件合约下单-合约流水 |
| FUTURES\_EVENT\_CONTRACT\_PAYMENT | 事件合约支付-合约流水 |
| FUTURES\_EVENT\_CONTRACT\_CANCEL | 事件合约取消订单-合约流水 |
| LIQUIDATION\_SETTLEMENT\_SUB\_ACCOUNT | 强平清算(子账号) |
| FLEXIBLE\_SUBSCRIPTION | 活期申购 |
| FLEXIBLE\_REDEMPTION | 活期赎回 |
| FIXED\_TERM\_SUBSCRIPTION | 定期申购 |
| FIXED\_TERM\_REDEMPTION | 定期赎回 |
| EARNINGS | 定期收益 |
| DUAL\_PRODUCT\_SUBSCRIPTION | 双币申购 |
| DUAL\_PRODUCT\_SETTLEMENT | 双币结算 |
| CARD\_TRANSFER\_IN | U卡划转转入 |
| CARD\_TRANSFER\_OUT | U卡划转转出 |
| CARD\_PAYMENT | 消费支付 |
| CARD\_REFUND | 消费退款 |
| CARD\_REVERSAL | 冲正回退 |
| CARD\_CASHBACK | 返现 |
| CARD\_FX\_FEE | 外汇手續费 |
| CARD\_SMALL\_VALUE\_FEE | 小额手續费 |
| CARD\_CREDIT | 入账 |
| CARD\_SETTLEMENT\_ADVANCE | 清算垫付 |
| CARD\_ADVANCE\_REPAYMENT | 归还垫付款 |
| CARD\_REWARD | 奖励 |
| CARD\_MANUAL\_ADJUSTMENT\_IN | 人工调增 |
| CARD\_MANUAL\_ADJUSTMENT\_OUT | 人工调减 |
| CFD\_TRANSFER | CFD划转 |
| CFD\_SWAP\_FEE | 掉期费 |
| CFD\_REALIZED\_PNL | 已实现盈亏 |
| CFD\_DIVIDEND | 股息收入 |
| CFD\_LIQUIDATION | 强平损失 |
| CFD\_COMPENSATION | 穿仓补偿 |
Back to top
---
# Tax filing - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_1)
Tax filing
==========
[快速入门](https://www.bitunix.com/api-docs/spots/zh_cn/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_1 "Permanent link")
----------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#restful-api "Permanent link")
------------------------------------------------------------------------------------------------------
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_2 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_3 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_4 "Permanent link")
### 报税数据接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#websocket-api "Permanent link")
----------------------------------------------------------------------------------------------------------
### [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#websocket "Permanent link")
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_6 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_7 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#_8 "Permanent link")
* * *
#### 1\. 分页查询报税数据[¶](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/#1 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/tax/filing/page
**API说明**
* 需完成 [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
鉴权,查询当前 API Key 对应主账号及其子账号的报税数据。
* 返回数据格式与平台报税导出一致,适用于第三方报税工具对接。
* 时间范围 `[startTime, endTime]` 均为 UTC 时间,格式为 ISO8601(如 `2024-01-01T00:00:00Z`)。
* `dataTypeCodes` 为报税数据类型代码,至少传入一项;仅支持系统中已启用的类型代码,详见 [dataTypeCodes](https://www.bitunix.com/api-docs/spots/zh_cn/tax_data_type_codes/)
。
* 分页从第 1 页开始,默认每页 1000 条,最大 1000 条。
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| startTime | string | Y | 查询起始时间(UTC, ISO8601),如 2024-01-01T00:00:00Z |
| endTime | string | Y | 查询结束时间(UTC, ISO8601),如 2024-12-31T23:59:59Z |
| dataTypeCodes | string\[\] | Y | [dataTypeCodes](https://www.bitunix.com/api-docs/spots/zh_cn/tax_data_type_codes/)
列表,至少一项 |
| page | number | N | 页码,从 1 开始,默认 1 |
| pageSize | number | N | 每页条数,默认 1000,最大 1000 |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 分页查询结果 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| records | object\[\] | Y | 报税数据列表 |
| total | number | Y | 总条数 |
| current | number | Y | 当前页码 |
| size | number | Y | 每页条数 |
| pages | number | Y | 总页数 |
records
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| date | string | Y | 交易时间(UTC) |
| labelEn | string | Y | 交易类型标签 |
| account | string | Y | 账户 |
| outgoingAsset | string | Y | 转出资产 |
| outgoingAmount | string | Y | 转出数量 |
| incomingAsset | string | Y | 转入资产 |
| incomingAmount | string | Y | 转入数量 |
| feeAsset | string | Y | 手续费币种 |
| feeAmount | string | Y | 手续费数量 |
| typeId | string | Y | 类型ID |
| txId | string | Y | 链上交易ID |
| fromAddress | string | Y | 转出地址 |
| toAddress | string | Y | 转入地址 |
| network | string | Y | 网络 |
| referenceId | string | Y | 关联ID |
| comment | string | Y | 备注 |
> 说明:金额、地址等字段若无对应数据,返回 `—`。
* * *
Back to top
---
# Interface_Documentation - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/en_us/#quick-start)
Interface\_Documentation
========================
Quick Start[¶](https://www.bitunix.com/api-docs/spots/en_us/#quick-start "Permanent link")
-------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/en_us/#restful-api "Permanent link")
-------------------------------------------------------------------------------------------
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/#public-interface "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/#user-interface "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/#order-interface "Permanent link")
### [Tax Filing Interface](https://www.bitunix.com/api-docs/spots/en_us/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/#tax-filing-interface "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/en_us/#websocket-api "Permanent link")
-----------------------------------------------------------------------------------------------
### [WebSocket Introduction](https://www.bitunix.com/api-docs/spots/en_us/ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/#websocket-introduction "Permanent link")
### [Public Interface](https://www.bitunix.com/api-docs/spots/en_us/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/#public-interface_1 "Permanent link")
### [User Interface](https://www.bitunix.com/api-docs/spots/en_us/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/#user-interface_1 "Permanent link")
### [Order Interface](https://www.bitunix.com/api-docs/spots/en_us/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/en_us/#order-interface_1 "Permanent link")
* * *
#### Preparing for Access[¶](https://www.bitunix.com/api-docs/spots/en_us/#preparing-for-access "Permanent link")
If you need to use the API, please [login](https://www.bitunix.com/login)
to complete the application of the API key and the configuration, and then develop and trade according to the details of this document.
You can click [here](https://www.bitunix.com/account/apiManagement)
to create an API key.
Please make sure to remember the following information after you have successfully created the API Key:
* APIKey: Identity for API transactions, generated by random algorithm.
* SecretKey: private key, randomly generated by the system, used for signature generation.
> Risks: These two keys are closely related to the security of your account, please keep in mind that do not disclose them to others at any time. Any leakage of these two keys may cause loss of your assets. If you find any leakage of APIKey, please delete the APIKey as soon as possible.
#### Interface Type[¶](https://www.bitunix.com/api-docs/spots/en_us/#interface-type "Permanent link")
* Public
* Private Interface
##### Public Interface[¶](https://www.bitunix.com/api-docs/spots/en_us/#public-interface_2 "Permanent link")
> Public interface can be used to obtain configuration information and market data. Public requests can be invoked without authentication.
##### private interface[¶](https://www.bitunix.com/api-docs/spots/en_us/#private-interface "Permanent link")
> Private interface can be used for order management and account management. Each private request must be \[signed\] ( sign.md) using a canonical form of authentication. The private interface requires authentication using your APIKey.
#### API domain name[¶](https://www.bitunix.com/api-docs/spots/en_us/#api-domain-name "Permanent link")
You can do this yourself using the Rest API access method.
| Domain Name | REST API |
| --- | --- |
| Primary Domain | https://openapi.bitunix.com |
#### API Validation[¶](https://www.bitunix.com/api-docs/spots/en_us/#api-validation "Permanent link")
The header of all REST requests must contain the following keys:
* api-key: api-key of the request
* nonce: random string, 32-bit, generated by the caller
* timestamp: current timestamp, milliseconds
* sign: signature string (see [signature](https://www.bitunix.com/api-docs/spots/en_us/sign/)
description)
* Content-Type: Uniformly set to application/json.
#### Interaction Request[¶](https://www.bitunix.com/api-docs/spots/en_us/#interaction-request "Permanent link")
All requests are based on the Https protocol, the Content-Type in the POST request header should be set to: ' application/json'.
##### Description of Interaction Request[¶](https://www.bitunix.com/api-docs/spots/en_us/#description-of-interaction-request "Permanent link")
* Request parameter: encapsulate the parameter according to the request parameter of the interface.
* Submit request parameters: submit the encapsulated request parameters to the server via GET/POST.
* Server Response: The server first performs parameter security verification on the user request data and returns the response data in JSON format to the user according to the business logic after passing the verification.
* Data Processing: Process the response data from the server.
##### Success[¶](https://www.bitunix.com/api-docs/spots/en_us/#success "Permanent link")
HTTP status code 200 indicates a successful response and may contain content. If the response contains content, it will be displayed in the corresponding return content.
##### Common Error Codes[¶](https://www.bitunix.com/api-docs/spots/en_us/#common-error-codes "Permanent link")
* 400 Bad Request - Invalid request format
* 403 Forbidden - You do not have access to the requested resource.
* 404 Not Found No request found
* 500 Internal Server Error - We had a problem with our server Server internal error; if failed body with error description message
* See [Error Code](https://www.bitunix.com/api-docs/spots/en_us/err_code/)
for more details.
#### standardized specification[¶](https://www.bitunix.com/api-docs/spots/en_us/#standardized-specification "Permanent link")
##### Timestamp[¶](https://www.bitunix.com/api-docs/spots/en_us/#timestamp "Permanent link")
The timestamp in the request signature is in milliseconds and is standardized to UTC time. The timestamp of the request must be within 60 seconds of the API service time, otherwise the request will be considered expired and rejected.
##### Request Formats[¶](https://www.bitunix.com/api-docs/spots/en_us/#request-formats "Permanent link")
Currently there are only two request formats: GET and POST.
* GET: Parameters are transferred to the server via queryString in the path.
* POST: Parameters are transferred to the server by sending body in json format.
* * *
Back to top
---
# User ws - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_1)
User ws
=======
[快速入门](https://www.bitunix.com/api-docs/spots/zh_cn/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_1 "Permanent link")
-------------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#restful-api "Permanent link")
---------------------------------------------------------------------------------------------------
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_2 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_3 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_4 "Permanent link")
### [报税数据接口](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#websocket-api "Permanent link")
-------------------------------------------------------------------------------------------------------
### [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#websocket "Permanent link")
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_6 "Permanent link")
### 用户接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_7 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#_8 "Permanent link")
* * *
#### 1\. 查询账户余额[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#1 "Permanent link")
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "user.account",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": [//账户信息\
{\
"coin": "BTC",//币种\
"balance": 10000.00,//余额\
"balanceLocked": 1000.00//锁定余额\
}\
]
}
* * *
#### 2\. 查询用户信息[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/#2 "Permanent link")
与 [REST 用户接口 · 查询用户信息](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
语义一致:返回当前 API Key 对应用户的 `uid`;子账号 Key 返回关联主账号的 `uid`。签名规则同 [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
。
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "user.info",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": {
"uid": 681979174
}
}
`data` 字段说明同 REST:`uid` 为 int64,可能为 `null`(请以实际返回为准)。
* * *
Back to top
---
# User - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_1)
User
====
[快速入门](https://www.bitunix.com/api-docs/spots/zh_cn/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_1 "Permanent link")
----------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#restful-api "Permanent link")
------------------------------------------------------------------------------------------------
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_2 "Permanent link")
### 用户接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_3 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_4 "Permanent link")
### [报税数据接口](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#websocket-api "Permanent link")
----------------------------------------------------------------------------------------------------
### [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#websocket "Permanent link")
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_6 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_7 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#_8 "Permanent link")
* * *
#### 1\. 查询账户余额[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#1 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> GET: /api/spot/v1/user/account
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object\[\] | N | 账户信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| coin | string | Y | 币种 |
| balance | number | Y | 余额 |
| balanceLocked | number | Y | 锁定余额 |
#### 2\. 查询用户信息[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#2 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> GET: /api/spot/v1/user/info
**API说明**
* 需完成 [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
鉴权,返回当前 API Key 所对应用户的信息。
* 也可使用 **WebSocket**,`method` 为 `user.info`,`data` 结构与下表一致,见 [用户接口(WebSocket)](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
。
* **`uid`**:用户在开放接口中的唯一标识。使用**主账号** API Key 时,为当前主账号的 `uid`;使用**子账号** API Key 时,为与该子账号关联的**主账号**的 `uid`(便于在同一主账户体系下对齐用户维度)。
* 无法正常解析用户或关联主账号时,按平台 [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/)
返回。
* `uid` 可能为 `null`,请以实际返回为准并做好兼容。
**请求参数**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| 无 | | | |
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 用户信息 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| uid | int64 | N | 用户 uid;子账号 API Key 下为关联主账号 uid;可能为 null |
{
"code": "0",
"msg": "result.success",
"data": {
"uid": 681979174
},
"success": true
}
#### 3\. 发起提币[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#3 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/withdraw
**API说明**
* API只能提币到免认证地址/账户上,通过 WEB/APP 可以设置免认证地址。
* 关于标签: 某些币种如XRP充币时同时需要一个充值地址和标签(又名memo/payment\_id),标签是一种保证您的充币地址唯一性的数字串,与充币地址成对出现并一一对应。请您务必遵守正确的充值步骤,在提币时输入完整信息,否则将面临丢失币的风险!
* 必须是已添加提币权限的apikey才可提币, 否则会拒绝申请。
**请求参数(限速规则: 10次/1s(IP)**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| coin | string | Y | 币种
可以通过[查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
| network | string | Y | 币种网络 |
| address | string | Y | 提币地址 |
| amount | decimal | Y | 提币数量
提币数量(提币数量-手续费=到账数量)
数量精度可以通过[查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
| memo | string | N | memo |
{
"coin": "TRX",
"network": "Tron (TRC-20)",
"address": "TJmW5D1p1LnMdTMmxuY1VELHht7v5HV7rU",
"amount": 20.00
}
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 提现单Id |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| withdrawId | string | Y | 提现单Id |
{
"code": "0",
"msg": "result.success",
"data": "1909879608889339906",
"success": true
}
#### 4\. 撤销提币[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#4 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/withdraw/cancel
**API说明**
* 有人工审核且处于初审状态,可以撤销提币。一旦初审通过或上链,则无法撤销提币
**请求参数(限速规则: 10次/1s(IP)**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| withdrawId | string | Y | 提现单id |
{
"withdrawId": "1909879608889339906"
}
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 空 |
{
"code": "0",
"msg": "result.success",
"data": null,
"success": true
}
#### 5\. 发起站内转账[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#5 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/inside\_transfer
**API说明**
* 必须是已添加提币权限的apikey才可发起站内转账, 否则会拒绝申请。
**请求参数(限速规则: 10次/1s(IP)**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| outBizId | string(32) | N | 外部服务商业务Id, 作为幂等参数使用 |
| coin | string | Y | 币种
可以通过 [查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
| amount | decimal | Y | 转账数量
数量精度可以通过 [查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
| toType | string | Y | 转账方式
`uid` 基于用户Id
`phone` 基于用户电话号码
`email` 基于用户邮箱 |
| toUid | int64 | N | 用户Id |
| toPhoneCountryCode | string | N | 电话号码区号 |
| toPhoneNumber | string | N | 电话号码 |
| toEmail | string | N | 邮箱地址 |
| remark | string(256) | N | 备注 |
{
"coin": "USDT",
"amount": 10,
"toType": "uid",
"toUid": 681979174
}
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | string | Y | 转账单Id |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| insideTransferId | string | Y | 转账单Id |
{
"code": "0",
"msg": "result.success",
"data": "1909921053381820417",
"success": true
}
#### 6\. 撤销站内转账[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#6 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/inside\_transfer/cancel
**API说明**
* 有人工审核且处于初审状态,可以撤销站内转账。一旦初审通过,则无法撤销站内转账
**请求参数(限速规则: 10次/1s(IP)**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| insideTransferId | string | Y | 转账单id
可以通过[查询站内转账记录](https://www.bitunix.com/api-docs/spots/zh_cn/user/#%E6%9F%A5%E8%AF%A2%E7%AB%99%E5%86%85%E8%BD%AC%E8%B4%A6%E8%AE%B0%E5%BD%95)
接口获取 |
{
"insideTransferId": "1909921053381820417"
}
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 转账单Id |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| insideTransferId | string | Y | 转账单Id |
{
"code": "0",
"msg": "result.success",
"data": null,
"success": true
}
#### 7\. 获取提币记录(提币+站内转账)[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#7 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/withdraw\_transfer/page
**请求参数(限速规则: 10次/1s(IP)**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| id | string | N | 提现单Id/转账单Id |
| outBizId | string | N | 外部服务商业务Id |
| coin | string | N | 币种
可以通过 [查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
| transactionHash | string | N | 区块转账哈希记录
只在 type 为 `withdraw` 时有效 |
| type | string | N | 提现类型
`withdraw` 提币
`inside_transfer_out` 站内转账 |
| startTime | int64 | N | 查询开始时间,Unix timestamp,如:1597026383085 |
| endTime | int64 | N | 查询结束时间,Unix timestamp,如:1597026683085 |
| remark | string | N | 备注(精准查询) |
| limit | int32 | N | 返回结果集数量,默认 100,最大 100,不填则返回 100 条 |
{
"id": "1909877667383767042",
"limit": 10
}
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 提币/转账记录 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| id | string | Y | 提现单 ID、转账单 ID |
| outBizId | string | N | 外部服务商业务Id |
| coin | string | Y | 币种名称 |
| network | string | Y | 网络 |
| amount | decimal | Y | 实际到账金额 |
| feeCoin | string | Y | 手续费币种 |
| fee | decimal | Y | 手续费 |
| type | string | Y | 提现类型
`withdraw`:链上提币
`inside_transfer_out`:内部转账 |
| toAddress | string | N | 收款地址(仅 `type=withdraw` 时返回) |
| transactionHash | string | N | 交易 ID(仅 `type=withdraw` 时返回) |
| toType | string | N | 转账方式
`uid`:基于用户 ID
`phone`:基于用户电话号码
`email`:基于用户邮箱 |
| toUid | int64 | N | 收款用户 ID(仅 `toType=uid` 时返回) |
| toPhoneCountryCode | string | N | 电话区号(仅 `toType=phone` 时返回) |
| toPhoneNumber | string | N | 电话号码(仅 `toType=phone` 时返回) |
| toEmail | string | N | 邮箱(仅 `toType=email` 时返回) |
| remark | string | N | 备注 |
| status | string | Y | 提币状态
`verification`:待用户安全认证(需要到客户端提币列表做安全认证)
`pending`:处理中
`cancelled`:已撤销
`success`:成功
`fail`:失败 |
| ctime | int64 | Y | 创建时间,Unix timestamp,例如:`1597026383085` |
{
"code": "0",
"msg": "result.success",
"data": [\
{\
"id": "1909877667383767042",\
"outBizId": "123456789",\
"type": "withdraw",\
"coin": "TRX",\
"amount": "19.00000000000000000000",\
"status": "pending",\
"ctime": 1744185294000,\
"network": "Tron (TRC-20)",\
"address": "TJmW5D1p1LnMdTMmxuY1VELHht7v5HV7rU",\
"transactionHash": null,\
"feeCoin": null,\
"fee": null,\
"memo": null,\
"toType": null,\
"toUid": null,\
"toPhoneCountryCode": null,\
"toPhoneNumber": null,\
"toEmail": null,\
"remark": null\
\
}\
],
"success": true
}
#### 8\. 划转[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#8 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/funds\_transfer
**API说明**
* 个人账号,不同的资金类型转账,比如现货资金转合约资金
**请求参数(限速规则: 10次/1s(IP)**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| type | string | Y | 转账类型
`spot_futures` 现货转合约
`futures_spot` 合约转现货 |
| coin | String | Y | 币种
可以通过[查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
| amount | decimal | Y | 转账数量
数量精度可以通过[查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
{
"type": "spot_futures",
"coin": "USDT",
"amount": 100.01
}
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | string | Y | 划转产生的划转ID |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| transferId | string | Y | 划转产生的划转ID |
{
"code": "0",
"msg": "result.success",
"data": "1909902180506972162",
"success": true
}
#### 9\. 获取充币记录(充币+站内转账)[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#9 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/deposit/page
**API说明**
**请求参数(限速规则: 10次/1s(IP)**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| id | string | N | 充值单Id/转账单Id |
| coin | string | N | 币种
可以通过[查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
| type | string | N | 充值类型
`deposit` 链上充币
`inside_transfer_in` 站内充值 |
| transactionHash | string | N | 交易hash(`deposit` 链上充币时生效) |
| startTime | int64 | N | 查询开始时间,Unix timestamp, 如:1597026383085 |
| endTime | int64 | N | 查询结束时间,Unix timestamp, 如:1597026683085 |
| limit | int32 | N | 返回的结果集数量,最大为100,不填默认返回100条 |
{
"type" : "",
"transactionHash" : "",
"coin" : "USDT",
"limit" : 10
}
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object | N | 提币/转账记录 |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| id | string | Y | 充值单Id/转账单Id |
| transactionHash | string | N | 交易 ID(仅 `type=deposit` 时返回) |
| coin | string | Y | 币种名称 |
| network | string | N | 网络 (仅 `type=deposit` 时返回) |
| type | string | Y | 充值类型
`deposit` 链上充币
`inside_transfer_in` 站内充值 |
| fromAddress | string | Y | 转出方地址
`deposit` 链上转出方地址
`inside_transfer_in` 站内转出方用户id |
| toAddress | string | Y | 转入放地址
`deposit` 链上转入方地址
`inside_transfer_in` 站内转入方用户id |
| amount | decimal | Y | 实际到账金额 |
| status | string | Y | 提币状态
`pending`:处理中
`cancelled`:已取消
`success`:成功
`fail`:失败 |
| ctime | int64 | Y | 创建时间,Unix timestamp,例如:`1597026383085` |
{
"code": "0",
"msg": "Success",
"data": [\
{\
"id": 1909903708907155457,\
"transactionHash": null,\
"coin": "USDT",\
"network": null,\
"type": "inside_transfer_in",\
"fromAddress": "989541187",\
"toAddress": "681979174",\
"amount": "10.00000000",\
"status": "pending",\
"ctime": 1744191503000\
},\
{\
"id": 1909903532977074178,\
"transactionHash": null,\
"coin": "USDT",\
"network": null,\
"type": "inside_transfer_in",\
"fromAddress": "989541187",\
"toAddress": "681979174",\
"amount": "10.00000000",\
"status": "pending",\
"ctime": 1744191461000\
},\
{\
"id": 487067,\
"transactionHash": "d829e32be84907a4dfb5bee5dcdaee6b637be287f8db52817860e7169003b92d",\
"coin": "USDT",\
"network": "Tron (TRC-20)",\
"type": "deposit",\
"fromAddress": "TB73gtW1hsTxxA9XUYKLSJKTSHw6Jk53eH",\
"toAddress": "TPKhSAEy84qvpomF5wF7h5ih1WmbmupXor",\
"amount": "1000.00000000",\
"status": "success",\
"ctime": 1742892246000\
}\
],
"success": true
}
#### 10\. 获取充币地址[¶](https://www.bitunix.com/api-docs/spots/zh_cn/user/#10 "Permanent link")
> [签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
>
> HTTP请求
>
> POST: /api/spot/v1/deposit/address
**请求参数(限速规则: 10次/1s(IP)**
| 参数名 | 参数类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| coin | string | Y | 币种
可以通过[查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
| network | string | Y | 网络
可以通过[查询币种数据](https://www.bitunix.com/api-docs/spots/zh_cn/public/#%E6%9F%A5%E8%AF%A2%E5%B8%81%E7%A7%8D%E6%95%B0%E6%8D%AE)
接口获取 |
{
"coin": "USDT",
"network": "Tron (TRC-20)"
}
**返回数据**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| code | number | Y | [错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/) |
| msg | string | Y | 说明 |
| data | object\[\] | N | 充币地址列表(可能会存在多个地址,每个地址都可以使用) |
data
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| coin | string | Y | 币种 |
| network | string | Y | 网络 |
| address | string | Y | 充币地址 |
| memo | string | N | 充值 memo |
{
"code": "0",
"msg": "result.success",
"data": [\
{\
"coin": "USDT",\
"network": "Tron (TRC-20)",\
"address": "TPKhSAEy84qvpomF5wF7h5ih1WmbmupXor",\
"memo": null\
}\
],
"success": true
}
* * *
Back to top
---
# Ws - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_1)
Ws
==
[快速入门](https://www.bitunix.com/api-docs/spots/zh_cn/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_1 "Permanent link")
--------------------------------------------------------------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#restful-api "Permanent link")
----------------------------------------------------------------------------------------------
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_2 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_3 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_4 "Permanent link")
### [报税数据接口](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#websocket-api "Permanent link")
--------------------------------------------------------------------------------------------------
### WebSocket接入说明[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#websocket "Permanent link")
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_6 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_7 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_8 "Permanent link")
#### WebSocket API说明[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#websocket-api_1 "Permanent link")
* 本篇所列出的 wss 接口的 base URL:wss://openapi.bitunix.com:443/ws-api/v1
* 除非特别说明,时间戳均为毫秒级时间戳
* 所有字段名称和值都大小写敏感
* websocket连接有效期为24小时,请注意处理断开场景下的重连问题
#### 请求格式[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_9 "Permanent link")
WebSocket API请求必须在text帧中以Json格式传输,一个text帧消息代表一次请求,示例:
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "market.last_price",
"params": {
"symbol": "BTC",
"nonce" "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "477eda21f570dd4e2f7392b729254d12bc2d403d1150d0b6cfdb52191267550c"
}
}
**字段说明**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| `id` | int/string/null | Y | 请求ID,用于匹配对应请求的响应 |
| `method` | string | Y | 请求方法 |
| `params` | object | Y | 请求参数 |
* `id` 字段可以是任意字符串、数字、时间戳等,用于标识请求,响应中会原样返回
* `method` 字段为请求方法
* `params` 字段为请求参数,根据不同的请求方法,参数不同,顺序不限
#### 响应格式[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_10 "Permanent link")
WebSocket API响应在text帧中以Json格式返回,一个text帧消息代表一次响应。 \* 成功响应示例:
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "0",
"msg": "success",
"data": "10000.00"
}
* 失败响应示例:
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"code": "1",
"msg": "invalid symbol",
"data": null
}
**字段说明**
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| `id` | int/string/null | Y | 请求ID |
| `code` | string | Y | 响应码,成功为"0",其他响应码均为错误码 |
| `msg` | string | Y | 响应描述 |
| `data` | object | N | 返回数据,根据不同的请求方法,数据不同,可能为空 |
#### 身份验证[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_11 "Permanent link")
WebSocket API请求需要进行身份验证,在所有的请求参数中需要包含以下字段:
| 名称 | 类型 | 必须 | 备注 |
| --- | --- | --- | --- |
| `apiKey` | string | Y | API Key |
| `timestamp` | string | Y | 时间戳 |
| `nonce` | string | Y | 随机字符串 |
| `sign` | string | Y | 签名字符串,参见[签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/#websocket-api%E7%AD%BE%E5%90%8D%E7%9B%B8%E5%85%B3%E5%8F%82%E6%95%B0) |
#### 连接测试[¶](https://www.bitunix.com/api-docs/spots/zh_cn/ws/#_12 "Permanent link")
WebSocket API连接测试,可以通过以下方式进行测试:
{
"id": "2d812f20c9e1030f5551eab0e039f613",
"method": "ping",
"params": {
"nonce": "17832",
"timestamp": "1724285700000",
"apiKey": "9a25209b66004da404d9ddcb48d1e11f",
"sign": "--signature here--"
}
}
Back to top
---
# Index - Open Platform
[Skip to content](https://www.bitunix.com/api-docs/spots/zh_cn/#_1)
Index
=====
快速入门[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_1 "Permanent link")
---------------------------------------------------------------------------
Restful API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#restful-api "Permanent link")
-------------------------------------------------------------------------------------------
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_2 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_3 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_4 "Permanent link")
### [报税数据接口](https://www.bitunix.com/api-docs/spots/zh_cn/tax-filing/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_5 "Permanent link")
WebSocket API[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#websocket-api "Permanent link")
-----------------------------------------------------------------------------------------------
### [WebSocket接入说明](https://www.bitunix.com/api-docs/spots/zh_cn/ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#websocket "Permanent link")
### [公共接口](https://www.bitunix.com/api-docs/spots/zh_cn/public-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_6 "Permanent link")
### [用户接口](https://www.bitunix.com/api-docs/spots/zh_cn/user-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_7 "Permanent link")
### [订单接口](https://www.bitunix.com/api-docs/spots/zh_cn/order-ws/)
[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_8 "Permanent link")
* * *
#### 接入准备[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_9 "Permanent link")
如需使用API ,请先[登录](https://www.bitunix.com/login)
网页端,完成API key的申请和权限配置,再据此文档详情进行开发和交易。
您可以点击 [这里](https://www.bitunix.com/account/apiManagement)
创建 API Key。
创建成功后请务必记住以下信息:
* APIKey API交易的身份标识,随机算法生成。
* SecretKey 私钥,由系统随机生成,用于签名的生成。
> 风险提示 :这两个个密钥与账号安全密切相关,请牢记,无论何时都请勿向他人透露。 这两个个密钥任意一个泄露可能会造成您的资产损失,若发现APIKey泄露请尽快删除该APIKey。
#### 接口类型[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_10 "Permanent link")
* 公共接口
* 私有接口
##### 公共接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_11 "Permanent link")
> 公共接口可用于获取配置信息和行情数据。公共请求无需认证即可调用。
##### 私有接口[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_12 "Permanent link")
> 私有接口可用于订单管理和账户管理。每个私有请求必须使用规范的验证形式进行[签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
> 。 私有接口需要使用您的APIKey进行验证。
#### API域名[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#api "Permanent link")
您可以自行使用Rest API接入方式进行操作。
| 域名 | REST API |
| --- | --- |
| 主域名 | https://openapi.bitunix.com |
#### API验证[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#api_1 "Permanent link")
所有REST请求的header都必须包含以下key:
* api-key: 申请的api-key
* nonce: 随机字符串,32位, 调用方生成
* timestamp: 当前时间戳,毫秒
* sign: 签名字符串(请参阅[签名](https://www.bitunix.com/api-docs/spots/zh_cn/sign/)
说明)
* Content-Type:统一设置为application/json
#### 请求交互[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_13 "Permanent link")
所有请求基于Https协议,POST 请求头信息中Content-Type 需要统一设置为: 'application/json'。
##### 请求交互说明[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_14 "Permanent link")
* 请求参数:根据接口请求参数规定进行参数封装。
* 提交请求参数:将封装好的请求参数通过GET/POST方式提交至服务器。
* 服务器响应:服务器首先对用户请求数据进行参数安全校验,通过校验后根据业务逻辑将响应数据以JSON格式返回给用户。
* 数据处理:对服务器响应数据进行处理。
##### 成功[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_15 "Permanent link")
HTTP状态码200表示成功响应,并可能包含内容。如果响应含有内容,则将显示在相应的返回内容里面。
##### 常见错误码[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_16 "Permanent link")
* 400 Bad Request – Invalid request format 请求格式无效
* 403 Forbidden – You do not have access to the requested resource 请求无权限
* 404 Not Found 没有找到请求
* 500 Internal Server Error – We had a problem with our server 服务器内部错误; 如果失败body带有错误描述信息
* 更多详见[错误码](https://www.bitunix.com/api-docs/spots/zh_cn/err_code/)
#### 标准规范[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_17 "Permanent link")
##### 时间戳[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_18 "Permanent link")
请求签名中的timestamp的单位是毫秒, 统一使用标准UTC时间。请求的时间戳必须在API服务时间的60秒内,否则请求将被视为过期并被拒绝。
##### 请求格式[¶](https://www.bitunix.com/api-docs/spots/zh_cn/#_19 "Permanent link")
目前只有两种格式的请求方法:GET和POST
* GET: 参数通过queryString在路径中传输到服务器。
* POST: 参数按照json格式发送body传输到服务器。
* * *
Back to top
---
# OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/ErrorCode/error_code.html#VPContent)
Return to top
| ErrorCode | description | httpStatusCode |
| --- | --- | --- |
| 0 | Success | 200 |
| 403 | This API key does not support this operation | 200 |
| 10001 | Network Error | 200 |
| 10002 | Parameter Error | 200 |
| 10003 | api-key can't be empty | 200 |
| 10004 | The current ip is not in the apikey ip whitelist | 200 |
| 10005 | Too many requests, please try again later | 200 |
| 10006 | Request too frequently | 200 |
| 10007 | Sign signature error | 200 |
| 10008 | {value} does not comply with the rule, optional \[correctValue\] | 200 |
| 20001 | Market not exists | 200 |
| 20002 | The current positions amount has exceeded the maximum open limit, please adjust the risk limit | 200 |
| 20003 | Insufficient balance | 200 |
| 20004 | Insufficient Trader | 200 |
| 20005 | Invalid leverage | 200 |
| 20006 | You can't change leverage or margin mode as there are open orders | 200 |
| 20007 | Order not found, please try it later | 200 |
| 20008 | Insufficient amount | 200 |
| 20009 | Position exists, so positions mode cannot be updated | 200 |
| 20010 | Activation failed, the available balance in the futures account does not meet the conditions for activation of the coupon | 200 |
| 20011 | Account not allowed to trade | 200 |
| 20012 | This futures does not allow trading | 200 |
| 20013 | Function disabled due tp pending account deletion request | 200 |
| 20014 | Account deleted | 200 |
| 20015 | This futures is not supported | 200 |
| 20016 | Batch order exceeded the max size | 200 |
| 30001 | Failed to order. Please adjust the order price or the leverage as the order price dealt may immediately liquidate. | 200 |
| 30002 | Price below liquidated price | 200 |
| 30003 | Price above liquidated price | 200 |
| 30004 | Position not exist | 200 |
| 30005 | The trigger price is closer to the current price and may be triggered immediately | 200 |
| 30006 | Please select TP or SL | 200 |
| 30007 | TP trigger price is greater than average entry price | 200 |
| 30008 | TP trigger price is less than average entry price | 200 |
| 30009 | SL trigger price is less than average entry price | 200 |
| 30010 | SL trigger price is greater than average entry price | 200 |
| 30011 | Abnormal order status | 200 |
| 30012 | Already added to favorite | 200 |
| 30013 | Exceeded the maximum order quantity | 200 |
| 30014 | Max Buy Order Price | 200 |
| 30015 | Mini Sell Order Price | 200 |
| 30016 | The qty should be larger than | 200 |
| 30017 | The qty cannot be less than the minimum qty | 200 |
| 30018 | Order failed. No position opened. Cancel \[Reduce-only\] settings and retry later | 200 |
| 30019 | Order failed. A \[Reduce-only\] order can not be in the same direction as the open position | 200 |
| 30020 | Trigger price for TP should be higher than mark price: | 200 |
| 30021 | Trigger price for TP should be lower than mark price: | 200 |
| 30022 | Trigger price for SL should be higher than mark price: | 200 |
| 30023 | Trigger price fo SL should be lower than mark price: | 200 |
| 30024 | Trigger price for SL should be lower than liq price: | 200 |
| 30025 | Trigger price for SL should be higher than liq price: | 200 |
| 30026 | TP price must be greater than last price: | 200 |
| 30027 | TP price must be greater than mark price: | 200 |
| 30028 | SL price must be less than last price: | 200 |
| 30029 | SL price must be less than mark price: | 200 |
| 30030 | SL price must be greater than last price: | 200 |
| 30031 | SL price must be greater than mark price: | 200 |
| 30032 | TP price must be less than last price: | 200 |
| 30033 | TP price must be less than mark price: | 200 |
| 30034 | TP price must be less than mark price: | 200 |
| 30035 | SL price must be greater than trigger price: | 200 |
| 30036 | TP price must be greater than trigger price: | 200 |
| 30037 | TP price must be greater than trigger price: | 200 |
| 30038 | TP/SL amount must be less than the size of the position. | 200 |
| 30039 | The order qty can't be greater than the max order qty: | 200 |
| 30040 | Futures trading is prohibited, please contact customer service. | 200 |
| 30041 | Trigger price must be greater than 0 | 200 |
| 30042 | Client ID duplicate | 200 |
| 40001 | Please cancel open orders and close all positions before canceling lead trading | 200 |
| 40002 | Lead amount hast to be over the limits | 200 |
| 40003 | Lead order amount exceeds the limits. | 200 |
| 40004 | Please do not repeat the operation | 200 |
| 40005 | Action is not available for the current user type. | 200 |
| 40006 | Sub-account reaches the limit. | 200 |
| 40007 | Share settlement is being processed,lease try again later | 200 |
| 40008 | After the transfer, the account balance will be less than the order amount, please enter again. | 200 |
---
# API Introduction | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/common/introduction.html#VPContent)
Return to top
API Introduction [](https://www.bitunix.com/api-docs/futures/common/introduction.html#api-introduction)
=========================================================================================================
Welcome to the Bitunix API Documentation 🎉 This OpenAPI documentation provides a comprehensive guide to integrating with our system. Here, you will find detailed information about available endpoints, request/response formats, authentication requirements, and usage examples to help you seamlessly connect with our services.
Whether you are a developer exploring integration possibilities or optimizing your existing workflow, this documentation is your one-stop reference for making the most out of our API.
### OpenAPI Demo [](https://www.bitunix.com/api-docs/futures/common/introduction.html#openapi-demo)
You can fill in your API key and API secret to try running the official demo provided.
[Github Demo](https://github.com/BitunixOfficial/open-api)
### Preparing for Access [](https://www.bitunix.com/api-docs/futures/common/introduction.html#preparing-for-access)
If you need to use the API, please [log in](https://www.bitunix.com/login)
to complete the application of the API key and the configuration, and then develop and trade according to the details of this document.
You can click [here](https://www.bitunix.com/account/apiManagement)
to create an API key.
Please make sure to remember the following information after you have successfully created the API Key:
* APIKey: Identity for API transactions, generated by random algorithm.
* SecretKey: private key, randomly generated by the system, used for signature generation.
> Risks: These two keys are closely related to the security of your account, please keep in mind that do not disclose them to others at any time. Any leakage of these two keys may cause loss of your assets. If you find any leakage of APIKey, please delete the APIKey as soon as possible.
### Interface Type [](https://www.bitunix.com/api-docs/futures/common/introduction.html#interface-type)
* Public
* Private Interface
#### Public Interface [](https://www.bitunix.com/api-docs/futures/common/introduction.html#public-interface)
> Public interface can be used to obtain configuration information and market data. Public requests can be invoked without authentication.
#### private interface [](https://www.bitunix.com/api-docs/futures/common/introduction.html#private-interface)
> Private interface can be used for order management and account management. Each private request must be \[signed\] ( sign.md) using a canonical form of authentication. The private interface requires authentication using your APIKey.
### API domain name [](https://www.bitunix.com/api-docs/futures/common/introduction.html#api-domain-name)
You can do this yourself using the Rest API access method.
| Domain Name | REST API |
| --- | --- |
| Primary Domain | [https://fapi.bitunix.com](https://fapi.bitunix.com/) |
### API Validation [](https://www.bitunix.com/api-docs/futures/common/introduction.html#api-validation)
The header of all REST requests must contain the following keys:
* api-key: api-key of the request
* nonce: random string, 32-bit, generated by the caller
* timestamp: current timestamp, milliseconds
* sign: signature string (see [signature](https://www.bitunix.com/api-docs/futures/common/sign.html)
description)
* Content-Type: Uniformly set to application/json.
### Interaction Request [](https://www.bitunix.com/api-docs/futures/common/introduction.html#interaction-request)
All requests are based on the Https protocol, the Content-Type in the POST request header should be set to: ' application/json'.
#### Description of Interaction Request [](https://www.bitunix.com/api-docs/futures/common/introduction.html#description-of-interaction-request)
* Request parameter: encapsulate the parameter according to the request parameter of the interface.
* Submit request parameters: submit the encapsulated request parameters to the server via GET/POST.
* Server Response: The server first performs parameter security verification on the user request data and returns the response data in JSON format to the user according to the business logic after passing the verification.
* Data Processing: Process the response data from the server.
#### Success [](https://www.bitunix.com/api-docs/futures/common/introduction.html#success)
HTTP status code 200 indicates a successful response and may contain content. If the response contains content, it will be displayed in the corresponding return content.
#### Common Error Codes [](https://www.bitunix.com/api-docs/futures/common/introduction.html#common-error-codes)
* 400 Bad Request - Invalid request format
* 403 Forbidden - You do not have access to the requested resource.
* 404 Not Found No request found
* 500 Internal Server Error - We had a problem with our server internal error; if failed body with error description message
* See [Error Code](https://www.bitunix.com/api-docs/futures/ErrorCode/error_code.html)
for more details.
### standardized specification [](https://www.bitunix.com/api-docs/futures/common/introduction.html#standardized-specification)
#### Timestamp [](https://www.bitunix.com/api-docs/futures/common/introduction.html#timestamp)
The timestamp in the request signature is in milliseconds and is standardized to UTC time.
#### Request Formats [](https://www.bitunix.com/api-docs/futures/common/introduction.html#request-formats)
Currently, there are only two request formats: GET and POST.
* GET: Parameters are transferred to the server via queryString in the path.
* POST: Parameters are transferred to the server by sending body in json format.
* * *
---
# OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/#VPContent)
Bitunix Open Api
================
Welcome to the Bitunix API Documentation 🎉 This OpenAPI documentation provides a comprehensive guide to integrating with our system
[Futures](https://www.bitunix.com/api-docs/futures/common/introduction.html)
[Spot](https://www.bitunix.com/api-docs/spots/en_us/)
[Github Demo](https://github.com/BitunixOfficial/open-api)
Preparing for Access
--------------------
If you need to use the API, please log in to complete the application of the API key and the configuration, and then develop and trade according to the details of this document
Public Interface
----------------
Public interface can be used to obtain configuration information and market data. Public requests can be invoked without authentication.
private interface
-----------------
Private interface can be used for order management and account management. Each private request must be \[signed\] ( sign.md) using a canonical form of authentication. The private interface requires authentication using your APIKey
---
# OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/common/sign.html#VPContent)
Return to top
### Signature Introduction [](https://www.bitunix.com/api-docs/futures/common/sign.html#signature-introduction)
### OpenAPI Demo [](https://www.bitunix.com/api-docs/futures/common/sign.html#openapi-demo)
You can fill in your API key and API secret to try running the official demo provided.
[Github Demo](https://github.com/BitunixOfficial/open-api)
#### Restful API Signature Public Parameters [](https://www.bitunix.com/api-docs/futures/common/sign.html#restful-api-signature-public-parameters)
**Headers:**
| Name | Types | Mandatory | Description |
| --- | --- | --- | --- |
| api-key | string | Y | api-key applied |
| nonce | string | Y | Random string,32bits |
| timestamp | string | Y | Current timestamp, milliseconds |
| sign | string | Y | Singanture string |
Signature steps:
> 1. All queryParams are sorted in ascending ASCII order by Key, Example: String queryParams = "id1uid200"
> 2. Parameters in body, compressed into a string, **remember to remove all spaces**, Example:String body = {"uid":"2899","arr":\[{"id":1,"name":"maple"},{"id":2,"name":"lily"}\]}.
> **!Attention**: The request body format must be identical to the signature string.
> 3. Signature, needs to be encrypted 2 times
>
> > * String digest = SHA256(nonce + timestamp + api-key + queryParams + body)
> > * String sign = SHA256(digest + secretKey)
> > * Note: secretKey is together when applying for api-key. Please keep them safely and do not pass it around.
##### Signature Example [](https://www.bitunix.com/api-docs/futures/common/sign.html#signature-example)
_**Go:**_
golang
package main
import (
"crypto/sha256"
"encoding/hex"
"fmt"
)
func main() {
nonce := "123456"
timestamp := "20241120123045"
apiKey := "yourApiKey"
secretKey := "yourSecretKey"
queryParams := "id1uid200"
body := "{\"uid\":\"2899\",\"arr\":[{\"id\":1,\"name\":\"maple\"},{\"id\":2,\"name\":\"lily\"}]}"
digestInput := nonce + timestamp + apiKey + queryParams + body
digest := sha256Hex(digestInput)
signInput := digest + secretKey
sign := sha256Hex(signInput)
fmt.Println("Digest:", digest)
fmt.Println("Sign:", sign)
}
func sha256Hex(input string) string {
hash := sha256.Sum256([]byte(input))
return hex.EncodeToString(hash[:])
}
Python:
python
import hashlib
def sha256_hex(input_string):
return hashlib.sha256(input_string.encode('utf-8')).hexdigest()
def main():
nonce = "123456"
timestamp = "20241120123045"
api_key = "yourApiKey"
secret_key = "yourSecretKey"
query_params = "id1uid200"
body = '{"uid":"2899","arr":[{"id":1,"name":"maple"},{"id":2,"name":"lily"}]}'
digest_input = nonce + timestamp + api_key + query_params + body
digest = sha256_hex(digest_input)
sign_input = digest + secret_key
sign = sha256_hex(sign_input)
print("Digest:", digest)
print("Sign:", sign)
if __name__ == "__main__":
main()
#### WebSocket API Singature Parameters [](https://www.bitunix.com/api-docs/futures/common/sign.html#websocket-api-singature-parameters)
WebSocket API requests require authentication, and the following fields need to be included in all request parameter `params`:
| Name | Type | Mandatory | Description |
| --- | --- | --- | --- |
| `apiKey` | string | Y | API Key |
| `timestamp` | string | Y | Timestapmp |
| `nonce` | string | Y | Random string |
| `sign` | string | Y | Signature string |
Signature steps:
> 1. Sort all fields in `params` except the `sign` field in ascending ASCII order by Key, **remember to remove all spaces**, Example: String params = "apiKey9a25209b66004da404d9ddcb48d1e11fnonce123456symbolBTCtimestamp1724285700000"
> 2. Signature, needs to be encrypted 2 times
>
> > * String digest = SHA256(nonce + timestamp + apiKey + params)
> > * String sign = SHA256(digest + secretKey)
> > * Note: secretKey is together when applying for apiKey. Please keep them safely and do not pass it around.
---
# Asset Query | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/copyTrading/asset/asset_query.html#VPContent)
Return to top
Asset Query [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/asset_query.html#asset-query)
=========================================================================================================
Rate Limit: 10 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/asset_query.html#description)
Interface is used to asset query.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/asset_query.html#http-request)
* GET /api/v1/cp/asset/query
### Request Parameters [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/asset_query.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/cp/asset/query' \
-H "api-key:*******" \
-H "sign:*" \
-H "timestamp:1659076670000" \
-H "nonce:your-nonce" \
-H "language:en-US"
### Response Parameters [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/asset_query.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| available | string | Futures available |
| maxTransfer | string | Maximum transfer amount |
Response Example
json
{"code":0,"msg":"result.success","data":{"available":"54.20916","maxTransfer":"52.20916"},"success":true}
---
# transfer asset from main account to sub account | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_main_account_to_sub_account.html#VPContent)
Return to top
transfer asset from main account to sub account [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_main_account_to_sub_account.html#transfer-asset-from-main-account-to-sub-account)
=====================================================================================================================================================================================================================
Rate Limit: 10 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_main_account_to_sub_account.html#description)
Interface is used to transfer asset from main Account to subAccount.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_main_account_to_sub_account.html#http-request)
* POST /api/v1/cp/asset/transfer-to-sub-account
### Request Parameters [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_main_account_to_sub_account.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| amount | string | true | transfer amount |
| assetType | string | true | Assets are transferred from the futures account or spot account of the main account. eg: FUTURES/SPOT |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/cp/asset/transfer-to-sub-account' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"amount":"10","assetType":"SPOT"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_main_account_to_sub_account.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
Response Example
json
{"code":0,"msg":"result.success","data":"","success":true}
---
# transfer asset from subAccount to main account | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_subaccount_to_main_account.html#VPContent)
Return to top
transfer asset from subAccount to main account [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_subaccount_to_main_account.html#transfer-asset-from-subaccount-to-main-account)
==================================================================================================================================================================================================================
Rate Limit: 10 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_subaccount_to_main_account.html#description)
Interface is used to transfer asset from subAccount to main Account.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_subaccount_to_main_account.html#http-request)
* POST /api/v1/cp/asset/transfer-to-main-account
### Request Parameters [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_subaccount_to_main_account.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| amount | string | true | transfer amount |
| assetType | string | true | Assets are transferred to the futures account or spot account of the main account. eg: SOPT/FUTURES |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/cp/asset/transfer-to-main-account' \
-H "api-key:*******" \
-H "sign:*" \
-H "timestamp:1659076670000" \
-H "nonce:your-nonce" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"amount":"10","assetType":"SPOT"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/copyTrading/asset/transfer_asset_from_subaccount_to_main_account.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
Response Example
json
{"code":0,"msg":"result.success","data":"","success":true}
---
# Get Depth | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/market/get_depth.html#VPContent)
Return to top
Get Depth [](https://www.bitunix.com/api-docs/futures/market/get_depth.html#get-depth)
========================================================================================
Rate Limit: 10 req/sec/ip
### Description [](https://www.bitunix.com/api-docs/futures/market/get_depth.html#description)
Interface is used to get future order book.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/market/get_depth.html#http-request)
* GET /api/v1/futures/market/depth
### Request Parameters [](https://www.bitunix.com/api-docs/futures/market/get_depth.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair, based on the symbolName, i.e. BTCUSDT |
| limit | string | false | Fixed gear enumeration value: 1/5/15/50/max, passing max returns the maximum gear of the trading pairWhen the actual depth does not meet the limit, return according to the actual gear . If max is passed in, the maximum level of the trading pair will be returned. |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/depth?symbol=BTCUSDT&limit=max'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/market/get_depth.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| asks.index\[0\] | string | ask price |
| asks.index\[1\] | string | ask amount |
| bids.index\[0\] | string | bid price |
| bids.index\[1\] | string | bid amount |
Response Example
json
{"code":0,"data":{"asks":[[0.1001,0.1],[0.1002,10]],"bids":[[0.1,1],[0.0999,10.23]]},"msg":"Success"}
---
# Get Funding Rate | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_batch.html#VPContent)
Return to top
Get Funding Rate [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_batch.html#get-funding-rate)
===================================================================================================================
Rate Limit: 10 req/sec/ip
### Description [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_batch.html#description)
Get the current funding rate of the contract
### HTTP Request [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_batch.html#http-request)
* GET /api/v1/futures/market/funding\_rate/batch
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/funding_rate/batch'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_batch.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| symbol | string | Coin pair |
| markPrice | decimal | mark price |
| lastPrice | decimal | last price |
| fundingRate | decimal | Current funding rates |
| nextFundingTime | int64 | next Funding settlement time(ms) |
| fundingInterval | int32 | funding settlement interval(hour) |
| maxFundingRate | decimal | Max Current Funding Rate |
| minFundingRate | decimal | Min Current Funding Rate |
Response Example
json
{"code":0,"data":[{"symbol":"BTCUSDT","markPrice":"60000","lastPrice":"60001","fundingRate":"0.0005","fundingInterval":8,"nextFundingTime":"1770710400000","maxFundingRate":"0.3","minFundingRate":"-0.3"}],"msg":"Success"}
---
# Get Funding Rate | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/market/get_funding_rate.html#VPContent)
Return to top
Get Funding Rate [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate.html#get-funding-rate)
=============================================================================================================
Rate Limit: 10 req/sec/ip
### Description [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate.html#description)
Get the current funding rate of the contract
### HTTP Request [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate.html#http-request)
* GET /api/v1/futures/market/funding\_rate
### Request Parameters [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair, based on the symbolName, i.e. BTCUSDT |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/funding_rate?symbol=BTCUSDT'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| symbol | string | Coin pair |
| markPrice | decimal | mark price |
| lastPrice | decimal | last price |
| fundingRate | decimal | Current funding rates |
| nextFundingTime | int64 | next Funding settlement time(ms) |
| fundingInterval | int32 | funding settlement interval(hour) |
| maxFundingRate | decimal | Max Current Funding Rate |
| minFundingRate | decimal | Min Current Funding Rate |
Response Example
json
{"code":0,"data":[{"symbol":"BTCUSDT","markPrice":"60000","lastPrice":"60001","fundingRate":"0.0005","fundingInterval":8,"nextFundingTime":"1770710400000","maxFundingRate":"0.3","minFundingRate":"-0.3"}],"msg":"Success"}
---
# Get Kline | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/market/get_kline.html#VPContent)
Return to top
Get Kline [](https://www.bitunix.com/api-docs/futures/market/get_kline.html#get-kline)
========================================================================================
Rate Limit: 10 req/sec/ip
### Description [](https://www.bitunix.com/api-docs/futures/market/get_kline.html#description)
Interface is used to get future kline history.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/market/get_kline.html#http-request)
* GET /api/v1/futures/market/kline
### Request Parameters [](https://www.bitunix.com/api-docs/futures/market/get_kline.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair, based on the symbolName, i.e. BTCUSDT |
| startTime | int64 | false | The start time is to query the k-lines after this time,The millisecond format of the Unix timestamp, such as 1672410780000 |
| endTime | int64 | false | The end time is to query the k-lines before this time,The millisecond format of the Unix timestamp, such as 1672410780000 |
| interval | string | true | kline interval such as 1m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1M |
| limit | int | false | Default: 100, maximum: 200 |
| type | string | false | Kline type, values: LAST\_PRICE, MARK\_PRICE; default: LAST\_PRICE |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/kline?symbol=BTCUSDT&startTime=1&endTime=10234&interval=15m'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/market/get_kline.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| open | decimal | open price |
| high | decimal | high price |
| low | decimal | low price |
| close | decimal | close price |
| quoteVol | decimal | trading amount |
| quoteVol | string | Trading volume of the coin(last 24 hours) |
| baseVol | string | Trading volume of the last 24 hours |
Response Example
json
{"code":0,"data":[{"open":60000,"high":60001,"close":60000,"low":59989.2,"time":111111,"quoteVol":"1","baseVol":"60000","type":"LAST_PRICE"}],"msg":"Success"}
---
# Get Trading Pairs | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/market/get_trading_pairs.html#VPContent)
Return to top
Get Trading Pairs [](https://www.bitunix.com/api-docs/futures/market/get_trading_pairs.html#get-trading-pairs)
================================================================================================================
Rate Limit: 10 req/sec/ip
### Description [](https://www.bitunix.com/api-docs/futures/market/get_trading_pairs.html#description)
Interface is used to get future trading pair details.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/market/get_trading_pairs.html#http-request)
* GET /api/v1/futures/market/trading\_pairs
### Request Parameters [](https://www.bitunix.com/api-docs/futures/market/get_trading_pairs.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | string | false | Trading pairs, based on the symbolName, i.e. BTCUSDT,ETHUSDT,XRPUSDT |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/trading_pairs?symbols=BTCUSDT,ETHUSDT'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/market/get_trading_pairs.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| symbol | string | Coin pair name i.e. BTCUSDT |
| base | string | Base currency Specifically refers to ETH as in ETHUSDT |
| quote | string | Base currency Specifically refers to USDT as in ETHUSDT |
| minTradeVolume | string | Minimum opening amount (base currency) |
| minBuyPriceOffset | string | Minimum price offset for buy orders |
| maxSellPriceOffset | string | Maximum price offset for sell orders |
| maxLimitOrderVolume | string | Maximum limit order base amount |
| maxMarketOrderVolume | string | Maximum market order base amount |
| basePrecision | int | Max precision of opening amount |
| quotePrecision | int | Max precision of order price |
| maxLeverage | int | Max leverage |
| minLeverage | int | Min leverage |
| defaultLeverage | int | Default Leverage |
| defaultMarginMode | string | Default margin mode **Isolation** **Cross** |
| priceProtectScope | string | Price protection scope.
For example: current mark price is:10000 priceProtectScope=0.02, the minimum sell order price = 10000\*(1-0.02)=9800; the maximum buy order price = 10000\*(1+0.02) = 10200 |
| symbolStatus | string | **OPEN**: trade normal **CANCEL\_ONLY**: cancel only **STOP**: can't open/close position |
| isApiSupported | bool | **true**: API Trading Enabled **false**: API Trading Disabled |
| maxFundingRate | decimal | Max Current Funding Rate |
| minFundingRate | decimal | Min Current Funding Rate |
Response Example
json
{"code":0,"data":[{"symbol":"BTCUSDT","base":"BTC","quote":"USDT","minTradeVolume":"0.0001","minBuyPriceOffset":"-0.95","maxSellPriceOffset":"100","maxLimitOrderVolume":"100000","maxMarketOrderVolume":"50000","basePrecision":4,"quotePrecision":1,"minLeverage":1,"maxLeverage":125,"defaultLeverage":20,"defaultMarginMode":1,"priceProtectScope":"0.02","symbolStatus":"OPEN","isApiSupported":true,"maxFundingRate":"0.3","minFundingRate":"-0.3"}],"msg":"Success"}
---
# Change Log | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/log/change_log.html#VPContent)
Return to top
Change Log [](https://www.bitunix.com/api-docs/futures/log/change_log.html#change-log)
========================================================================================
This page records updates to the OpenAPI documentation.
2026-06-15 [](https://www.bitunix.com/api-docs/futures/log/change_log.html#_2026-06-15)
-----------------------------------------------------------------------------------------
### WebSocket Connection Limits [](https://www.bitunix.com/api-docs/futures/log/change_log.html#websocket-connection-limits)
Added WebSocket connection rate limit documentation under [WebSocket Preparing for Access](https://www.bitunix.com/api-docs/futures/websocket/prepare/WebSocket.html)
.
* The WebSocket server accepts a maximum of **5 messages per second**
* Messages include PING frames, PONG frames, and JSON-formatted messages (such as subscribe and unsubscribe requests)
* If the message rate exceeds this limit, the connection will be disconnected
* IPs that are repeatedly disconnected may be blocked by the server
---
# Get Tickers | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/market/get_tickers.html#VPContent)
Return to top
Get Tickers [](https://www.bitunix.com/api-docs/futures/market/get_tickers.html#get-tickers)
==============================================================================================
Rate Limit: 10 req/sec/ip
### Description [](https://www.bitunix.com/api-docs/futures/market/get_tickers.html#description)
Interface is used to get future trading pair tickers.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/market/get_tickers.html#http-request)
* GET /api/v1/futures/market/tickers
### Request Parameters [](https://www.bitunix.com/api-docs/futures/market/get_tickers.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | string | false | Trading pairs, based on the symbolName, i.e. BTCUSDT,ETHUSDT,XRPUSDT |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/tickers?symbols=BTCUSDT,ETHUSDT'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/market/get_tickers.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| symbol | string | Coin pair name i.e. BTCUSDT |
| markPrice | string | mark price |
| lastPrice | string | last price |
| open | string | Entry price of the last 24 hours |
| last | string | last price |
| quoteVol | string | Trading volume of the coin(last 24 hours) |
| baseVol | string | Trading volume of the last 24 hours |
| high | string | 24h high |
| low | string | 24h low |
Response Example
json
{"code":0,"data":[{"symbol":"BTCUSDT","markPrice":"57892.1","lastPrice":"57891.2","open":"6.31","last":"6.31","quoteVol":"0","baseVol":"0","high":"6.31","low":"6.31"},{"symbol":"ETHUSDT","markPrice":"2000","lastPrice":"2020.1","open":"6.31","last":"6.31","quoteVol":"0","baseVol":"0","high":"6.31","low":"6.31"}],"msg":"Success"}
---
# Get Funding Rate History | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_history.html#VPContent)
Return to top
Get Funding Rate [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_history.html#get-funding-rate)
=====================================================================================================================
Rate Limit: 10 req/sec/ip
### Description [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_history.html#description)
Get the history funding rate of the contract
### HTTP Request [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_history.html#http-request)
* GET /api/v1/futures/market/get\_funding\_rate\_history
### Request Parameters [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_history.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair, based on the symbolName, i.e. BTCUSDT |
| starTime | int64 | false | Start timestamp(Funding settle time)
Unix timestamp in milliseconds format, e.g. 1597026383085 |
| endTime | int64 | fasle | End timestamp(Funding settle time)
Unix timestamp in milliseconds format, e.g. 1597026383085 |
| limit | int32 | false | Default: 100,Maximum: 200 |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/get_funding_rate_history?symbol=BTCUSDT&limit=10'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/market/get_funding_rate_history.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| markPrice | string | Mark price |
| fundingRate | string | Funding rate |
| fundingTime | int64 | Funding timestamp |
Response Example
json
{"code":0,"data":[{"fundingRate":"-0.00001191","fundingTime":"1772449200000","markPrice":"66286.6"}],"msg":"Success"}
---
# Get History Positions | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/position/get_history_positions.html#VPContent)
Return to top
Get History Positions [](https://www.bitunix.com/api-docs/futures/position/get_history_positions.html#get-history-positions)
==============================================================================================================================
Rate Limit: 10 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/position/get_history_positions.html#description)
Get History Positions
### HTTP Request [](https://www.bitunix.com/api-docs/futures/position/get_history_positions.html#http-request)
* GET /api/v1/futures/position/get\_history\_positions
### Request Parameters [](https://www.bitunix.com/api-docs/futures/position/get_history_positions.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | false | Trading pair |
| positionId | string | false | position id |
| startTime | int64 | false | Start timestamp(position create time)
Unix timestamp in milliseconds format, e.g. 1597026383085 |
| endTime | int64 | false | Start timestamp(position create time)
Unix timestamp in milliseconds format, e.g. 1597026683085 |
| skip | int64 | false | skip order count default: 0 |
| limit | int64 | false | Number of queries: Maximum: 100, default: 10 |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/position/get_history_positions?symbol=BTCUSDT' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json"
### Response Parameters [](https://www.bitunix.com/api-docs/futures/position/get_history_positions.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| positionList | list | position list |
| \>positionId | string | position id |
| \>symbol | string | Trading pair |
| \>maxQty | string | max position amount |
| \>entryPrice | string | average entry price |
| \>closePrice | string | average close price |
| \>liqQty | string | liquidate quantity |
| \>side | string | **LONG** **SHORT** |
| \>marginMode | string | **ISOLATION** **CROSS** |
| \>positionMode | string | **ONE\_WAY** **HEDGE** |
| \>leverage | int32 | leverage |
| \>fee | string | Deducted transaction fees: transaction fees deducted during the position |
| \>funding | string | total funding fee during the position |
| \>realizedPNL | string | Realized PnL(exclude funding fee and transaction fee) |
| \>liqPrice | string | Estimated liquidation price
If the value <= 0, it means the position is at low risk and there is no liquidation price at this time |
| \>ctime | int64 | create timestamp |
| \>mtime | int64 | latest modify timestamp |
| total | int64 | total count |
Response Example
json
{"code":0,"data":{"positionList":[{"positionId":"12345678","symbol":"BTCUSDT","maxQty":"0.5","entryPrice":"60000","closePrice":"61000","liqQty":"0","side":"LONG","positionMode":"HEDGE","marginMode":"ISOLATION","leverage":100,"fee":"0.1","funding":"-0.2","realizedPNL":"102.9","liqPrice":"22209","ctime":1691382137448,"mtime":1691382137448}],"total":12},"msg":"Success"}
---
# Get Pending Positions | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/position/get_pending_positions.html#VPContent)
Return to top
Get Pending Positions [](https://www.bitunix.com/api-docs/futures/position/get_pending_positions.html#get-pending-positions)
==============================================================================================================================
Rate Limit: 10 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/position/get_pending_positions.html#description)
Get Pending Positions
### HTTP Request [](https://www.bitunix.com/api-docs/futures/position/get_pending_positions.html#http-request)
* GET /api/v1/futures/position/get\_pending\_positions
### Request Parameters [](https://www.bitunix.com/api-docs/futures/position/get_pending_positions.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | false | Trading pair |
| positionId | string | false | position id |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/position/get_pending_positions?symbol=BTCUSDT' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json"
### Response Parameters [](https://www.bitunix.com/api-docs/futures/position/get_pending_positions.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| positionId | string | position id |
| symbol | string | Trading pair |
| qty | string | position amount |
| entryValue | string | Available amount for positions |
| side | string | **LONG** **SHORT** |
| marginMode | string | **ISOLATION** **CROSS** |
| positionMode | string | **ONE\_WAY** **HEDGE** |
| leverage | int32 | leverage |
| fee | string | Deducted transaction fees: transaction fees deducted during the position |
| funding | string | total funding fee during the position |
| realizedPNL | string | Realized PnL(exclude funding fee and transaction fee) |
| margin | string | locked asset of the position |
| unrealizedPNL | string | Unrealized PnL |
| liqPrice | string | Estimated liquidation price
If the value <= 0, it means the position is at low risk and there is no liquidation price at this time |
| marginRate | string | Margin ratio |
| avgOpenPrice | string | Average open price |
| ctime | int64 | create timestamp |
| mtime | int64 | latest modify timestamp |
Response Example
json
{"code":0,"data":[{"positionId":"12345678","symbol":"BTCUSDT","qty":"0.5","entryValue":"30000","side":"LONG","positionMode":"HEDGE","marginMode":"ISOLATION","leverage":100,"fee":"0.1","funding":"-0.2","realizedPNL":"102.9","margin":"300","unrealizedPNL":"1.5","liqPrice":"22209","marginRate":"0.01", "avgOpenPrice": "1.0","ctime":1691382137448,"mtime":1691382137448}],"msg":"Success"}
---
# Cancel TP/SL Order | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/tp_sl/cancel_tp_sl_order.html#VPContent)
Return to top
Cancel TP/SL Order [](https://www.bitunix.com/api-docs/futures/tp_sl/cancel_tp_sl_order.html#cancel-tp-sl-order)
==================================================================================================================
Rate Limit: 10 req/sec/UID
### Description [](https://www.bitunix.com/api-docs/futures/tp_sl/cancel_tp_sl_order.html#description)
Cancel TP/SL Order
Successful interface response is not necessarily equal to the success of the operation, please use the websocket push message as an accurate judgment of the success of the operation.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/tp_sl/cancel_tp_sl_order.html#http-request)
* POST /api/v1/futures/tpsl/cancel\_order
### Request Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/cancel_tp_sl_order.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | coin Pair |
| orderId | string | true | TP/SL Order ID |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/tpsl/cancel_order' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"symbol":"BTCUSDT","orderId":"12"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/cancel_tp_sl_order.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| orderId | string | TP/SL Order ID |
Response Example
json
{"code":0,"data":{"orderId":"11111"},"msg":"Success"}
---
# Get Position Tiers | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/position/get_position_tiers.html#VPContent)
Return to top
Get Position Tiers [](https://www.bitunix.com/api-docs/futures/position/get_position_tiers.html#get-position-tiers)
=====================================================================================================================
Rate Limit: 10 req/sec/ip
### Description [](https://www.bitunix.com/api-docs/futures/position/get_position_tiers.html#description)
Get Position Tiers
### HTTP Request [](https://www.bitunix.com/api-docs/futures/position/get_position_tiers.html#http-request)
* GET /api/v1/futures/position/get\_position\_tiers
### Request Parameters [](https://www.bitunix.com/api-docs/futures/position/get_position_tiers.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/position/get_position_tiers?symbol=BTCUSDT'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/position/get_position_tiers.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| symbol | string | Trading pair |
| level | int32 | level |
| startValue | string | Minimum value |
| endValue | string | Maximum value |
| leverage | int32 | leverage |
| maintenanceMarginRate | string | Maintenance margin rate: The margin amount corresponds to the position quantity tier. When the margin rate of a position is less than the maintenance margin rate, it will trigger a forced partial liquidation or full liquidation. |
Response Example
json
{"code":0,"data":[{"symbol":"BTCUSDT","level":1,"startValue":"0","endValue":"50000","leverage":125,"maintenanceMarginRate":"0.004"},{"symbol":"BTCUSDT","level":2,"startValue":"50000","endValue":"200000","leverage":100,"maintenanceMarginRate":"0.005"}],"msg":"Success"}
---
# Get History TP/SL Order | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/tp_sl/get_history_tp_sl_order.html#VPContent)
Return to top
Get History TP/SL Order [](https://www.bitunix.com/api-docs/futures/tp_sl/get_history_tp_sl_order.html#get-history-tp-sl-order)
=================================================================================================================================
Rate Limit: 10 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/tp_sl/get_history_tp_sl_order.html#description)
Get History TP/SL Order
### HTTP Request [](https://www.bitunix.com/api-docs/futures/tp_sl/get_history_tp_sl_order.html#http-request)
* GET /api/v1/futures/tpsl/get\_history\_orders
### Request Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/get_history_tp_sl_order.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | false | Trading pair |
| side | int32 | false | order side |
| positionMode | int32 | false | order position mode |
| startTime | int64 | false | Start timestamp
Unix timestamp in milliseconds format, e.g. 1597026383085 |
| endTime | int64 | false | Start timestamp
Unix timestamp in milliseconds format, e.g. 1597026683085 |
| skip | int64 | false | skip order count default: 0 |
| limit | int64 | false | Number of queries: Maximum: 100, default: 10 |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/tpsl/get_history_orders?symbol=BTCUSDT' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json"
### Response Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/get_history_tp_sl_order.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| orderList | list | TP/SL order List |
| \>id | string | order id |
| \>positionId | string | position id |
| \>symbol | string | coin pair |
| \>base | string | base |
| \>quote | string | quote |
| \>tpPrice | string | Take-profit trigger price |
| \>tpStopType | string | Take-profit trigger type
LAST\_PRICE
MARK\_PRICE |
| \>slPrice | string | Stop-loss trigger price |
| \>slStopType | string | Stop-loss trigger type
LAST\_PRICE
MARK\_PRICE |
| \>tpOrderType | string | Take-profit order type
LIMIT
MARKET
Default is market. |
| \>tpOrderPrice | string | Take-profit order price |
| \>slOrderType | string | Stop-loss order type
LIMIT
MARKET
Default is market. |
| \>slOrderPrice | string | Stop-loss order price |
| \>tpQty | string | Take-profit order quantity(base coin)
At least one of `tpQty` or `slQty` is required. |
| \>slQty | string | Stop-loss order quantity(base coin)
At least one of `tpQty` or `slQty` is required. |
| \>status | string | TP/SL order status |
| \>ctime | int64 | create timestamp |
| \>triggerTime | int64 | trigger time timestamp |
| total | int64 | total |
Response Example
json
{"code":0,"data":[{"positionId":"12345678","symbol":"BTCUSDT","qty":"0.5","entryValue":"30000","side":"LONG","positionMode":"HEDGE","marginMode":"ISOLATION","leverage":100,"fee":"0.1","funding":"-0.2","realizedPNL":"102.9","margin":"300","unrealizedPNL":"1.5","liqPrice":"22209","marginRate":"0.01","ctime":1691382137448,"mtime":1691382137448}],"msg":"Success"}
---
# Modify TP/SL Order | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/tp_sl/modify_tp_sl_order.html#VPContent)
Return to top
Modify TP/SL Order [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_tp_sl_order.html#modify-tp-sl-order)
==================================================================================================================
Rate Limit: 10 req/sec/UID
### Description [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_tp_sl_order.html#description)
Modify TP/SL Order
### HTTP Request [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_tp_sl_order.html#http-request)
* POST /api/v1/futures/tpsl/modify\_order
### Request Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_tp_sl_order.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| orderId | string | true | TP/SL Order ID |
| tpPrice | string | false | Take-profit trigger price
At least one of `tpPrice` or `slPrice` is required. |
| tpStopType | string | false | Take-profit trigger type
LAST\_PRICE
MARK\_PRICE
Default is market price. |
| slPrice | string | false | Stop-loss trigger price
At least one of `tpPrice` or `slPrice` is required. |
| slStopType | string | false | Stop-loss trigger type
LAST\_PRICE
MARK\_PRICE
Default is market price. |
| tpOrderType | string | false | Take-profit order type
LIMIT
MARKET
Default is market. |
| tpOrderPrice | string | false | Take-profit order price |
| slOrderType | string | false | Stop-loss order type
LIMIT
MARKET
Default is market. |
| slOrderPrice | string | false | Stop-loss order price |
| tpQty | string | false | Take-profit order quantity(base coin)
At least one of `tpQty` or `slQty` is required. |
| slQty | string | false | Stop-loss order quantity(base coin)
At least one of `tpQty` or `slQty` is required. |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/tpsl/modify_order' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"orderId":"123","tpPrice":"12","tpStopType":"LAST_PRICE","slPrice":"9","slStopType":"LAST_PRICE","tpOrderType":"LIMIT","tpOrderPrice":"11","slOrderType":"LIMIT","slOrderPrice":"8","tpQty":"1","slQty":"1"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_tp_sl_order.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| orderId | string | TP/SL Order ID |
Response Example
json
{"code":0,"data":{"orderId":"11111"},"msg":"Success"}
---
# Cancel All Orders | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/trade/cancel_all_orders.html#VPContent)
Return to top
Cancel All Orders [](https://www.bitunix.com/api-docs/futures/trade/cancel_all_orders.html#cancel-all-orders)
===============================================================================================================
Rate Limit: 10 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/trade/cancel_all_orders.html#description)
cancel all orders
Successful interface response is not necessarily equal to the success of the operation, please use the websocket push message as an accurate judgment of the success of the operation.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/trade/cancel_all_orders.html#http-request)
* POST /api/v1/futures/trade/cancel\_all\_orders
### Request Parameters [](https://www.bitunix.com/api-docs/futures/trade/cancel_all_orders.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | false | Trading pair |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/trade/cancel_all_orders' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"symbol":"BTCUSDT"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/trade/cancel_all_orders.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| successList | list | Successful order list |
| \>id | string | order id |
| \>clientId | string | client id |
| failureList | list | Failed order list |
| \>id | string | order id |
| \>clientId | string | client id |
| \>errorMsg | string | error msg |
| \>errorCode | string | error code |
Response Example
json
{"code":0,"data":{"successList":[{"orderId":"11111","clientId":"22222"}],"failureList":[{"orderId":"11112","clientId":"22223","errorMsg":"Order status error","errorCode":10013}]},"msg":"Success"}
---
# Modify Position TP/SL Order | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/tp_sl/modify_position_tp_sl_order.html#VPContent)
Return to top
Modify Position TP/SL Order [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_position_tp_sl_order.html#modify-position-tp-sl-order)
=============================================================================================================================================
Rate Limit: 10 req/sec/UID
### Description [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_position_tp_sl_order.html#description)
Modify Position TP/SL Order
### HTTP Request [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_position_tp_sl_order.html#http-request)
* POST /api/v1/futures/tpsl/position/modify\_order
### Request Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_position_tp_sl_order.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair |
| positionId | string | true | Position ID associated with take-profit and stop-loss |
| tpPrice | string | false | Take-profit trigger price
At least one of `tpPrice` or `slPrice` is required. |
| tpStopType | string | false | Take-profit trigger type
LAST\_PRICE
MARK\_PRICE
Default is market price. |
| slPrice | string | false | Stop-loss trigger price
At least one of `tpPrice` or `slPrice` is required. |
| slStopType | string | false | Stop-loss trigger type
LAST\_PRICE
MARK\_PRICE
Default is market price. |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/tpsl/position/modify_order' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"symbol":"BTCUSDT","positionId":"11","tpPrice":"12","tpStopType":"LAST_PRICE","slPrice":"9","slStopType":"LAST_PRICE"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/modify_position_tp_sl_order.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| orderId | string | TP/SL Order ID |
Response Example
json
{"code":0,"data":{"orderId":"11111"},"msg":"Success"}
---
# Close All Position | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/trade/close_all_position.html#VPContent)
Return to top
Close All Position [](https://www.bitunix.com/api-docs/futures/trade/close_all_position.html#close-all-position)
==================================================================================================================
Rate Limit: 1 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/trade/close_all_position.html#description)
Close all positions
### HTTP Request [](https://www.bitunix.com/api-docs/futures/trade/close_all_position.html#http-request)
* POST /api/v1/futures/trade/close\_all\_position
### Request Parameters [](https://www.bitunix.com/api-docs/futures/trade/close_all_position.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | false | Trading pair |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/trade/close_all_position' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"symbol":"BTCUSDT"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/trade/close_all_position.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
Response Example
json
{"code":0,"data":"","msg":"Success"}
---
# Cancel Orders | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/trade/cancel_orders.html#VPContent)
Return to top
Cancel Orders [](https://www.bitunix.com/api-docs/futures/trade/cancel_orders.html#cancel-orders)
===================================================================================================
Rate Limit: 5 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/trade/cancel_orders.html#description)
Cancel orders
Successful interface response is not necessarily equal to the success of the operation, please use the websocket push message as an accurate judgment of the success of the operation.
### HTTP Request [](https://www.bitunix.com/api-docs/futures/trade/cancel_orders.html#http-request)
* POST /api/v1/futures/trade/cancel\_orders
### Request Parameters [](https://www.bitunix.com/api-docs/futures/trade/cancel_orders.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair |
| orderList | list | true | order parameter list |
| orderId | string | false | Order ID
Either orderId or clientId is required. If both are entered, orderId prevails. |
| clientId | string | false | Customize order ID
Either orderId or clientId is required. If both are entered, orderId prevails. |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/trade/cancel_orders' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"symbol":"BTCUSDT","orderList":[{"orderId":"11111"},{"clientId":"22223"}]}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/trade/cancel_orders.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| successList | list | Successful order list |
| \>id | string | order id |
| \>clientId | string | client id |
| failureList | list | Failed order list |
| \>id | string | order id |
| \>clientId | string | client id |
| \>errorMsg | string | error msg |
| \>errorCode | string | error code |
Response Example
json
{"code":0,"data":{"successList":[{"orderId":"11111","clientId":"22222"}],"failureList":[{"orderId":"11112","clientId":"22223","errorMsg":"Order status error","errorCode":10013}]},"msg":"Success"}
---
# Place TP/SL Order | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/tp_sl/place_tp_sl_order.html#VPContent)
Return to top
Place TP/SL Order [](https://www.bitunix.com/api-docs/futures/tp_sl/place_tp_sl_order.html#place-tp-sl-order)
===============================================================================================================
Rate Limit: 10 req/sec/UID
### Description [](https://www.bitunix.com/api-docs/futures/tp_sl/place_tp_sl_order.html#description)
Place TP/SL Order
### HTTP Request [](https://www.bitunix.com/api-docs/futures/tp_sl/place_tp_sl_order.html#http-request)
* POST /api/v1/futures/tpsl/place\_order
### Request Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/place_tp_sl_order.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair |
| positionId | string | true | Position ID associated with take-profit and stop-loss |
| tpPrice | string | false | Take-profit trigger price
At least one of `tpPrice` or `slPrice` is required. |
| tpStopType | string | false | Take-profit trigger type
LAST\_PRICE
MARK\_PRICE
Default is market price. |
| slPrice | string | false | Stop-loss trigger price
At least one of `tpPrice` or `slPrice` is required. |
| slStopType | string | false | Stop-loss trigger type
LAST\_PRICE
MARK\_PRICE
Default is market price. |
| tpOrderType | string | false | Take-profit order type
LIMIT
MARKET
Default is market. |
| tpOrderPrice | string | false | Take-profit order price |
| slOrderType | string | false | Stop-loss order type
LIMIT
MARKET
Default is market. |
| slOrderPrice | string | false | Stop-loss order price |
| tpQty | string | false | Take-profit order quantity(base coin)
At least one of `tpQty` or `slQty` is required. |
| slQty | string | false | Stop-loss order quantity(base coin)
At least one of `tpQty` or `slQty` is required. |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/tpsl/place_order' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"symbol":"BTCUSDT","positionId":"111","tpPrice":"12","tpStopType":"LAST_PRICE","slPrice":"9","slStopType":"LAST_PRICE","tpOrderType":"LIMIT","tpOrderPrice":"11","slOrderType":"LIMIT","slOrderPrice":"8","tpQty":"1","slQty":"1"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/tp_sl/place_tp_sl_order.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| orderId | string | TP/SL Order ID |
Response Example
json
{"code":0,"data":{"orderId":"11111"},"msg":"Success"}
---
# Flash Close Position | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/trade/flash_close_position.html#VPContent)
Return to top
Flash Close Position [](https://www.bitunix.com/api-docs/futures/trade/flash_close_position.html#flash-close-position)
========================================================================================================================
Rate Limit: 5 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/trade/flash_close_position.html#description)
Close position by position id
### HTTP Request [](https://www.bitunix.com/api-docs/futures/trade/flash_close_position.html#http-request)
* POST /api/v1/futures/trade/flash\_close\_position
### Request Parameters [](https://www.bitunix.com/api-docs/futures/trade/flash_close_position.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| positionId | String | true | position id |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/trade/flash_close_position' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"positionId":"19848247723672"}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/trade/flash_close_position.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| positionId | string | Position ID |
Response Example
json
{"code":0,"data":{"positionId":"19848247723672"},"msg":"Success"}
---
# Batch Order | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/trade/batch_order.html#VPContent)
Return to top
Batch Order [](https://www.bitunix.com/api-docs/futures/trade/batch_order.html#batch-order)
=============================================================================================
Rate Limit: 1 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/trade/batch_order.html#description)
Place order
### HTTP Request [](https://www.bitunix.com/api-docs/futures/trade/batch_order.html#http-request)
* POST /api/v1/futures/trade/batch\_order
### Request Parameters [](https://www.bitunix.com/api-docs/futures/trade/batch_order.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | true | Trading pair |
| orderList | list | true | Order list, maximum length: 5 |
| \>qty | string | true | Amount (base coin) |
| \>price | string | false | Price of the order.
Required if the order type is **LIMIT** |
| \>side | string | true | Order direction
buy: **BUY**
sell: **SELL** |
| \>tradeSide | string | true | Direction
Only required in hedge-mode
Open and Close Notes:
For open long, side fill in"BUY"; tradeSide should be "OPEN"
For open short, side fill in "SELL"; tradeSide should be "OPEN"
For close long, side fill in "BUY"; tradeSide should be "CLOSE"
For close short, side fill in "SELL";tradeSide should be "CLOSE" |
| \>positionId | string | false | Position ID
Only required when "tradeSide" is "CLOSE" |
| \>orderType | string | true | Order type
**LIMIT**: limit orders
**MARKET**: market orders |
| \>effect | string | false | Order expiration date.
Required if the orderType is limit
**IOC**: Immediate or cancel
**FOK**: Fill or kill
**GTC**: Good till canceled(default value)
**POST\_ONLY**: POST only |
| \>clientId | string | false | Customize order ID |
| \>reduceOnly | boolean | false | Whether or not to just reduce the position |
| \>tpPrice | string | false | take profit trigger price |
| \>tpStopType | string | false | take profit trigger type
**MARK\_PRICE**
**LAST\_PRICE** |
| \>tpOrderType | string | false | take profit trigger place order type
**LIMIT**
**MARKET** |
| \>tpOrderPrice | string | false | take profit trigger place order price
**LIMIT**
**MARKET**
required if tpOrderType is **LIMIT** |
| \>slPrice | string | false | stop loss trigger price |
| \>slStopType | string | false | stop loss trigger type
**MARK\_PRICE**
**LAST\_PRICE** |
| \>slOrderType | string | false | stop loss trigger place order type
**LIMIT**
**MARKET** |
| \>slOrderPrice | string | false | stop loss trigger place order price
**LIMIT**
**MARKET**
required if slOrderType is **LIMIT** |
Request Example
bash
curl -X 'POST' --location 'https://fapi.bitunix.com/api/v1/futures/trade/batch_order' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json" \
--data '{"symbol":"BTCUSDT","orderList":[{"side":"BUY","price":"60000","qty":"0.5","orderType":"LIMIT","reduceOnly":false,"effect":"GTC","clientId":"c12345","tpPrice":"61000","tpStopType":"MARK","tpOrderType":"LIMIT","tpOrderPrice":"61000.1","slPrice":"59000","slStopType":"LAST","slOrderType":"MARKET"},{"side":"SELL","price":"61000","qty":"0.5","orderType":"LIMIT","reduceOnly":false,"effect":"IOC","clientId":"c12346"}]}'
### Response Parameters [](https://www.bitunix.com/api-docs/futures/trade/batch_order.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| successList | list | Successful order list |
| \>id | string | order id |
| \>clientId | string | client id |
| failureList | list | Failed order list |
| \>clientId | string | client id |
| \>errorMsg | string | error msg |
| \>errorCode | string | error code |
Response Example
json
{"code":0,"data":{"successList":[{"id":"11111","clientId":"22222"}],"failureList":[{"clientId":"22222","errorMsg":"Insufficient balance","errorCode":10012}]},"msg":"Success"}
---
# Get History Orders | OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/trade/get_history_orders.html#VPContent)
Return to top
Get History Orders [](https://www.bitunix.com/api-docs/futures/trade/get_history_orders.html#get-history-orders)
==================================================================================================================
Rate Limit: 10 req/sec/uid
### Description [](https://www.bitunix.com/api-docs/futures/trade/get_history_orders.html#description)
get history orders, sort by create time desc
### HTTP Request [](https://www.bitunix.com/api-docs/futures/trade/get_history_orders.html#http-request)
* GET /api/v1/futures/trade/get\_history\_orders
### Request Parameters [](https://www.bitunix.com/api-docs/futures/trade/get_history_orders.html#request-parameters)
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string | false | Trading pair |
| orderId | string | false | order id |
| clientId | string | false | client id |
| status | string | false | Order status
**FILLED** **CANCELED****PART\_FILLED\_CANCELED****EXPIRED** |
| type | string | false | Order type
**LIMIT**
**MARKET** default all |
| startTime | int64 | false | Start timestamp
Unix timestamp in milliseconds format, e.g. 1597026383085 |
| endTime | int64 | false | Start timestamp
Unix timestamp in milliseconds format, e.g. 1597026683085 |
| skip | int64 | false | skip order count default: 0 |
| limit | int64 | false | Number of queries: Maximum: 100, default: 10 |
Request Example
bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/trade/get_history_orders?symbol=BTCUSDT' \
-H "api-key:*******" \
-H "sign:*" \
-H "nonce:your-nonce" \
-H "timestamp:1659076670000" \
-H "language:en-US" \
-H "Content-Type: application/json"
### Response Parameters [](https://www.bitunix.com/api-docs/futures/trade/get_history_orders.html#response-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| orderList | list | order list |
| \>orderId | string | order id |
| \>symbol | string | Trading pair |
| \>qty | string | Amount (base coin) |
| \>tradeQty | string | Fill amount (base coin) |
| \>positionMode | string | ONE\_WAY or HEDGE |
| \>marginMode | string | ISOLATION or CROSS |
| \>leverage | int | leverage |
| \>price | string | Price of the order.
Required if the order type is **LIMIT** |
| \>side | string | Order direction
buy: **BUY**
sell: **SELL** |
| \>orderType | string | Order type
**LIMIT**: limit orders
**MARKET**: market orders |
| \>effect | string | Order expiration date.
Required if the orderType is limit
**IOC**: Immediate or cancel
**FOK**: Fill or kill
**GTC**: Good till canceled(default value)
**POST\_ONLY**: POST only |
| \>clientId | string | Customize order ID |
| \>reduceOnly | boolean | Whether or not to just reduce the position |
| \>status | string | **INIT**:prepare status
**NEW**:pending
**PART\_FILLED**:partially filled
**CANCELED**:canceled
**FILLED**All filled |
| \>fee | string | fee |
| \>realizedPNL | string | realized pnl |
| \>tpPrice | string | take profit trigger price |
| \>tpStopType | string | take profit trigger type
**MARK\_PRICE**
**LAST\_PRICE** |
| \>tpOrderType | string | take profit trigger place order type
**LIMIT**
**MARKET** |
| \>tpOrderPrice | string | take profit trigger place order price
**LIMIT**
**MARKET**
required if tpOrderType is **LIMIT** |
| \>slPrice | string | stop loss trigger price |
| \>slStopType | string | stop loss trigger type
**MARK\_PRICE**
**LAST\_PRICE** |
| \>slOrderType | string | stop loss trigger place order type
**LIMIT**
**MARKET** |
| \>slOrderPrice | string | stop loss trigger place order price
**LIMIT**
**MARKET**
required if slOrderType is **LIMIT** |
| \>ctime | int64 | create timestamp |
| \>mtime | int64 | latest modify timestamp |
| total | int64 | total count |
Response Example
json
{"code":0,"data":{"orderList":[{"orderId":"11111","qty":"1","tradeQty":"0.5","price":"60000","symbol":"BTCUSDT","positionMode":"HEDGE","marginMode":"ISOLATION","leverage":15,"status":"CANCELED","fee":"0.01","realizedPNL":"1.78","type":"LIMIT","effect":"GTC","reduceOnly":false,"clientId":"22222","tpPrice":"61000","tpStopType":"MARK","tpOrderType":"LIMIT","tpOrderPrice":"61000.1","slPrice":"59000","slStopType":"MARK","slOrderType":"LIMIT","slOrderPrice":"59000.1","source":"api","ctime":1597026383085,"mtime":1597026383085}],"total":10},"msg":"Success"}
---
# OpenApi | Bitunix
[Skip to content](https://www.bitunix.com/api-docs/futures/websocket/private/Balance%20Channel.html#VPContent)
Return to top
### Description [](https://www.bitunix.com/api-docs/futures/websocket/private/Balance%20Channel.html#description)
Balance
### Push Parameters [](https://www.bitunix.com/api-docs/futures/websocket/private/Balance%20Channel.html#push-parameters)
| Parameter | Type | Description |
| --- | --- | --- |
| ch | String | Channel name:position |
| ts | Int64 | Time stamp |
| data |