All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| ListSubAccounts | GET /sub_accounts | List sub-accounts |
| CreateSubAccounts | POST /sub_accounts | Create a new sub-account |
| GetSubAccount | GET /sub_accounts/{user_id} | Get sub-account |
| ListSubAccountKeys | GET /sub_accounts/{user_id}/keys | List all API key pairs of the sub-account |
| CreateSubAccountKeys | POST /sub_accounts/{user_id}/keys | Create new sub-account API key pair |
| GetSubAccountKey | GET /sub_accounts/{user_id}/keys/{key} | Get specific API key pair of the sub-account |
| UpdateSubAccountKeys | PUT /sub_accounts/{user_id}/keys/{key} | Update sub-account API key pair |
| DeleteSubAccountKeys | DELETE /sub_accounts/{user_id}/keys/{key} | Delete sub-account API key pair |
| LockSubAccount | POST /sub_accounts/{user_id}/lock | Lock sub-account |
| UnlockSubAccount | POST /sub_accounts/{user_id}/unlock | Unlock sub-account |
| ListUnifiedMode | GET /sub_accounts/unified_mode | Get sub-account mode |
List<SubAccount> ListSubAccounts (string type = null)
List sub-accounts
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListSubAccountsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var type = "0"; // string | Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by default. (optional)
try
{
// List sub-accounts
List<SubAccount> result = apiInstance.ListSubAccounts(type);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.ListSubAccounts: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| type | string | Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by default. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubAccount CreateSubAccounts (SubAccount subAccount)
Create a new sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class CreateSubAccountsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var subAccount = new SubAccount(); // SubAccount |
try
{
// Create a new sub-account
SubAccount result = apiInstance.CreateSubAccounts(subAccount);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.CreateSubAccounts: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| subAccount | SubAccount |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Created successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubAccount GetSubAccount (long userId)
Get sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class GetSubAccountExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // long | Sub-account user ID
try
{
// Get sub-account
SubAccount result = apiInstance.GetSubAccount(userId);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.GetSubAccount: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| userId | long | Sub-account user ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<SubAccountKey> ListSubAccountKeys (int userId)
List all API key pairs of the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListSubAccountKeysExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // int | Sub-account user ID
try
{
// List all API key pairs of the sub-account
List<SubAccountKey> result = apiInstance.ListSubAccountKeys(userId);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.ListSubAccountKeys: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| userId | int | Sub-account user ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubAccountKey CreateSubAccountKeys (long userId, SubAccountKey subAccountKey)
Create new sub-account API key pair
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class CreateSubAccountKeysExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // long | Sub-account user ID
var subAccountKey = new SubAccountKey(); // SubAccountKey |
try
{
// Create new sub-account API key pair
SubAccountKey result = apiInstance.CreateSubAccountKeys(userId, subAccountKey);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.CreateSubAccountKeys: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| userId | long | Sub-account user ID | |
| subAccountKey | SubAccountKey |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Created successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubAccountKey GetSubAccountKey (int userId, string key)
Get specific API key pair of the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class GetSubAccountKeyExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // int | Sub-account user ID
var key = "key_example"; // string | Sub-account API key
try
{
// Get specific API key pair of the sub-account
SubAccountKey result = apiInstance.GetSubAccountKey(userId, key);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.GetSubAccountKey: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| userId | int | Sub-account user ID | |
| key | string | Sub-account API key |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void UpdateSubAccountKeys (int userId, string key, SubAccountKey subAccountKey)
Update sub-account API key pair
Modify Sub-account API Key Pair (Note: This interface cannot modify the mode account type attribute)
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class UpdateSubAccountKeysExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // int | Sub-account user ID
var key = "key_example"; // string | Sub-account API key
var subAccountKey = new SubAccountKey(); // SubAccountKey |
try
{
// Update sub-account API key pair
apiInstance.UpdateSubAccountKeys(userId, key, subAccountKey);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.UpdateSubAccountKeys: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| userId | int | Sub-account user ID | |
| key | string | Sub-account API key | |
| subAccountKey | SubAccountKey |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Updated successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteSubAccountKeys (int userId, string key)
Delete sub-account API key pair
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class DeleteSubAccountKeysExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // int | Sub-account user ID
var key = "key_example"; // string | Sub-account API key
try
{
// Delete sub-account API key pair
apiInstance.DeleteSubAccountKeys(userId, key);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.DeleteSubAccountKeys: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| userId | int | Sub-account user ID | |
| key | string | Sub-account API key |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Deleted successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void LockSubAccount (long userId)
Lock sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class LockSubAccountExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // long | Sub-account user ID
try
{
// Lock sub-account
apiInstance.LockSubAccount(userId);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.LockSubAccount: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| userId | long | Sub-account user ID |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Locked successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void UnlockSubAccount (long userId)
Unlock sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class UnlockSubAccountExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // long | Sub-account user ID
try
{
// Unlock sub-account
apiInstance.UnlockSubAccount(userId);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.UnlockSubAccount: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| userId | long | Sub-account user ID |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Unlocked successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<SubUserMode> ListUnifiedMode ()
Get sub-account mode
Unified account mode: - classic: Classic account mode - multi_currency: Cross-currency margin mode - portfolio: Portfolio margin mode - single_currency: Single-currency margin mode
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListUnifiedModeExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
try
{
// Get sub-account mode
List<SubUserMode> result = apiInstance.ListUnifiedMode();
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.ListUnifiedMode: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]