All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| listDeliveryContracts | GET /delivery/{settle}/contracts | List all futures contracts |
| getDeliveryContract | GET /delivery/{settle}/contracts/{contract} | Get a single contract |
| listDeliveryOrderBook | GET /delivery/{settle}/order_book | Futures order book |
| listDeliveryTrades | GET /delivery/{settle}/trades | Futures trading history |
| listDeliveryCandlesticks | GET /delivery/{settle}/candlesticks | Get futures candlesticks |
| listDeliveryTickers | GET /delivery/{settle}/tickers | List futures tickers |
| listDeliveryInsuranceLedger | GET /delivery/{settle}/insurance | Futures insurance balance history |
| listDeliveryAccounts | GET /delivery/{settle}/accounts | Query futures account |
| listDeliveryAccountBook | GET /delivery/{settle}/account_book | Query account book |
| listDeliveryPositions | GET /delivery/{settle}/positions | List all positions of a user |
| getDeliveryPosition | GET /delivery/{settle}/positions/{contract} | Get single position |
| updateDeliveryPositionMargin | POST /delivery/{settle}/positions/{contract}/margin | Update position margin |
| updateDeliveryPositionLeverage | POST /delivery/{settle}/positions/{contract}/leverage | Update position leverage |
| updateDeliveryPositionRiskLimit | POST /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit |
| listDeliveryOrders | GET /delivery/{settle}/orders | List futures orders |
| createDeliveryOrder | POST /delivery/{settle}/orders | Create a futures order |
| cancelDeliveryOrders | DELETE /delivery/{settle}/orders | Cancel all `open` orders matched |
| getDeliveryOrder | GET /delivery/{settle}/orders/{order_id} | Get a single order |
| cancelDeliveryOrder | DELETE /delivery/{settle}/orders/{order_id} | Cancel a single order |
| getMyDeliveryTrades | GET /delivery/{settle}/my_trades | List personal trading history |
| listDeliveryPositionClose | GET /delivery/{settle}/position_close | List position close history |
| listDeliveryLiquidates | GET /delivery/{settle}/liquidates | List liquidation history |
| listDeliverySettlements | GET /delivery/{settle}/settlements | List settlement history |
| listPriceTriggeredDeliveryOrders | GET /delivery/{settle}/price_orders | List all auto orders |
| createPriceTriggeredDeliveryOrder | POST /delivery/{settle}/price_orders | Create a price-triggered order |
| cancelPriceTriggeredDeliveryOrderList | DELETE /delivery/{settle}/price_orders | Cancel all open orders |
| getPriceTriggeredDeliveryOrder | GET /delivery/{settle}/price_orders/{order_id} | Get a single order |
| cancelPriceTriggeredDeliveryOrder | DELETE /delivery/{settle}/price_orders/{order_id} | Cancel a single order |
List<DeliveryContract> listDeliveryContracts(settle)
List all futures contracts
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
try {
List<DeliveryContract> result = apiInstance.listDeliveryContracts(settle);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryContracts");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
DeliveryContract getDeliveryContract(settle, contract)
Get a single contract
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
try {
DeliveryContract result = apiInstance.getDeliveryContract(settle, contract);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#getDeliveryContract");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Contract information | - |
FuturesOrderBook listDeliveryOrderBook(settle, contract).interval(interval).limit(limit).withId(withId).execute();
Futures order book
Bids will be sorted by price from high to low, while asks sorted reversely
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
String interval = "0"; // String | Order depth. 0 means no aggregation is applied. default to 0
Integer limit = 10; // Integer | Maximum number of order depth data in asks or bids
Boolean withId = false; // Boolean | Whether the order book update ID will be returned. This ID increases by 1 on every order book update
try {
FuturesOrderBook result = apiInstance.listDeliveryOrderBook(settle, contract)
.interval(interval)
.limit(limit)
.withId(withId)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryOrderBook");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | |
| interval | String | Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to 0] [enum: 0, 0.1, 0.01] |
| limit | Integer | Maximum number of order depth data in asks or bids | [optional] [default to 10] |
| withId | Boolean | Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to false] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order book retrieved | - |
List<FuturesTrade> listDeliveryTrades(settle, contract).limit(limit).lastId(lastId).from(from).to(to).execute();
Futures trading history
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
String lastId = "12345"; // String | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range
Long from = 1546905600L; // Long | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned.
Long to = 1546935600L; // Long | Specify end time in Unix seconds, default to current time
try {
List<FuturesTrade> result = apiInstance.listDeliveryTrades(settle, contract)
.limit(limit)
.lastId(lastId)
.from(from)
.to(to)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryTrades");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
| lastId | String | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] |
| from | Long | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] |
| to | Long | Specify end time in Unix seconds, default to current time | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
List<FuturesCandlestick> listDeliveryCandlesticks(settle, contract).from(from).to(to).limit(limit).interval(interval).execute();
Get futures candlesticks
Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval`
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
Long from = 1546905600L; // Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
Long to = 1546935600L; // Long | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
Integer limit = 100; // Integer | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
String interval = "5m"; // String | Interval time between data points
try {
List<FuturesCandlestick> result = apiInstance.listDeliveryCandlesticks(settle, contract)
.from(from)
.to(to)
.limit(limit)
.interval(interval)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryCandlesticks");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | |
| from | Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] |
| to | Long | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] |
| limit | Integer | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] |
| interval | String | Interval time between data points | [optional] [default to 5m] [enum: 10s, 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d, 7d] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<FuturesTicker> listDeliveryTickers(settle).contract(contract).execute();
List futures tickers
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
try {
List<FuturesTicker> result = apiInstance.listDeliveryTickers(settle)
.contract(contract)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryTickers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<InsuranceRecord> listDeliveryInsuranceLedger(settle).limit(limit).execute();
Futures insurance balance history
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
try {
List<InsuranceRecord> result = apiInstance.listDeliveryInsuranceLedger(settle)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryInsuranceLedger");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
FuturesAccount listDeliveryAccounts(settle)
Query futures account
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
try {
FuturesAccount result = apiInstance.listDeliveryAccounts(settle);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryAccounts");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
List<FuturesAccountBook> listDeliveryAccountBook(settle).limit(limit).from(from).to(to).type(type).execute();
Query account book
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
Long from = 1547706332L; // Long | Start timestamp
Long to = 1547706332L; // Long | End timestamp
String type = "dnw"; // String | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate
try {
List<FuturesAccountBook> result = apiInstance.listDeliveryAccountBook(settle)
.limit(limit)
.from(from)
.to(to)
.type(type)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryAccountBook");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
| from | Long | Start timestamp | [optional] |
| to | Long | End timestamp | [optional] |
| type | String | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] [enum: dnw, pnl, fee, refr, fund, point_dnw, point_fee, point_refr] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
List<Position> listDeliveryPositions(settle)
List all positions of a user
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
try {
List<Position> result = apiInstance.listDeliveryPositions(settle);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryPositions");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
Position getDeliveryPosition(settle, contract)
Get single position
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
try {
Position result = apiInstance.getDeliveryPosition(settle, contract);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#getDeliveryPosition");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Position information | - |
Position updateDeliveryPositionMargin(settle, contract, change)
Update position margin
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
String change = "0.01"; // String | Margin change. Use positive number to increase margin, negative number otherwise.
try {
Position result = apiInstance.updateDeliveryPositionMargin(settle, contract, change);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#updateDeliveryPositionMargin");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | |
| change | String | Margin change. Use positive number to increase margin, negative number otherwise. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Position information | - |
Position updateDeliveryPositionLeverage(settle, contract, leverage)
Update position leverage
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
String leverage = "10"; // String | New position leverage
try {
Position result = apiInstance.updateDeliveryPositionLeverage(settle, contract, leverage);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#updateDeliveryPositionLeverage");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | |
| leverage | String | New position leverage |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Position information | - |
Position updateDeliveryPositionRiskLimit(settle, contract, riskLimit)
Update position risk limit
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
String riskLimit = "10"; // String | New position risk limit
try {
Position result = apiInstance.updateDeliveryPositionRiskLimit(settle, contract, riskLimit);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#updateDeliveryPositionRiskLimit");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | |
| riskLimit | String | New position risk limit |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Position information | - |
List<FuturesOrder> listDeliveryOrders(settle, status).contract(contract).limit(limit).offset(offset).lastId(lastId).countTotal(countTotal).execute();
List futures orders
Zero-fill order cannot be retrieved for 60 seconds after cancellation
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String status = "open"; // String | Only list the orders with this status
String contract = "BTC_USDT_20200814"; // String | Futures contract
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
Integer countTotal = 0; // Integer | Whether to return total number matched. Default to 0(no return)
try {
List<FuturesOrder> result = apiInstance.listDeliveryOrders(settle, status)
.contract(contract)
.limit(limit)
.offset(offset)
.lastId(lastId)
.countTotal(countTotal)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| status | String | Only list the orders with this status | [enum: open, finished] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
| offset | Integer | List offset, starting from 0 | [optional] [default to 0] |
| lastId | String | Specify list staring point using the `id` of last record in previous list-query results | [optional] |
| countTotal | Integer | Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] [enum: 0, 1] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | * X-Pagination-Limit - Request limit specified * X-Pagination-Offset - Request offset specified * X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1 |
FuturesOrder createDeliveryOrder(settle, futuresOrder)
Create a futures order
Zero-fill order cannot be retrieved for 60 seconds after cancellation
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
FuturesOrder futuresOrder = new FuturesOrder(); // FuturesOrder |
try {
FuturesOrder result = apiInstance.createDeliveryOrder(settle, futuresOrder);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#createDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| futuresOrder | FuturesOrder |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Order details | - |
List<FuturesOrder> cancelDeliveryOrders(settle, contract, side)
Cancel all `open` orders matched
Zero-fill order cannot be retrieved for 60 seconds after cancellation
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
String side = "ask"; // String | All bids or asks. Both included if not specified
try {
List<FuturesOrder> result = apiInstance.cancelDeliveryOrders(settle, contract, side);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#cancelDeliveryOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | |
| side | String | All bids or asks. Both included if not specified | [optional] [enum: ask, bid] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | All orders matched cancelled | - |
FuturesOrder getDeliveryOrder(settle, orderId)
Get a single order
Zero-fill order cannot be retrieved for 60 seconds after cancellation
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String orderId = "12345"; // String | Retrieve the data of the order with the specified ID
try {
FuturesOrder result = apiInstance.getDeliveryOrder(settle, orderId);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#getDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| orderId | String | Retrieve the data of the order with the specified ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order details | - |
FuturesOrder cancelDeliveryOrder(settle, orderId)
Cancel a single order
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String orderId = "12345"; // String | Retrieve the data of the order with the specified ID
try {
FuturesOrder result = apiInstance.cancelDeliveryOrder(settle, orderId);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#cancelDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| orderId | String | Retrieve the data of the order with the specified ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order details | - |
List<MyFuturesTrade> getMyDeliveryTrades(settle).contract(contract).order(order).limit(limit).offset(offset).lastId(lastId).countTotal(countTotal).execute();
List personal trading history
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
Long order = 12345L; // Long | Futures order ID, return related data only if specified
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
Integer countTotal = 0; // Integer | Whether to return total number matched. Default to 0(no return)
try {
List<MyFuturesTrade> result = apiInstance.getMyDeliveryTrades(settle)
.contract(contract)
.order(order)
.limit(limit)
.offset(offset)
.lastId(lastId)
.countTotal(countTotal)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#getMyDeliveryTrades");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | [optional] |
| order | Long | Futures order ID, return related data only if specified | [optional] |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
| offset | Integer | List offset, starting from 0 | [optional] [default to 0] |
| lastId | String | Specify list staring point using the `id` of last record in previous list-query results | [optional] |
| countTotal | Integer | Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] [enum: 0, 1] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | * X-Pagination-Limit - Request limit specified * X-Pagination-Offset - Request offset specified * X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1 |
List<PositionClose> listDeliveryPositionClose(settle).contract(contract).limit(limit).execute();
List position close history
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
try {
List<PositionClose> result = apiInstance.listDeliveryPositionClose(settle)
.contract(contract)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryPositionClose");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
List<FuturesLiquidate> listDeliveryLiquidates(settle).contract(contract).limit(limit).at(at).execute();
List liquidation history
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
Integer at = 0; // Integer | Specify a liquidation timestamp
try {
List<FuturesLiquidate> result = apiInstance.listDeliveryLiquidates(settle)
.contract(contract)
.limit(limit)
.at(at)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliveryLiquidates");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
| at | Integer | Specify a liquidation timestamp | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
List<DeliverySettlement> listDeliverySettlements(settle).contract(contract).limit(limit).at(at).execute();
List settlement history
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT_20200814"; // String | Futures contract
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
Integer at = 0; // Integer | Specify a settlement timestamp
try {
List<DeliverySettlement> result = apiInstance.listDeliverySettlements(settle)
.contract(contract)
.limit(limit)
.at(at)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listDeliverySettlements");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: btc, usdt] |
| contract | String | Futures contract | [optional] |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
| at | Integer | Specify a settlement timestamp | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
List<FuturesPriceTriggeredOrder> listPriceTriggeredDeliveryOrders(settle, status).contract(contract).limit(limit).offset(offset).execute();
List all auto orders
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String status = "status_example"; // String | Only list the orders with this status
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
Integer offset = 0; // Integer | List offset, starting from 0
try {
List<FuturesPriceTriggeredOrder> result = apiInstance.listPriceTriggeredDeliveryOrders(settle, status)
.contract(contract)
.limit(limit)
.offset(offset)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#listPriceTriggeredDeliveryOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| status | String | Only list the orders with this status | [enum: open, finished] |
| contract | String | Futures contract, return related data only if specified | [optional] |
| limit | Integer | Maximum number of records to be returned in a single list | [optional] [default to 100] |
| offset | Integer | List offset, starting from 0 | [optional] [default to 0] |
List<FuturesPriceTriggeredOrder>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved | - |
TriggerOrderResponse createPriceTriggeredDeliveryOrder(settle, futuresPriceTriggeredOrder)
Create a price-triggered order
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
FuturesPriceTriggeredOrder futuresPriceTriggeredOrder = new FuturesPriceTriggeredOrder(); // FuturesPriceTriggeredOrder |
try {
TriggerOrderResponse result = apiInstance.createPriceTriggeredDeliveryOrder(settle, futuresPriceTriggeredOrder);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#createPriceTriggeredDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| futuresPriceTriggeredOrder | FuturesPriceTriggeredOrder |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Order created | - |
List<FuturesPriceTriggeredOrder> cancelPriceTriggeredDeliveryOrderList(settle, contract)
Cancel all open orders
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String contract = "BTC_USDT"; // String | Futures contract
try {
List<FuturesPriceTriggeredOrder> result = apiInstance.cancelPriceTriggeredDeliveryOrderList(settle, contract);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#cancelPriceTriggeredDeliveryOrderList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| contract | String | Futures contract |
List<FuturesPriceTriggeredOrder>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Batch cancellation request accepted. Query order status by listing orders | - |
FuturesPriceTriggeredOrder getPriceTriggeredDeliveryOrder(settle, orderId)
Get a single order
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String orderId = "orderId_example"; // String | Retrieve the data of the order with the specified ID
try {
FuturesPriceTriggeredOrder result = apiInstance.getPriceTriggeredDeliveryOrder(settle, orderId);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#getPriceTriggeredDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| orderId | String | Retrieve the data of the order with the specified ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Auto order detail | - |
FuturesPriceTriggeredOrder cancelPriceTriggeredDeliveryOrder(settle, orderId)
Cancel a single order
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.DeliveryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
String settle = "usdt"; // String | Settle currency
String orderId = "orderId_example"; // String | Retrieve the data of the order with the specified ID
try {
FuturesPriceTriggeredOrder result = apiInstance.cancelPriceTriggeredDeliveryOrder(settle, orderId);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling DeliveryApi#cancelPriceTriggeredDeliveryOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| settle | String | Settle currency | [enum: usdt] |
| orderId | String | Retrieve the data of the order with the specified ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Auto order detail | - |