# API introduction

Welcome to the WEEX broker API. This documentation is tailored for brokers, helping you quickly integrate with the WEEX trading platform to enable automated trading, user management, and commission settlement. New features and updates will be released regularly, stay tuned!

With this guide, you will learn how to:

- Obtain and configure your broker ID
- Verify user commission eligibility
- Link your broker ID when placing orders
- Query commission data and user lists

## Integration setup

### Prerequisites

Have a WEEX account and be enrolled in the WEEX affiliate program.

### API key

- Log in to the WEEX website and go to the "API Management" page.
- Create an API key and configure the following permissions:
    - Read-only
    - Spot
    - Futures
- Keep your secret key secure and never share it.

### Application process

#### Submit your application:
Visit the WEEX website and complete the [broker onboarding form](https://dsg39hlwl5ui.sg.larksuite.com/share/base/form/shrlgfmt5NkSRF2dmjaxXANTfLk).

#### Review process:
The WEEX BD team will review your application within three working days.

#### Get your credentials:
- Once approved, you will receive an email with the following details:
- Unique broker ID (format: WEEX + 6 digits, such as WEEX123456)
- Initial commission rate configuration
- API integration documentation link
- Technical support group invitation


## Verify commission eligibility

Refer to [Get commission eligibility (broker access only)](/products/broker/api/CheckUserEligibility) for more details.

## Linking broker ID when placing orders

### Spot orders

The request structure is the same as the [Spot order (TRADE)](/products/spot/orderApi/PlaceOrder) endpoint. You can include the broker ID when placing an order.

**Format requirements:** <br/>
The newClientOrderId must start with `b-{brokerId}` <br/>
Example: `b-WEEX123456-20260319001`      <br/>
Total length must be ≤ 64 characters                   <br/>
### Futures orders

The request structure is the same as the [order (TRADE)](/products/futures/Transaction_API/PlaceOrder) endpoint. You can link the broker ID using a custom field when placing an order.

**Format requirements:** <br/>
The newClientOrderId must start with `b-{brokerId}` <br/>
Example: `b-WEEX123456-20260319001`      <br/>
Total length must be ≤ 64 characters                   <br/>

## Commission query endpoints

- [Get broker commission data (broker access only)](/products/broker/api/GetBrokerCommissionRecords)
- [Get broker commission rates (broker access only)](/products/broker/api/GetBrokerRebateRatio)

## Rate limits
REST API requests are subject to rate limits. If the limit is exceeded, "429: Too many requests" will be returned.

- Rate limit basis: Endpoints that require an API key are rate-limited by UID. Endpoints without an API key are rate-limited by IP. Each endpoint specifies whether limits are based on IP or UID, along with its request weight. Endpoints have different weights. More resource-intensive endpoints carry higher weights. IP-based and UID-based limits are tracked separately. For IP-based limits, all endpoints share 500 weight/10s. For UID-based limits, all endpoints share 500 weight/10s.
- Rate limit reached: If a 429 response is returned, stop sending requests immediately. Do not abuse the API.

