Bitget APIBitget API
UTAClassic
Legacy Doc
  • Overview
  • API Documentation
  • WebSocket
  • Agent Hub
  • SDK
  • Changelog
Copied to clipboard
Getting Started
Unified Trading AccountQuick StartBest Practices GuiderToken Trading GuideCFD Trading GuideElite Trading API Guide
Broker Integration Guide
    API BrokerFastAPI Integration Guide
Data Download Center
Demo Trading
Rate Limit
API Reference
API DocumentationEnumeration
Error Code
Broker Integration Guide

API Broker

Broker Program Introduction

The Bitget Broker Program aims to establish a comprehensive commission-sharing framework that enables referrers to invite and earn commissions from diverse user segments, covering both new user acquisitions and the expansion of existing users' trading activity on the platform.

Ideal partners include trading bot providers, social trading platforms, open-source trading libraries, trade execution platforms, exchange aggregators, asset management platforms, and quantitative trading platforms and their affiliates.

Through the Broker Program, third-party partners can leverage Bitget's existing exchange infrastructure without needing to build their own or manage matching, clearing, risk control, fund security, or compliance. This allows partners to focus on their core strengths in user acquisition, community operations, and product development while benefiting from Bitget's established trading ecosystem.

This article introduces the Bitget API Broker program, including how to apply, how to obtain your Broker code, how to include the Broker code in REST / WebSocket requests, and which endpoints currently support it.

How to Apply

  1. Contact your Bitget BD (Business Development), or submit an application via the application portal

How to Get Your API Broker Code

  1. Log in to the Affiliate Platform
  2. Open the User Profile
  3. Click Manage Brokers --> Broker overview and copy the Channel API Code in Broker info

Note

If you don't see the Channel API Code option on the page, please contact your BD to enable this feature for you in the Bitget back office.

Integration

REST API

Add the X-CHANNEL-API-CODE header to the HTTP request of supported REST endpoints:

HeaderTypeRequiredDescription
X-CHANNEL-API-CODEStringNoAPI Broker commission identifier
TerminalCode
curl -X POST "https://api.bitget.com/api/v3/trade/place-order" \ -H "ACCESS-KEY: your-api-key" \ -H "ACCESS-SIGN: *******" \ -H "ACCESS-PASSPHRASE: your-passphrase" \ -H "ACCESS-TIMESTAMP: 1750034396082" \ -H "X-CHANNEL-API-CODE: your-Channel-API-Code" \ -H "Content-Type: application/json" \ -d '{"category":"spot","symbol":"BTCUSDT","side":"buy","orderType":"limit","price":"100","qty":"0.1","timeInForce":"gtc"}'
Code
headers = { "ACCESS-KEY": api_key, "ACCESS-SIGN": sign, "ACCESS-PASSPHRASE": passphrase, "ACCESS-TIMESTAMP": timestamp, "X-CHANNEL-API-CODE": "your-Channel-API-Code", "Content-Type": "application/json", } requests.post("https://api.bitget.com/api/v3/trade/place-order", headers=headers, data=body)

Signature

The X-CHANNEL-API-CODE header is not included in the signature calculation; sign the request the same way as a normal request.

WebSocket

WebSocket orders cannot set per-request HTTP headers. Pass apiCode as a top-level field of the order request instead:

ParameterTypeRequiredDescription
apiCodeStringNoAPI Broker code commission identifier
Code
{ "op": "trade", "id": "1750034396082", "category": "spot", "topic": "place-order", "apiCode": "your-Channel-API-Code", "args": [ { "symbol": "BTCUSDT", "orderType": "limit", "side": "buy", "price": "100", "qty": "0.1", "timeInForce": "gtc" } ] }
Code
{ "op": "trade", "apiCode": "your-Channel-API-Code", "args": [ { "id": "xxxxx-xxx-xxx-xxxx-xxxxxx", "instType": "SPOT", "instId": "BTCUSDT", "channel": "place-order", "params": { "orderType": "limit", "side": "buy", "size": "1", "price": "252", "force": "gtc" } } ] }

Endpoints Supporting API Broker Code

The following endpoints support carrying the API Broker code in the request.

Unified Trading Account (UTA)

Permissions

Placing orders with a Unified Trading Account requires the API Key to have Unified Trading Account read-write permission.

TypeEndpointDescriptionHow to pass
RESTPOST /api/v3/trade/place-orderPlace OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v3/trade/place-batchBatch OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v3/trade/place-reality-orderPlace rToken OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v3/trade/close-positionsClose All PositionsAdd header X-CHANNEL-API-CODE
RESTPOST /api/v3/trade/place-strategy-orderPlace Strategy Order (TPSL only)Add header X-CHANNEL-API-CODE
WebSocketplace-orderPlace OrderTop-level field apiCode
WebSocketbatch-placeBatch Place OrderTop-level field apiCode

Classic Account

Permissions

Placing orders with a Classic Account requires the API Key to have Classic Account spot and futures read-write permissions.

TypeEndpointDescriptionHow to pass
RESTPOST /api/v2/spot/trade/place-orderSpot Place OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/spot/trade/batch-ordersSpot Batch Place OrdersAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/spot/trade/cancel-replace-orderSpot Cancel and Replace OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/spot/trade/batch-cancel-replace-orderSpot Batch Cancel and Replace OrdersAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/spot/trade/place-plan-orderSpot Place Plan OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/mix/order/place-orderFutures Place OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/mix/order/batch-place-orderFutures Batch OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/mix/order/click-backhandFutures ReversalAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/mix/order/close-positionsFutures Flash Close PositionAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/mix/order/place-plan-orderFutures Place Trigger OrderAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/mix/order/place-tpsl-orderFutures Stop-profit and Stop-loss Plan OrdersAdd header X-CHANNEL-API-CODE
RESTPOST /api/v2/mix/order/place-pos-tpslFutures Simultaneous Stop-profit and Stop-loss Plan OrdersAdd header X-CHANNEL-API-CODE
WebSocketplace-order (Spot)Spot Place OrderTop-level field apiCode
WebSocketplace-order (Futures)Futures Place OrderTop-level field apiCode

Commission Data

Once orders carry your API Broker code, you can verify commission attribution and data via the following endpoints:

EndpointDescription
GET /api/v2/broker/rebate-infoGet user broker rebate info
GET /api/v2/broker/order-commissionGet broker order commission
GET /api/v2/broker/total-commissionGet broker total commission

FAQ

1. Where can I view commission data?

You can query it programmatically via the Broker Commission APIs listed in "Commission Data" above.

2. When is commission data settled / updated?

T+1. Data is updated around 10:30 AM (UTC+8) on the following day.

3. Will the order fail if an incorrect API Broker code is passed in the header / request?

No, the order will not fail, but the backend will be unable to attribute the commission correctly.

4. How can I tell whether an API Key belongs to a Unified Trading Account or a Classic Account?

If the API Key can call the UTA Get Account Info endpoint and receives a normal response, the account is in Unified Trading Account mode; if it returns error code "40084", the account is in Classic Account mode.

Elite Trading API GuideFastAPI Integration Guide
On this page
  • Broker Program Introduction
  • How to Apply
  • How to Get Your API Broker Code
  • Integration
    • REST API
    • WebSocket
  • Endpoints Supporting API Broker Code
    • Unified Trading Account (UTA)
    • Classic Account
  • Commission Data
  • FAQ
    • 1. Where can I view commission data?
    • 2. When is commission data settled / updated?
    • 3. Will the order fail if an incorrect API Broker code is passed in the header / request?
    • 4. How can I tell whether an API Key belongs to a Unified Trading Account or a Classic Account?
JSON
JSON