All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| agencyTransactionHistory | GET /rebate/agency/transaction_history | Broker obtains transaction history of recommended users |
| agencyCommissionsHistory | GET /rebate/agency/commission_history | Broker obtains rebate history of recommended users |
| partnerTransactionHistory | GET /rebate/partner/transaction_history | Partner obtains transaction history of recommended users |
| partnerCommissionsHistory | GET /rebate/partner/commission_history | Partner obtains rebate records of recommended users |
| partnerSubList | GET /rebate/partner/sub_list | Partner subordinate list |
| rebateBrokerCommissionHistory | GET /rebate/broker/commission_history | Broker obtains user's rebate records |
| rebateBrokerTransactionHistory | GET /rebate/broker/transaction_history | Broker obtains user's trading history |
| rebateUserInfo | GET /rebate/user/info | User obtains rebate information |
| userSubRelation | GET /rebate/user/sub_relation | User subordinate relationship |
| getPartnerApplicationRecent | GET /rebate/partner/applications/recent | Get recent partner application records |
| getPartnerEligibility | GET /rebate/partner/eligibility | Check partner application eligibility |
| getPartnerAgentDataAggregated | GET /rebate/partner/data/aggregated | Aggregated partner agent statistics |
Promise<{ response: http.IncomingMessage; body: Array; }> agencyTransactionHistory(opts)
Broker obtains transaction history of recommended users
Record query time range cannot exceed 30 days
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const opts = {
'currencyPair': "BTC_USDT", // string | Specify the trading pair. If not specified, returns all trading pairs
'userId': 10003, // number | User ID. If not specified, all user records will be returned
'from': 1602120000, // number | Start time for querying records. If not specified, defaults to 7 days before current time
'to': 1602123600, // number | End timestamp for the query, defaults to current time if not specified
'limit': 100, // number | Maximum number of records returned in a single list
'offset': 0 // number | List offset, starting from 0
};
api.agencyTransactionHistory(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currencyPair | string | Specify the trading pair. If not specified, returns all trading pairs | [optional] [default to undefined] |
| userId | number | User ID. If not specified, all user records will be returned | [optional] [default to undefined] |
| from | number | Start time for querying records. If not specified, defaults to 7 days before current time | [optional] [default to undefined] |
| to | number | End timestamp for the query, defaults to current time if not specified | [optional] [default to undefined] |
| limit | number | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | number | List offset, starting from 0 | [optional] [default to 0] |
Promise<{ response: AxiosResponse; body: Array; }> AgencyTransactionHistory
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> agencyCommissionsHistory(opts)
Broker obtains rebate history of recommended users
Record query time range cannot exceed 30 days
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const opts = {
'currency': "BTC", // string | Specify the currency. If not specified, returns all currencies
'commissionType': 1, // number | Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate
'userId': 10003, // number | User ID. If not specified, all user records will be returned
'from': 1602120000, // number | Start time for querying records. If not specified, defaults to 7 days before current time
'to': 1602123600, // number | End timestamp for the query, defaults to current time if not specified
'limit': 100, // number | Maximum number of records returned in a single list
'offset': 0 // number | List offset, starting from 0
};
api.agencyCommissionsHistory(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currency | string | Specify the currency. If not specified, returns all currencies | [optional] [default to undefined] |
| commissionType | number | Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate | [optional] [default to undefined] |
| userId | number | User ID. If not specified, all user records will be returned | [optional] [default to undefined] |
| from | number | Start time for querying records. If not specified, defaults to 7 days before current time | [optional] [default to undefined] |
| to | number | End timestamp for the query, defaults to current time if not specified | [optional] [default to undefined] |
| limit | number | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | number | List offset, starting from 0 | [optional] [default to 0] |
Promise<{ response: AxiosResponse; body: Array; }> AgencyCommissionHistory
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: PartnerTransactionHistory; }> partnerTransactionHistory(opts)
Partner obtains transaction history of recommended users
Record query time range cannot exceed 30 days
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const opts = {
'currencyPair': "BTC_USDT", // string | Specify the trading pair. If not specified, returns all trading pairs
'userId': 10003, // number | User ID. If not specified, all user records will be returned
'from': 1602120000, // number | Start time for querying records. If not specified, defaults to 7 days before current time
'to': 1602123600, // number | End timestamp for the query, defaults to current time if not specified
'limit': 100, // number | Maximum number of records returned in a single list
'offset': 0 // number | List offset, starting from 0
};
api.partnerTransactionHistory(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currencyPair | string | Specify the trading pair. If not specified, returns all trading pairs | [optional] [default to undefined] |
| userId | number | User ID. If not specified, all user records will be returned | [optional] [default to undefined] |
| from | number | Start time for querying records. If not specified, defaults to 7 days before current time | [optional] [default to undefined] |
| to | number | End timestamp for the query, defaults to current time if not specified | [optional] [default to undefined] |
| limit | number | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | number | List offset, starting from 0 | [optional] [default to 0] |
Promise<{ response: AxiosResponse; body: PartnerTransactionHistory; }> PartnerTransactionHistory
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: PartnerCommissionHistory; }> partnerCommissionsHistory(opts)
Partner obtains rebate records of recommended users
Record query time range cannot exceed 30 days
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const opts = {
'currency': "BTC", // string | Specify the currency. If not specified, returns all currencies
'userId': 10003, // number | User ID. If not specified, all user records will be returned
'from': 1602120000, // number | Start time for querying records. If not specified, defaults to 7 days before current time
'to': 1602123600, // number | End timestamp for the query, defaults to current time if not specified
'limit': 100, // number | Maximum number of records returned in a single list
'offset': 0 // number | List offset, starting from 0
};
api.partnerCommissionsHistory(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currency | string | Specify the currency. If not specified, returns all currencies | [optional] [default to undefined] |
| userId | number | User ID. If not specified, all user records will be returned | [optional] [default to undefined] |
| from | number | Start time for querying records. If not specified, defaults to 7 days before current time | [optional] [default to undefined] |
| to | number | End timestamp for the query, defaults to current time if not specified | [optional] [default to undefined] |
| limit | number | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | number | List offset, starting from 0 | [optional] [default to 0] |
Promise<{ response: AxiosResponse; body: PartnerCommissionHistory; }> PartnerCommissionHistory
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: PartnerSubList; }> partnerSubList(opts)
Partner subordinate list
Including sub-agents, direct customers, and indirect customers
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const opts = {
'userId': 10003, // number | User ID. If not specified, all user records will be returned
'limit': 100, // number | Maximum number of records returned in a single list
'offset': 0 // number | List offset, starting from 0
};
api.partnerSubList(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | User ID. If not specified, all user records will be returned | [optional] [default to undefined] |
| limit | number | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | number | List offset, starting from 0 | [optional] [default to 0] |
Promise<{ response: AxiosResponse; body: PartnerSubList; }> PartnerSubList
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> rebateBrokerCommissionHistory(opts)
Broker obtains user's rebate records
Record query time range cannot exceed 30 days
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const opts = {
'limit': 100, // number | Maximum number of records returned in a single list
'offset': 0, // number | List offset, starting from 0
'userId': 10003, // number | User ID. If not specified, all user records will be returned
'from': 1711929600, // number | Start time of the query record. If not specified, defaults to 30 days before the current time
'to': 1714521600 // number | End timestamp for the query, defaults to current time if not specified
};
api.rebateBrokerCommissionHistory(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| limit | number | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | number | List offset, starting from 0 | [optional] [default to 0] |
| userId | number | User ID. If not specified, all user records will be returned | [optional] [default to undefined] |
| from | number | Start time of the query record. If not specified, defaults to 30 days before the current time | [optional] [default to undefined] |
| to | number | End timestamp for the query, defaults to current time if not specified | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> BrokerCommission
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> rebateBrokerTransactionHistory(opts)
Broker obtains user's trading history
Record query time range cannot exceed 30 days
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const opts = {
'limit': 100, // number | Maximum number of records returned in a single list
'offset': 0, // number | List offset, starting from 0
'userId': 10003, // number | User ID. If not specified, all user records will be returned
'from': 1711929600, // number | Start time of the query record. If not specified, defaults to 30 days before the current time
'to': 1714521600 // number | End timestamp for the query, defaults to current time if not specified
};
api.rebateBrokerTransactionHistory(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| limit | number | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | number | List offset, starting from 0 | [optional] [default to 0] |
| userId | number | User ID. If not specified, all user records will be returned | [optional] [default to undefined] |
| from | number | Start time of the query record. If not specified, defaults to 30 days before the current time | [optional] [default to undefined] |
| to | number | End timestamp for the query, defaults to current time if not specified | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> BrokerTransactionHistory
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> rebateUserInfo()
User obtains rebate information
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
api.rebateUserInfo()
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));This endpoint does not need any parameter.
Promise<{ response: AxiosResponse; body: Array; }> RebateUserInfo
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: UserSubRelation; }> userSubRelation(userIdList)
User subordinate relationship
Query whether the specified user is within the system
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const userIdList = "1, 2, 3"; // string | Query user ID list, separated by commas. If more than 100, only 100 will be returned
api.userSubRelation(userIdList)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userIdList | string | Query user ID list, separated by commas. If more than 100, only 100 will be returned | [default to undefined] |
Promise<{ response: AxiosResponse; body: UserSubRelation; }> UserSubRelation
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: PartnerApplicationResponse; }> getPartnerApplicationRecent()
Get recent partner application records
获取当前用户最近的合伙人申请记录。 此接口返回用户最近 30 天内的申请记录,包括申请状态、审核信息、申请材料等详细信息。
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
api.getPartnerApplicationRecent()
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));This endpoint does not need any parameter.
Promise<{ response: AxiosResponse; body: PartnerApplicationResponse; }> PartnerApplicationResponse
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: EligibilityResponse; }> getPartnerEligibility()
Check partner application eligibility
检查当前用户是否有资格申请成为合伙人。 此接口会检查多个条件: - 账户状态(是否被封禁) - 是否为子账号 - 是否已经是合伙人 - KYC 认证状态 - 是否在其他代理商的邀请链下 - 是否在黑名单中 - 其他业务规则限制
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
api.getPartnerEligibility()
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));This endpoint does not need any parameter.
Promise<{ response: AxiosResponse; body: EligibilityResponse; }> EligibilityResponse
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: PartnerDataAggregatedResponse; }> getPartnerAgentDataAggregated(opts)
Aggregated partner agent statistics
查询指定时间范围内合伙人代理的数据聚合统计,包括返佣金额、交易量、净手续费、客户数和交易人数。 注意事项: - 交易人数 `trading_user_count` 仅在 `business_type=0`(全部)时返回 - 时间参数使用 UTC+8 时区 - 如不传时间参数,默认查询近 7 天数据 - 仅限合伙人代理访问,子账号无权限
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.RebateApi(client);
const opts = {
'startDate': "2024-01-01 00:00:00", // string | 查询开始时间,格式:yyyy-mm-dd hh:ii:ss(UTC+8) 不传时默认为近 7 日开始时间
'endDate': "2024-01-07 23:59:59", // string | 查询结束时间,格式:yyyy-mm-dd hh:ii:ss(UTC+8) 不传时默认为近 7 日结束时间
'businessType': 0 // 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Business type filter: - 0: All (default) - 1: Spot - 2: Futures - 3: Alpha - 4: Web3 - 5: Perps (DEX) - 6: Exchange All - 7: Web3 All - 8: TradFi
};
api.getPartnerAgentDataAggregated(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| startDate | string | 查询开始时间,格式:yyyy-mm-dd hh:ii:ss(UTC+8) 不传时默认为近 7 日开始时间 | [optional] [default to undefined] |
| endDate | string | 查询结束时间,格式:yyyy-mm-dd hh:ii:ss(UTC+8) 不传时默认为近 7 日结束时间 | [optional] [default to undefined] |
| businessType | BusinessType | Business type filter: - 0: All (default) - 1: Spot - 2: Futures - 3: Alpha - 4: Web3 - 5: Perps (DEX) - 6: Exchange All - 7: Web3 All - 8: TradFi | [optional] [default to 0] |
Promise<{ response: AxiosResponse; body: PartnerDataAggregatedResponse; }> PartnerDataAggregatedResponse
- Content-Type: Not defined
- Accept: application/json