Skip to content

Latest commit

 

History

History
316 lines (240 loc) · 13 KB

RebateApi.md

File metadata and controls

316 lines (240 loc) · 13 KB

gate_api.RebateApi

All URIs are relative to https://api.gateio.ws/api/v4

Method HTTP request Description
agency_transaction_history GET /rebate/agency/transaction_history The agency obtains the transaction history of the recommended user
agency_commissions_history GET /rebate/agency/commission_history The agency obtains the commission history of the recommended user
rebate_broker_commission_history GET /rebate/broker/commission_history The broker obtains the user's commission rebate records
rebate_broker_transaction_history GET /rebate/broker/transaction_history The broker obtains the user's trading history

agency_transaction_history

list[AgencyTransactionHistory] agency_transaction_history(currency_pair=currency_pair, user_id=user_id, _from=_from, to=to, limit=limit, offset=offset)

The agency obtains the transaction history of the recommended user

Record time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure APIv4 key authorization
configuration = gate_api.Configuration(
    host = "https://api.gateio.ws/api/v4",
    key = "YOU_API_KEY",
    secret = "YOUR_API_SECRET"
)

api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.RebateApi(api_client)
currency_pair = 'BTC_USDT' # str | Specify the currency pair, if not specified, return all currency pairs (optional)
user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional)
_from = 1602120000 # int | Time range beginning, default to 7 days before current time (optional)
to = 1602123600 # int | Time range ending, default to current time (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)

try:
    # The agency obtains the transaction history of the recommended user
    api_response = api_instance.agency_transaction_history(currency_pair=currency_pair, user_id=user_id, _from=_from, to=to, limit=limit, offset=offset)
    print(api_response)
except GateApiException as ex:
    print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
    print("Exception when calling RebateApi->agency_transaction_history: %s\n" % e)

Parameters

Name Type Description Notes
currency_pair str Specify the currency pair, if not specified, return all currency pairs [optional]
user_id int User ID. If not specified, all user records will be returned [optional]
_from int Time range beginning, default to 7 days before current time [optional]
to int Time range ending, default to current time [optional]
limit int Maximum number of records to be returned in a single list [optional] [default to 100]
offset int List offset, starting from 0 [optional] [default to 0]

Return type

list[AgencyTransactionHistory]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

agency_commissions_history

list[AgencyCommissionHistory] agency_commissions_history(currency=currency, user_id=user_id, _from=_from, to=to, limit=limit, offset=offset)

The agency obtains the commission history of the recommended user

Record time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure APIv4 key authorization
configuration = gate_api.Configuration(
    host = "https://api.gateio.ws/api/v4",
    key = "YOU_API_KEY",
    secret = "YOUR_API_SECRET"
)

api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.RebateApi(api_client)
currency = 'BTC' # str | Filter by currency. Return all currency records if not specified (optional)
user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional)
_from = 1602120000 # int | Time range beginning, default to 7 days before current time (optional)
to = 1602123600 # int | Time range ending, default to current time (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)

try:
    # The agency obtains the commission history of the recommended user
    api_response = api_instance.agency_commissions_history(currency=currency, user_id=user_id, _from=_from, to=to, limit=limit, offset=offset)
    print(api_response)
except GateApiException as ex:
    print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
    print("Exception when calling RebateApi->agency_commissions_history: %s\n" % e)

Parameters

Name Type Description Notes
currency str Filter by currency. Return all currency records if not specified [optional]
user_id int User ID. If not specified, all user records will be returned [optional]
_from int Time range beginning, default to 7 days before current time [optional]
to int Time range ending, default to current time [optional]
limit int Maximum number of records to be returned in a single list [optional] [default to 100]
offset int List offset, starting from 0 [optional] [default to 0]

Return type

list[AgencyCommissionHistory]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rebate_broker_commission_history

list[BrokerCommission] rebate_broker_commission_history(limit=limit, offset=offset, user_id=user_id)

The broker obtains the user's commission rebate records

Record time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure APIv4 key authorization
configuration = gate_api.Configuration(
    host = "https://api.gateio.ws/api/v4",
    key = "YOU_API_KEY",
    secret = "YOUR_API_SECRET"
)

api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.RebateApi(api_client)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional)

try:
    # The broker obtains the user's commission rebate records
    api_response = api_instance.rebate_broker_commission_history(limit=limit, offset=offset, user_id=user_id)
    print(api_response)
except GateApiException as ex:
    print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
    print("Exception when calling RebateApi->rebate_broker_commission_history: %s\n" % e)

Parameters

Name Type Description Notes
limit int Maximum number of records to be returned in a single list [optional] [default to 100]
offset int List offset, starting from 0 [optional] [default to 0]
user_id int User ID. If not specified, all user records will be returned [optional]

Return type

list[BrokerCommission]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rebate_broker_transaction_history

list[BrokerTransaction] rebate_broker_transaction_history(limit=limit, offset=offset, user_id=user_id)

The broker obtains the user's trading history

Record time range cannot exceed 30 days

Example

  • Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure APIv4 key authorization
configuration = gate_api.Configuration(
    host = "https://api.gateio.ws/api/v4",
    key = "YOU_API_KEY",
    secret = "YOUR_API_SECRET"
)

api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.RebateApi(api_client)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional)

try:
    # The broker obtains the user's trading history
    api_response = api_instance.rebate_broker_transaction_history(limit=limit, offset=offset, user_id=user_id)
    print(api_response)
except GateApiException as ex:
    print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
    print("Exception when calling RebateApi->rebate_broker_transaction_history: %s\n" % e)

Parameters

Name Type Description Notes
limit int Maximum number of records to be returned in a single list [optional] [default to 100]
offset int List offset, starting from 0 [optional] [default to 0]
user_id int User ID. If not specified, all user records will be returned [optional]

Return type

list[BrokerTransaction]

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]