Skip to content

Latest commit

 

History

History
627 lines (436 loc) · 25.5 KB

RebateApi.md

File metadata and controls

627 lines (436 loc) · 25.5 KB

RebateApi

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

agencyTransactionHistory

Promise<{ response: http.IncomingMessage; body: AgencyTransactionHistory; }> agencyTransactionHistory(opts)

Broker obtains transaction history of recommended users

Record query time range cannot exceed 30 days

Example

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': BigInt('10003'), // number | User ID. If not specified, all user records will be returned
  'from': BigInt('1602120000'), // number | Start time for querying records. If not specified, defaults to 7 days before current time
  'to': BigInt('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));

Parameters

Name Type Description Notes
currencyPair string Specify the trading pair. If not specified, returns all trading pairs [optional] [default to undefined]
userId number | bigint User ID. If not specified, all user records will be returned [optional] [default to undefined]
from number | bigint Start time for querying records. If not specified, defaults to 7 days before current time [optional] [default to undefined]
to number | bigint 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]

Return type

Promise<{ response: AxiosResponse; body: AgencyTransactionHistory; }> AgencyTransactionHistory

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

agencyCommissionsHistory

Promise<{ response: http.IncomingMessage; body: AgencyCommissionHistory; }> agencyCommissionsHistory(opts)

Broker obtains rebate history of recommended users

Record query time range cannot exceed 30 days

Example

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': BigInt('10003'), // number | User ID. If not specified, all user records will be returned
  'from': BigInt('1602120000'), // number | Start time for querying records. If not specified, defaults to 7 days before current time
  'to': BigInt('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));

Parameters

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 | bigint User ID. If not specified, all user records will be returned [optional] [default to undefined]
from number | bigint Start time for querying records. If not specified, defaults to 7 days before current time [optional] [default to undefined]
to number | bigint 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]

Return type

Promise<{ response: AxiosResponse; body: AgencyCommissionHistory; }> AgencyCommissionHistory

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

partnerTransactionHistory

Promise<{ response: http.IncomingMessage; body: PartnerTransactionHistory; }> partnerTransactionHistory(opts)

Partner obtains transaction history of recommended users

Record query time range cannot exceed 30 days

Example

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': BigInt('10003'), // number | User ID. If not specified, all user records will be returned
  'from': BigInt('1602120000'), // number | Start time for querying records. If not specified, defaults to 7 days before current time
  'to': BigInt('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));

Parameters

Name Type Description Notes
currencyPair string Specify the trading pair. If not specified, returns all trading pairs [optional] [default to undefined]
userId number | bigint User ID. If not specified, all user records will be returned [optional] [default to undefined]
from number | bigint Start time for querying records. If not specified, defaults to 7 days before current time [optional] [default to undefined]
to number | bigint 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]

Return type

Promise<{ response: AxiosResponse; body: PartnerTransactionHistory; }> PartnerTransactionHistory

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

partnerCommissionsHistory

Promise<{ response: http.IncomingMessage; body: PartnerCommissionHistory; }> partnerCommissionsHistory(opts)

Partner obtains rebate records of recommended users

Record query time range cannot exceed 30 days

Example

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': BigInt('10003'), // number | User ID. If not specified, all user records will be returned
  'from': BigInt('1602120000'), // number | Start time for querying records. If not specified, defaults to 7 days before current time
  'to': BigInt('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));

Parameters

Name Type Description Notes
currency string Specify the currency. If not specified, returns all currencies [optional] [default to undefined]
userId number | bigint User ID. If not specified, all user records will be returned [optional] [default to undefined]
from number | bigint Start time for querying records. If not specified, defaults to 7 days before current time [optional] [default to undefined]
to number | bigint 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]

Return type

Promise<{ response: AxiosResponse; body: PartnerCommissionHistory; }> PartnerCommissionHistory

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

partnerSubList

Promise<{ response: http.IncomingMessage; body: PartnerSubList; }> partnerSubList(opts)

Partner subordinate list

Including sub-agents, direct customers, and indirect customers

Example

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': BigInt('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));

Parameters

Name Type Description Notes
userId number | bigint 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]

Return type

Promise<{ response: AxiosResponse; body: PartnerSubList; }> PartnerSubList

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

rebateBrokerCommissionHistory

Promise<{ response: http.IncomingMessage; body: BrokerCommission; }> rebateBrokerCommissionHistory(opts)

Broker obtains user&#39;s rebate records

Record query time range cannot exceed 30 days

Example

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': BigInt('10003'), // number | User ID. If not specified, all user records will be returned
  'from': BigInt('1711929600'), // number | Start time of the query record. If not specified, defaults to 30 days before the current time
  'to': BigInt('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));

Parameters

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 | bigint User ID. If not specified, all user records will be returned [optional] [default to undefined]
from number | bigint Start time of the query record. If not specified, defaults to 30 days before the current time [optional] [default to undefined]
to number | bigint End timestamp for the query, defaults to current time if not specified [optional] [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: BrokerCommission; }> BrokerCommission

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

rebateBrokerTransactionHistory

Promise<{ response: http.IncomingMessage; body: BrokerTransactionHistory; }> rebateBrokerTransactionHistory(opts)

Broker obtains user&#39;s trading history

Record query time range cannot exceed 30 days

Example

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': BigInt('10003'), // number | User ID. If not specified, all user records will be returned
  'from': BigInt('1711929600'), // number | Start time of the query record. If not specified, defaults to 30 days before the current time
  'to': BigInt('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));

Parameters

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 | bigint User ID. If not specified, all user records will be returned [optional] [default to undefined]
from number | bigint Start time of the query record. If not specified, defaults to 30 days before the current time [optional] [default to undefined]
to number | bigint End timestamp for the query, defaults to current time if not specified [optional] [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: BrokerTransactionHistory; }> BrokerTransactionHistory

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

rebateUserInfo

Promise<{ response: http.IncomingMessage; body: RebateUserInfo; }> rebateUserInfo()

User obtains rebate information

Example

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));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: RebateUserInfo; }> RebateUserInfo

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

userSubRelation

Promise<{ response: http.IncomingMessage; body: UserSubRelation; }> userSubRelation(userIdList)

User subordinate relationship

Query whether the specified user is within the system

Example

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));

Parameters

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]

Return type

Promise<{ response: AxiosResponse; body: UserSubRelation; }> UserSubRelation

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getPartnerApplicationRecent

Promise<{ response: http.IncomingMessage; body: PartnerApplicationResponse; }> getPartnerApplicationRecent()

Get recent partner application records

Get the current user&#39;s recent partner application records. This endpoint returns application records within the last 30 days, including application status, review information, application materials, and other details.

Example

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));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: PartnerApplicationResponse; }> PartnerApplicationResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getPartnerEligibility

Promise<{ response: http.IncomingMessage; body: EligibilityResponse; }> getPartnerEligibility()

Check partner application eligibility

Check whether the current user is eligible to apply as a partner. This endpoint checks multiple conditions: account status (banned or not), whether it is a sub-account, whether already a partner, KYC verification status, whether under another agent&#39;s referral chain, whether on the blacklist, and other business rule restrictions

Example

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));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: EligibilityResponse; }> EligibilityResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getPartnerAgentDataAggregated

Promise<{ response: http.IncomingMessage; body: PartnerDataAggregatedResponse; }> getPartnerAgentDataAggregated(opts)

Aggregated partner agent statistics

Query aggregated partner-agent statistics for a time range, including rebate amount, trading volume, net fee, customer count, and trading user count. Notes: - `trading_user_count` is only returned when `business_type=0` (All). - Time parameters use UTC+8. - If no time range is passed, the last 7 days are queried by default. - Partner agents only; sub-accounts are not allowed.

Example

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 | Query start time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the start of the last 7 days.
  'endDate': "2024-01-07 23:59:59", // string | Query end time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the end of the last 7 days.
  '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));

Parameters

Name Type Description Notes
startDate string Query start time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the start of the last 7 days. [optional] [default to undefined]
endDate string Query end time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the end of the last 7 days. [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]

Return type

Promise<{ response: AxiosResponse; body: PartnerDataAggregatedResponse; }> PartnerDataAggregatedResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json