Skip to content

Latest commit

 

History

History
727 lines (524 loc) · 23 KB

RebateApi.md

File metadata and controls

727 lines (524 loc) · 23 KB

RebateApi

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

Method HTTP request Description
AgencyTransactionHistory Get /rebate/agency/transaction_history The agency obtains the transaction history of the recommended user
AgencyCommissionsHistory Get /rebate/agency/commission_history The agency obtains the commission history of the recommended user
PartnerTransactionHistory Get /rebate/partner/transaction_history Partner obtains transaction records of recommended users
PartnerCommissionsHistory Get /rebate/partner/commission_history Partner obtains commission records of recommended users
PartnerSubList Get /rebate/partner/sub_list Partner subordinate list
RebateBrokerCommissionHistory Get /rebate/broker/commission_history The broker obtains the user's commission rebate records
RebateBrokerTransactionHistory Get /rebate/broker/transaction_history The broker obtains the user's trading history
RebateUserInfo Get /rebate/user/info User retrieves rebate information
UserSubRelation Get /rebate/user/sub_relation User-subordinate relationship

AgencyTransactionHistory

[]AgencyTransactionHistory AgencyTransactionHistory(ctx, optional)

The agency obtains the transaction history of the recommended user

Record time range cannot exceed 30 days

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional AgencyTransactionHistoryOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a AgencyTransactionHistoryOpts struct

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

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.AgencyTransactionHistory(ctx, nil)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

[]AgencyTransactionHistory

Authorization

apiv4

HTTP request headers

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

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

AgencyCommissionsHistory

[]AgencyCommissionHistory AgencyCommissionsHistory(ctx, optional)

The agency obtains the commission history of the recommended user

Record time range cannot exceed 30 days

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional AgencyCommissionsHistoryOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a AgencyCommissionsHistoryOpts struct

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

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.AgencyCommissionsHistory(ctx, nil)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

[]AgencyCommissionHistory

Authorization

apiv4

HTTP request headers

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

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

PartnerTransactionHistory

PartnerTransactionHistory PartnerTransactionHistory(ctx, optional)

Partner obtains transaction records of recommended users

Record time range cannot exceed 30 days

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional PartnerTransactionHistoryOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PartnerTransactionHistoryOpts struct

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

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.PartnerTransactionHistory(ctx, nil)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

PartnerTransactionHistory

Authorization

apiv4

HTTP request headers

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

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

PartnerCommissionsHistory

PartnerCommissionHistory PartnerCommissionsHistory(ctx, optional)

Partner obtains commission records of recommended users

Record time range cannot exceed 30 days

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional PartnerCommissionsHistoryOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PartnerCommissionsHistoryOpts struct

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

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.PartnerCommissionsHistory(ctx, nil)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

PartnerCommissionHistory

Authorization

apiv4

HTTP request headers

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

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

PartnerSubList

PartnerSubList PartnerSubList(ctx, optional)

Partner subordinate list

Including sub-agents, direct customers, indirect customers

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional PartnerSubListOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PartnerSubListOpts struct

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

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.PartnerSubList(ctx, nil)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

PartnerSubList

Authorization

apiv4

HTTP request headers

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

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

RebateBrokerCommissionHistory

[]BrokerCommission RebateBrokerCommissionHistory(ctx, optional)

The broker obtains the user's commission rebate records

Record time range cannot exceed 30 days

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional RebateBrokerCommissionHistoryOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a RebateBrokerCommissionHistoryOpts struct

Name Type Description Notes
limit optional.Int32 Maximum number of records to be returned in a single list [default to 100]
offset optional.Int32 List offset, starting from 0 [default to 0]
userId optional.Int64 User ID. If not specified, all user records will be returned
from optional.Int64 The start time of the query record. If not specified, the default is to push forward 30 days from the current time.
to optional.Int64 Time range ending, default to current time

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.RebateBrokerCommissionHistory(ctx, nil)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

[]BrokerCommission

Authorization

apiv4

HTTP request headers

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

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

RebateBrokerTransactionHistory

[]BrokerTransaction RebateBrokerTransactionHistory(ctx, optional)

The broker obtains the user's trading history

Record time range cannot exceed 30 days

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional RebateBrokerTransactionHistoryOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a RebateBrokerTransactionHistoryOpts struct

Name Type Description Notes
limit optional.Int32 Maximum number of records to be returned in a single list [default to 100]
offset optional.Int32 List offset, starting from 0 [default to 0]
userId optional.Int64 User ID. If not specified, all user records will be returned
from optional.Int64 The start time of the query record. If not specified, the default is to push forward 30 days from the current time.
to optional.Int64 Time range ending, default to current time

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.RebateBrokerTransactionHistory(ctx, nil)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

[]BrokerTransaction

Authorization

apiv4

HTTP request headers

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

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

RebateUserInfo

[]RebateUserInfo RebateUserInfo(ctx, )

User retrieves rebate information

Required Parameters

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    
    result, _, err := client.RebateApi.RebateUserInfo(ctx)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

[]RebateUserInfo

Authorization

apiv4

HTTP request headers

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

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

UserSubRelation

UserSubRelation UserSubRelation(ctx, userIdList)

User-subordinate relationship

Query whether the specified user is in the system

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
userIdList string Query the user's ID list, split by,, if there are more than 100, take 100

Example

package main

import (
    "context"
    "fmt"

    "github.com/gateio/gateapi-go/v6"
)

func main() {
    client := gateapi.NewAPIClient(gateapi.NewConfiguration())
    // uncomment the next line if your are testing against testnet
    // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4")
    ctx := context.WithValue(context.Background(),
                             gateapi.ContextGateAPIV4,
                             gateapi.GateAPIV4{
                                 Key:    "YOUR_API_KEY",
                                 Secret: "YOUR_API_SECRET",
                             }
                            )
    userIdList := "1, 2, 3" // string - Query the user's ID list, split by,, if there are more than 100, take 100
    
    result, _, err := client.RebateApi.UserSubRelation(ctx, userIdList)
    if err != nil {
        if e, ok := err.(gateapi.GateAPIError); ok {
            fmt.Printf("gate api error: %s\n", e.Error())
        } else {
            fmt.Printf("generic error: %s\n", err.Error())
        }
    } else {
        fmt.Println(result)
    }
}

Return type

UserSubRelation

Authorization

apiv4

HTTP request headers

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

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