Loading...
Loading...
Compare original and translation side by side
exchange-runtime-rules.mdexchange-runtime-rules.mdX-Gate-User-Idcommission_historytransaction_historyuser_idtoX-Gate-User-Idcommission_historytransaction_historyuser_id| API Endpoint | Description | Time Limit |
|---|---|---|
| Get referred users' trading records | ≤30 days per request |
| Get referred users' commission records | ≤30 days per request |
| Get subordinate list (for customer count) | No time parameter |
| Check if user is eligible to apply for partner | No time parameter |
| Get user's recent partner application record (last 30 days) | No time parameter |
/rebate/agency/*| API端点 | 描述 | 时间限制 |
|---|---|---|
| 获取推荐用户的交易记录 | 单次请求≤30天 |
| 获取推荐用户的佣金记录 | 单次请求≤30天 |
| 获取下属列表(用于统计客户数量) | 无时间参数 |
| 检查用户是否符合伙伴计划申请条件 | 无时间参数 |
| 获取用户近期的伙伴计划申请记录(过去30天内) | 无时间参数 |
/rebate/agency/*user_iduser_idcommission_historytransaction_historyuser_iduser_idcommission_historytransaction_historyuser_iduser_idtouser_iduser_iduser_iduser_idcommission_historytransaction_historytransaction_historysub_listtransaction_historycommission_historytransaction_historytransaction_historysub_listtransaction_historyeligibleblock_reasonsblock_reason_codeseligibleblock_reasonsblock_reason_codesquery_typetime_rangemetricuser_idquery_typetime_rangemetricuser_idneeds_splittingsegmentserrorneeds_splittingsegmentserrorcex_rebate_partner_transaction_historycex_rebate_partner_commissions_historycex_rebate_partner_sub_listcex_rebate_get_partner_eligibilitycex_rebate_get_partner_application_recentuser_iduser_id/rebate/partner/transaction_history/rebate/partner/commission_history/rebate/partner/sub_listuser_idGET /rebate/partner/eligibilityGET /rebate/partner/applications/recenttransactionscommissionssubordinatestotal_counteligibilityapplication_recentcex_rebate_partner_transaction_historycex_rebate_partner_commissions_historycex_rebate_partner_sub_listcex_rebate_get_partner_eligibilitycex_rebate_get_partner_application_recent/rebate/partner/transaction_history/rebate/partner/commission_history/rebate/partner/sub_listuser_idGET /rebate/partner/eligibilityGET /rebate/partner/applications/recenttransactionscommissionssubordinatestotal_counteligibilityapplication_recenttotal > limitall_datapages_fetchedtotal > limitall_datapages_fetchedcommission_amounttrading_volumenet_feescustomer_counttrading_userscommission_amounttrading_volumenet_feescustomer_counttrading_users| Condition | Status | Action |
|---|---|---|
| Query type = overview | ✅ | Use default 7 days, call all 3 APIs |
| Query type = time_specific | ✅ | Parse time range, check if splitting needed |
| Query type = metric_specific | ✅ | Call only required API(s) for the metric |
| Query type = user_specific | ✅ | Add user_id filter to API calls (NOTE: user_id = trader, not receiver) |
| Query type = team_report | ✅ | Call all APIs, generate comprehensive report |
| Query type = application | ✅ | Return application guidance; optionally call eligibility or applications/recent when user asks "can I apply?" or "my application status?" |
| Query type = application_eligibility | ✅ | Call GET /rebate/partner/eligibility, return eligible status and block_reasons |
| Query type = application_status | ✅ | Call GET /rebate/partner/applications/recent, return recent application record and audit_status |
| Time range ≤30 days | ✅ | Single API call per endpoint |
| Time range >30 days and ≤180 days | ✅ | Split into multiple 30-day segments |
| Time range >180 days | ❌ | Return error "Only supports queries within last 180 days" |
| Relative time description (e.g., "last 7 days") | ✅ | Calculate from current UTC+8 date, convert to 00:00:00-23:59:59 UTC+8, then to Unix timestamps |
| User specifies future date | ❌ | Reject query - only historical data available |
| ❌ | Reject query - adjust to current time or earlier |
| API returns 403 | ❌ | Return "No affiliate privileges" error |
| API returns empty data | ⚠️ | Show metrics as 0, not error |
| Total > limit in response | ✅ | Implement pagination |
| User_id not in sub_list | ❌ | Return "User not in referral network" |
| Invalid UID format | ❌ | Return format error message |
| User asks for "my commission" | ✅ | DO NOT use user_id parameter - query all commissions |
| User specifies trader UID | ✅ | Use user_id parameter to filter by that trader |
| 条件 | 状态 | 操作 |
|---|---|---|
| 查询类型 = 概览 | ✅ | 使用默认7天时间段,调用全部3个API |
| 查询类型 = 特定时间段 | ✅ | 解析时间范围,判断是否需要拆分查询 |
| 查询类型 = 特定指标 | ✅ | 仅调用该指标所需的API |
| 查询类型 = 特定用户 | ✅ | 在API调用中添加user_id筛选条件(注意:user_id指交易者,而非佣金接收者) |
| 查询类型 = 团队报告 | ✅ | 调用全部API,生成综合报告 |
| 查询类型 = 申请 | ✅ | 返回申请指导;若用户询问“我能申请吗?”或“我的申请状态?”,可调用资格验证或近期申请API |
| 查询类型 = 申请资格 | ✅ | 调用GET /rebate/partner/eligibility,返回资格状态和限制原因 |
| 查询类型 = 申请状态 | ✅ | 调用GET /rebate/partner/applications/recent,返回近期申请记录和审核状态 |
| 时间范围 ≤30天 | ✅ | 每个端点单次API调用 |
| 时间范围 >30天且 ≤180天 | ✅ | 拆分为多个30天的时间段 |
| 时间范围 >180天 | ❌ | 返回错误信息“仅支持过去180天内的数据查询” |
| 相对时间描述(如“过去7天”) | ✅ | 从当前UTC+8日期计算,转换为UTC+8时区的00:00:00-23:59:59,再转换为Unix时间戳 |
| 用户指定未来日期 | ❌ | 拒绝查询 - 仅支持历史数据 |
| ❌ | 拒绝查询 - 调整为当前时间或更早 |
| API返回403错误 | ❌ | 返回错误信息“无联盟伙伴权限” |
| API返回空数据 | ⚠️ | 指标值显示为0,而非错误 |
| 返回结果中total > limit | ✅ | 实现分页逻辑 |
| user_id不在sub_list中 | ❌ | 返回错误信息“该用户不在您的推荐网络中” |
| UID格式无效 | ❌ | 返回格式错误信息 |
| 用户询问“我的佣金” | ✅ | 请勿使用user_id参数 - 查询全部佣金数据 |
| 用户指定交易者UID | ✅ | 使用user_id参数筛选该交易者的数据 |
undefinedundefined| Metric | Value |
|---|---|
| Commission Amount | {commission_amount} USDT |
| Trading Volume | {trading_volume} USDT |
| Net Fees | {net_fees} USDT |
| Customer Count | {customer_count} |
| Trading Users | {trading_users} |
| 指标 | 数值 |
|---|---|
| 佣金金额 | {commission_amount} USDT |
| 交易量 | {trading_volume} USDT |
| 净手续费 | {net_fees} USDT |
| 客户数量 | {customer_count} |
| 交易用户数 | {trading_users} |
undefinedundefinedYour affiliate data overview (last 7 days):
- Commission Amount: XXX USDT
- Trading Volume: XXX USDT
- Net Fees: XXX USDT
- Customer Count: XXX
- Trading Users: XXX
For detailed data, visit the affiliate dashboard: {dashboard_url}您的联盟伙伴数据概览(过去7天):
- 佣金金额:XXX USDT
- 交易量:XXX USDT
- 净手续费:XXX USDT
- 客户数量:XXX
- 交易用户数:XXX
如需查看详细数据,请访问联盟伙伴仪表盘:{dashboard_url}Example: User requests 60 days (2026-01-01 to 2026-03-01 in UTC+8)
Convert to UTC+8 00:00:00 and 23:59:59, then to Unix timestamps:
1. 2026-01-01 00:00:00 UTC+8 to 2026-01-31 23:59:59 UTC+8 (31 days -> adjust to 30)
2. 2026-01-31 00:00:00 UTC+8 to 2026-03-01 23:59:59 UTC+8 (29 days)
Call each segment separately with converted timestamps, then merge results.Your affiliate data for {time_range}:
- Commission Amount: XXX USDT
- Trading Volume: XXX USDT
- Net Fees: XXX USDT
- Customer Count: XXX
- Trading Users: XXX示例:用户请求60天的数据(UTC+8时区2026-01-01至2026-03-01)
转换为UTC+8时区的00:00:00和23:59:59,再转换为Unix时间戳:
1. 2026-01-01 00:00:00 UTC+8 至 2026-01-31 23:59:59 UTC+8(31天 → 调整为30天)
2. 2026-01-31 00:00:00 UTC+8 至 2026-03-01 23:59:59 UTC+8(29天)
分别调用每个时间段的转换后的时间戳,然后合并结果。您的联盟伙伴数据({time_range}):
- 佣金金额:XXX USDT
- 交易量:XXX USDT
- 净手续费:XXX USDT
- 客户数量:XXX
- 交易用户数:XXXYour {metric_name} for the last 7 days: XXX {unit}
For detailed data, visit the affiliate dashboard: {dashboard_url}您的{metric_name}(过去7天):XXX {unit}
如需查看详细数据,请访问联盟伙伴仪表盘:{dashboard_url}user_idUID {user_id} contribution (last 7 days):
- Commission Amount: XXX USDT (commission generated from this trader's activity)
- Trading Volume: XXX USDT (this trader's trading volume)
- Fees: XXX USDT (fees from this trader's trades)user_idUID {user_id}的贡献(过去7天):
- 佣金金额:XXX USDT(该交易者的交易活动产生的佣金)
- 交易量:XXX USDT(该交易者的交易量)
- 手续费:XXX USDT(该交易者的交易产生的手续费)sub_listtransaction_historycommission_history=== Team Performance Report ({time_range}) ===
📊 Team Overview
- Total Members: XXX (Sub-agents: X, Direct: X, Indirect: X)
- Active Users: XXX (XX.X%)
- New Members: XXX
💰 Trading Data
- Total Volume: XXX,XXX.XX USDT
- Total Fees: X,XXX.XX USDT
- Average Volume per User: XX,XXX.XX USDT
🏆 Commission Data
- Total Commission: XXX.XX USDT
- Spot Commission: XXX.XX USDT (XX%)
- Futures Commission: XXX.XX USDT (XX%)
👑 Top 5 Contributors
1. UID XXXXX - Volume XXX,XXX USDT / Commission XX.X USDT
2. ...sub_listtransaction_historycommission_history=== 团队业绩报告 ({time_range}) ===
📊 团队概览
- 总成员数:XXX(子代理:X,直接客户:X,间接客户:X)
- 活跃用户数:XXX(占比XX.X%)
- 新成员数:XXX
💰 交易数据
- 总交易量:XXX,XXX.XX USDT
- 总手续费:X,XXX.XX USDT
- 人均交易量:XX,XXX.XX USDT
🏆 佣金数据
- 总佣金:XXX.XX USDT
- 现货佣金:XXX.XX USDT(占比XX%)
- 期货佣金:XXX.XX USDT(占比XX%)
👑 顶级5位贡献者
1. UID XXXXX - 交易量XXX,XXX USDT / 佣金XX.X USDT
2. ...GET /rebate/partner/eligibilityGET /rebate/partner/applications/recentEligibility check: {eligible ? "You are eligible to apply." : "You are not eligible at this time."}
{If not eligible:}
Block reasons: {block_reasons}
Please address the above before applying.
Application Portal: https://www.gate.com/referral/affiliateYour recent partner application (last 30 days):
Status: {audit_status: 0=Pending, 1=Approved, 2=Rejected}
{apply_msg}
{jump_url if provided}You can apply to become a Gate Exchange affiliate and earn commission from referred users' trading.
Application Process:
1. Open the affiliate application page
2. Fill in application information
3. Submit application
4. Wait for platform review
Application Portal: https://www.gate.com/referral/affiliate
Benefits:
- Earn commission from referred users
- Access to marketing materials
- Dedicated support team
- Performance analytics dashboardGET /rebate/partner/eligibilityGET /rebate/partner/applications/recent资格验证结果:{eligible ? "您符合申请条件。" : "您目前不符合申请条件。"}
{若不符合条件:}
限制原因:{block_reasons}
请解决上述问题后再提交申请。
申请门户:https://www.gate.com/referral/affiliate您的近期伙伴计划申请(过去30天内):
状态:{audit_status: 0=待审核, 1=已通过, 2=已拒绝}
{apply_msg}
{若有jump_url则显示}您可以申请成为Gate Exchange联盟伙伴,从推荐用户的交易活动中赚取佣金。
申请流程:
1. 打开联盟伙伴申请页面
2. 填写申请信息
3. 提交申请
4. 等待平台审核
申请门户:https://www.gate.com/referral/affiliate
权益:
- 从推荐用户的交易中赚取佣金
- 获取营销素材
- 专属支持团队
- 业绩分析仪表盘Your account does not have affiliate privileges.
To become an affiliate, please apply at: https://www.gate.com/referral/affiliate您的账户无联盟伙伴权限。
如需成为联盟伙伴,请访问:https://www.gate.com/referral/affiliate 提交申请Query supports maximum 180 days of historical data.
Please adjust your time range.查询仅支持最长180天的历史数据。
请调整您的时间范围。No data found for the specified time range.
Please check if you have referred users with trading activity during this period.指定时间范围内未找到数据。
请检查您是否有推荐用户在该时间段内有交易活动。UID {user_id} not found in your referral network.
Please verify the user ID.UID {user_id}未在您的推荐网络中找到。
请验证用户ID是否正确。UID {user_id} is not part of your referral network.
You can only query data for users you've referred.UID {user_id}不属于您的推荐网络。
您仅可查询您推荐的用户的数据。Sub-accounts cannot query affiliate data.
Please use your main account.子账户无法查询联盟伙伴数据。
请使用主账户操作。Parameters:
- currency_pair: string (optional) - e.g., "BTC_USDT"
- user_id: integer (optional) - IMPORTANT: This is the TRADER's ID, not commission receiver
- from: integer (required) - start timestamp (unix seconds)
- to: integer (required) - end timestamp (unix seconds)
- limit: integer (default 100) - max records per page
- offset: integer (default 0) - pagination offset
Response: {
total: number,
list: [{
transaction_time, user_id (trader), group_name,
fee, fee_asset, currency_pair,
amount, amount_asset, source
}]
}参数:
- currency_pair:字符串(可选) - 示例:"BTC_USDT"
- user_id:整数(可选) - 重要提示:该参数指的是交易者ID,而非佣金接收者
- from:整数(必填) - 起始时间戳(Unix秒)
- to:整数(必填) - 结束时间戳(Unix秒)
- limit:整数(默认100) - 每页最大记录数
- offset:整数(默认0) - 分页偏移量
响应:{
total: 数字,
list: [{
transaction_time, user_id (交易者), group_name,
fee, fee_asset, currency_pair,
amount, amount_asset, source
}]
}Parameters:
- currency: string (optional) - e.g., "USDT"
- user_id: integer (optional) - IMPORTANT: This is the TRADER's ID who generated the commission
- from: integer (required) - start timestamp
- to: integer (required) - end timestamp
- limit: integer (default 100)
- offset: integer (default 0)
Response: {
total: number,
list: [{
commission_time, user_id (trader), group_name,
commission_amount, commission_asset, source
}]
}参数:
- currency:字符串(可选) - 示例:"USDT"
- user_id:整数(可选) - 重要提示:该参数指的是产生佣金的交易者ID
- from:整数(必填) - 起始时间戳
- to:整数(必填) - 结束时间戳
- limit:整数(默认100)
- offset:整数(默认0)
响应:{
total: 数字,
list: [{
commission_time, user_id (交易者), group_name,
commission_amount, commission_asset, source
}]
}Parameters:
- user_id: integer (optional) - filter by user ID
- limit: integer (default 100)
- offset: integer (default 0)
Response: {
total: number,
list: [{
user_id, user_join_time, type
}]
}
Type: 1=Sub-agent, 2=Indirect customer, 3=Direct customer参数:
- user_id:整数(可选) - 按用户ID筛选
- limit:整数(默认100)
- offset:整数(默认0)
响应:{
total: 数字,
list: [{
user_id, user_join_time, type
}]
}
类型:1=子代理, 2=间接客户, 3=直接客户GET /rebate/partner/eligibility
Parameters: none (uses authenticated user)
Response: {
data: {
eligible: boolean,
block_reasons: string[],
block_reason_codes: string[]
}
}
block_reason_codes may include: user_not_exist, user_blacked, sub_account, already_agent, kyc_incomplete, in_agent_tree, ch_code_conflictGET /rebate/partner/eligibility
参数:无(使用已通过身份验证的用户)
响应:{
data: {
eligible: 布尔值,
block_reasons: 字符串数组,
block_reason_codes: 字符串数组
}
}
block_reason_codes可能包括:user_not_exist, user_blacked, sub_account, already_agent, kyc_incomplete, in_agent_tree, ch_code_conflictGET /rebate/partner/applications/recent
Parameters: none (returns current user's recent application in last 30 days)
Response: {
data: {
id, uid, audit_status, apply_msg, create_timest, update_timest,
proof_url, jump_url, proof_images_url_list, ...
} or empty
}
audit_status: 0=Pending, 1=Approved, 2=RejectedGET /rebate/partner/applications/recent
参数:无(返回当前用户过去30天内的近期申请)
响应:{
data: {
id, uid, audit_status, apply_msg, create_timest, update_timest,
proof_url, jump_url, proof_images_url_list, ...
} 或空值
}
audit_status: 0=待审核, 1=已通过, 2=已拒绝offset = 0
all_data = []
while True:
result = call_api(limit=100, offset=offset)
all_data.extend(result['list'])
if len(result['list']) < 100 or offset + 100 >= result['total']:
break
offset += 100offset = 0
all_data = []
while True:
result = call_api(limit=100, offset=offset)
all_data.extend(result['list'])
if len(result['list']) < 100 or offset + 100 >= result['total']:
break
offset += 100undefinedundefinedtotool_name| API / Use case | MCP tool name |
|---|---|
| Transaction history | |
| Commission history | |
| Subordinate list | |
| Eligibility check | |
| Recent application | |
tool_name| API / 用例 | MCP工具名称 |
|---|---|
| 交易历史 | |
| 佣金历史 | |
| 下属列表 | |
| 资格验证 | |
| 近期申请 | |