# 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](https://www.bitget.com/broker)

## How to Get Your API Broker Code

1. Log in to the [Affiliate Platform](https://newaffiliates.bitget.com/login)
2. Open the [User Profile](https://newaffiliates.bitget.com/dashboard/panel-board)
3. Click **Manage Brokers** --> **Broker overview** and copy the `Channel API Code` in **Broker info**

:::tip{title="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:

| Header | Type | Required | Description |
|:-------|:-----|:---------|:------------|
| X-CHANNEL-API-CODE | String | No | API Broker commission identifier |

```bash title="Request example (UTA place order)"
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"}'
```

```python title="Request example (Python)"
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)
```

:::tip{title="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:

| Parameter | Type | Required | Description |
|:----------|:-----|:---------|:------------|
| apiCode | String | No | API Broker code commission identifier |

```json title="Request example (UTA WebSocket place order)"
{
  "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"
    }
  ]
}
```

```json title="Request example (Classic WebSocket spot place order)"
{
  "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)

:::tip{title="Permissions"}
Placing orders with a Unified Trading Account requires the API Key to have Unified Trading Account read-write permission.
:::

| Type | Endpoint | Description | How to pass |
|:-----|:---------|:------------|:------------|
| REST | `POST /api/v3/trade/place-order` | [Place Order](/docs/catalog/trading/order-management#place-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v3/trade/place-batch` | [Batch Order](/docs/catalog/trading/order-management#batch-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v3/trade/place-reality-order` | [Place rToken Order](/docs/catalog/reality/trading#place-reality-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v3/trade/close-positions` | [Close All Positions](/docs/catalog/trading/position-management#close-all-positions) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v3/trade/place-strategy-order` | [Place Strategy Order (TPSL only)](/docs/catalog/trading/strategy-trading#place-strategy-order) | Add header `X-CHANNEL-API-CODE` |
| WebSocket | `place-order` | [Place Order](/docs/uta/websocket/private/Place-Order-Channel) | Top-level field `apiCode` |
| WebSocket | `batch-place` | [Batch Place Order](/docs/uta/websocket/private/Batch-Place-Order-Channel) | Top-level field `apiCode` |

### Classic Account

:::tip{title="Permissions"}
Placing orders with a Classic Account requires the API Key to have Classic Account spot and futures read-write permissions.
:::

| Type | Endpoint | Description | How to pass |
|:-----|:---------|:------------|:------------|
| REST | `POST /api/v2/spot/trade/place-order` | [Spot Place Order](/docs/catalog/classic-spot-trade/classic-spot-trade#place-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/spot/trade/batch-orders` | [Spot Batch Place Orders](/docs/catalog/classic-spot-trade/classic-spot-trade#batch-place-orders) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/spot/trade/cancel-replace-order` | [Spot Cancel and Replace Order](/docs/catalog/classic-spot-trade/classic-spot-trade#cancel-an-existing-order-and-send-a-new-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/spot/trade/batch-cancel-replace-order` | [Spot Batch Cancel and Replace Orders](/docs/catalog/classic-spot-trade/classic-spot-trade#batch-cancel-existing-order-and-send-new-orders) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/spot/trade/place-plan-order` | [Spot Place Plan Order](/docs/catalog/classic-spot-plan/classic-spot-plan#place-plan-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/mix/order/place-order` | [Futures Place Order](/docs/catalog/classic-contract-trade/classic-contract-trade#place-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/mix/order/batch-place-order` | [Futures Batch Order](/docs/catalog/classic-contract-trade/classic-contract-trade#batch-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/mix/order/click-backhand` | [Futures Reversal](/docs/catalog/classic-contract-trade/classic-contract-trade#reversal) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/mix/order/close-positions` | [Futures Flash Close Position](/docs/catalog/classic-contract-trade/classic-contract-trade#flash-close-position) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/mix/order/place-plan-order` | [Futures Place Trigger Order](/docs/catalog/classic-contract-plan/classic-contract-plan#place-trigger-order) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/mix/order/place-tpsl-order` | [Futures Stop-profit and Stop-loss Plan Orders](/docs/catalog/classic-contract-plan/classic-contract-plan#stop-profit-and-stop-loss-plan-orders) | Add header `X-CHANNEL-API-CODE` |
| REST | `POST /api/v2/mix/order/place-pos-tpsl` | [Futures Simultaneous Stop-profit and Stop-loss Plan Orders](/docs/catalog/classic-contract-plan/classic-contract-plan#simultaneous-stop-profit-and-stop-loss-plan-orders) | Add header `X-CHANNEL-API-CODE` |
| WebSocket | `place-order` (Spot) | [Spot Place Order](/docs/classic/websocket/spot/private/Place-Order-Channel) | Top-level field `apiCode` |
| WebSocket | `place-order` (Futures) | [Futures Place Order](/docs/classic/websocket/contract/private/Place-Order-Channel) | Top-level field `apiCode` |

## Commission Data

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

| Endpoint | Description |
|:---------|:------------|
| `GET /api/v2/broker/rebate-info` | [Get user broker rebate info](/docs/catalog/classic-broker-commission) |
| `GET /api/v2/broker/order-commission` | [Get broker order commission](/docs/catalog/classic-broker-commission) |
| `GET /api/v2/broker/total-commission` | [Get broker total commission](/docs/catalog/classic-broker-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](/docs/catalog/account/account-settings#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.
