# DeliveryApi All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- [**ListDeliveryContracts**](DeliveryApi.md#ListDeliveryContracts) | **Get** /delivery/{settle}/contracts | List all futures contracts [**GetDeliveryContract**](DeliveryApi.md#GetDeliveryContract) | **Get** /delivery/{settle}/contracts/{contract} | Get a single contract [**ListDeliveryOrderBook**](DeliveryApi.md#ListDeliveryOrderBook) | **Get** /delivery/{settle}/order_book | Futures order book [**ListDeliveryTrades**](DeliveryApi.md#ListDeliveryTrades) | **Get** /delivery/{settle}/trades | Futures trading history [**ListDeliveryCandlesticks**](DeliveryApi.md#ListDeliveryCandlesticks) | **Get** /delivery/{settle}/candlesticks | Get futures candlesticks [**ListDeliveryTickers**](DeliveryApi.md#ListDeliveryTickers) | **Get** /delivery/{settle}/tickers | List futures tickers [**ListDeliveryInsuranceLedger**](DeliveryApi.md#ListDeliveryInsuranceLedger) | **Get** /delivery/{settle}/insurance | Futures insurance balance history [**ListDeliveryAccounts**](DeliveryApi.md#ListDeliveryAccounts) | **Get** /delivery/{settle}/accounts | Query futures account [**ListDeliveryAccountBook**](DeliveryApi.md#ListDeliveryAccountBook) | **Get** /delivery/{settle}/account_book | Query account book [**ListDeliveryPositions**](DeliveryApi.md#ListDeliveryPositions) | **Get** /delivery/{settle}/positions | List all positions of a user [**GetDeliveryPosition**](DeliveryApi.md#GetDeliveryPosition) | **Get** /delivery/{settle}/positions/{contract} | Get single position [**UpdateDeliveryPositionMargin**](DeliveryApi.md#UpdateDeliveryPositionMargin) | **Post** /delivery/{settle}/positions/{contract}/margin | Update position margin [**UpdateDeliveryPositionLeverage**](DeliveryApi.md#UpdateDeliveryPositionLeverage) | **Post** /delivery/{settle}/positions/{contract}/leverage | Update position leverage [**UpdateDeliveryPositionRiskLimit**](DeliveryApi.md#UpdateDeliveryPositionRiskLimit) | **Post** /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit [**ListDeliveryOrders**](DeliveryApi.md#ListDeliveryOrders) | **Get** /delivery/{settle}/orders | List futures orders [**CreateDeliveryOrder**](DeliveryApi.md#CreateDeliveryOrder) | **Post** /delivery/{settle}/orders | Create a futures order [**CancelDeliveryOrders**](DeliveryApi.md#CancelDeliveryOrders) | **Delete** /delivery/{settle}/orders | Cancel all `open` orders matched [**GetDeliveryOrder**](DeliveryApi.md#GetDeliveryOrder) | **Get** /delivery/{settle}/orders/{order_id} | Get a single order [**CancelDeliveryOrder**](DeliveryApi.md#CancelDeliveryOrder) | **Delete** /delivery/{settle}/orders/{order_id} | Cancel a single order [**GetMyDeliveryTrades**](DeliveryApi.md#GetMyDeliveryTrades) | **Get** /delivery/{settle}/my_trades | List personal trading history [**ListDeliveryPositionClose**](DeliveryApi.md#ListDeliveryPositionClose) | **Get** /delivery/{settle}/position_close | List position close history [**ListDeliveryLiquidates**](DeliveryApi.md#ListDeliveryLiquidates) | **Get** /delivery/{settle}/liquidates | List liquidation history [**ListDeliverySettlements**](DeliveryApi.md#ListDeliverySettlements) | **Get** /delivery/{settle}/settlements | List settlement history [**ListPriceTriggeredDeliveryOrders**](DeliveryApi.md#ListPriceTriggeredDeliveryOrders) | **Get** /delivery/{settle}/price_orders | List all auto orders [**CreatePriceTriggeredDeliveryOrder**](DeliveryApi.md#CreatePriceTriggeredDeliveryOrder) | **Post** /delivery/{settle}/price_orders | Create a price-triggered order [**CancelPriceTriggeredDeliveryOrderList**](DeliveryApi.md#CancelPriceTriggeredDeliveryOrderList) | **Delete** /delivery/{settle}/price_orders | Cancel all open orders [**GetPriceTriggeredDeliveryOrder**](DeliveryApi.md#GetPriceTriggeredDeliveryOrder) | **Get** /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order [**CancelPriceTriggeredDeliveryOrder**](DeliveryApi.md#CancelPriceTriggeredDeliveryOrder) | **Delete** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order ## ListDeliveryContracts > []DeliveryContract ListDeliveryContracts(ctx, settle) List all futures contracts ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | ### Example ```golang 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.Background() settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliveryContracts(ctx, settle) 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 [**[]DeliveryContract**](DeliveryContract.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetDeliveryContract > DeliveryContract GetDeliveryContract(ctx, settle, contract) Get a single contract ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | ### Example ```golang 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.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract result, _, err := client.DeliveryApi.GetDeliveryContract(ctx, settle, contract) 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 [**DeliveryContract**](DeliveryContract.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryOrderBook > FuturesOrderBook ListDeliveryOrderBook(ctx, settle, contract, optional) Futures order book Bids will be sorted by price from high to low, while asks sorted reversely ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListDeliveryOrderBookOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryOrderBookOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **interval** | **optional.String**| Order depth. 0 means no aggregation is applied. default to 0 | [default to 0] **limit** | **optional.Int32**| Maximum number of order depth data in asks or bids | [default to 10] **withId** | **optional.Bool**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [default to false] ### Example ```golang 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.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract result, _, err := client.DeliveryApi.ListDeliveryOrderBook(ctx, settle, contract, 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 [**FuturesOrderBook**](FuturesOrderBook.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryTrades > []FuturesTrade ListDeliveryTrades(ctx, settle, contract, optional) Futures trading history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListDeliveryTradesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryTradesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **lastId** | **optional.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 | **from** | **optional.Int64**| 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. | **to** | **optional.Int64**| Specify end time in Unix seconds, default to current time | ### Example ```golang 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.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract result, _, err := client.DeliveryApi.ListDeliveryTrades(ctx, settle, contract, 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 [**[]FuturesTrade**](FuturesTrade.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryCandlesticks > []DeliveryCandlestick ListDeliveryCandlesticks(ctx, settle, contract, optional) 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` ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListDeliveryCandlesticksOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryCandlesticksOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **from** | **optional.Int64**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | **to** | **optional.Int64**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | **limit** | **optional.Int32**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [default to 100] **interval** | **optional.String**| Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 | [default to 5m] ### Example ```golang 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.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract result, _, err := client.DeliveryApi.ListDeliveryCandlesticks(ctx, settle, contract, 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 [**[]DeliveryCandlestick**](DeliveryCandlestick.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryTickers > []FuturesTicker ListDeliveryTickers(ctx, settle, optional) List futures tickers ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListDeliveryTickersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryTickersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract | ### Example ```golang 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.Background() settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliveryTickers(ctx, settle, 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 [**[]FuturesTicker**](FuturesTicker.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryInsuranceLedger > []InsuranceRecord ListDeliveryInsuranceLedger(ctx, settle, optional) Futures insurance balance history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListDeliveryInsuranceLedgerOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryInsuranceLedgerOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] ### Example ```golang 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.Background() settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliveryInsuranceLedger(ctx, settle, 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 [**[]InsuranceRecord**](InsuranceRecord.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryAccounts > FuturesAccount ListDeliveryAccounts(ctx, settle) Query futures account ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliveryAccounts(ctx, settle) 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 [**FuturesAccount**](FuturesAccount.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryAccountBook > []FuturesAccountBook ListDeliveryAccountBook(ctx, settle, optional) Query account book ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListDeliveryAccountBookOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryAccountBookOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **from** | **optional.Int64**| Start timestamp | **to** | **optional.Int64**| End timestamp | **type_** | **optional.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 | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliveryAccountBook(ctx, settle, 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 [**[]FuturesAccountBook**](FuturesAccountBook.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryPositions > []Position ListDeliveryPositions(ctx, settle) List all positions of a user ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliveryPositions(ctx, settle) 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 [**[]Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetDeliveryPosition > Position GetDeliveryPosition(ctx, settle, contract) Get single position ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract result, _, err := client.DeliveryApi.GetDeliveryPosition(ctx, settle, contract) 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 [**Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateDeliveryPositionMargin > Position UpdateDeliveryPositionMargin(ctx, settle, contract, change) Update position margin ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **change** | **string**| Margin change. Use positive number to increase margin, negative number otherwise. | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract change := "0.01" // string - Margin change. Use positive number to increase margin, negative number otherwise. result, _, err := client.DeliveryApi.UpdateDeliveryPositionMargin(ctx, settle, contract, change) 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 [**Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateDeliveryPositionLeverage > Position UpdateDeliveryPositionLeverage(ctx, settle, contract, leverage) Update position leverage ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **leverage** | **string**| New position leverage | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract leverage := "10" // string - New position leverage result, _, err := client.DeliveryApi.UpdateDeliveryPositionLeverage(ctx, settle, contract, leverage) 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 [**Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateDeliveryPositionRiskLimit > Position UpdateDeliveryPositionRiskLimit(ctx, settle, contract, riskLimit) Update position risk limit ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **riskLimit** | **string**| New position risk limit | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract riskLimit := "10" // string - New position risk limit result, _, err := client.DeliveryApi.UpdateDeliveryPositionRiskLimit(ctx, settle, contract, riskLimit) 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 [**Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryOrders > []FuturesOrder ListDeliveryOrders(ctx, settle, status, optional) List futures orders Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **status** | **string**| Only list the orders with this status | **optional** | **ListDeliveryOrdersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryOrdersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract | **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] **lastId** | **optional.String**| Specify list staring point using the `id` of last record in previous list-query results | **countTotal** | **optional.Int32**| Whether to return total number matched. Default to 0(no return) | [default to 0] ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency status := "open" // string - Only list the orders with this status result, _, err := client.DeliveryApi.ListDeliveryOrders(ctx, settle, status, 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 [**[]FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CreateDeliveryOrder > FuturesOrder CreateDeliveryOrder(ctx, settle, futuresOrder) Create a futures order Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **futuresOrder** | [**FuturesOrder**](FuturesOrder.md)| | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency futuresOrder := gateapi.FuturesOrder{} // FuturesOrder - result, _, err := client.DeliveryApi.CreateDeliveryOrder(ctx, settle, futuresOrder) 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 [**FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelDeliveryOrders > []FuturesOrder CancelDeliveryOrders(ctx, settle, contract, optional) Cancel all `open` orders matched Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **CancelDeliveryOrdersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a CancelDeliveryOrdersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **side** | **optional.String**| All bids or asks. Both included if not specified | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT_20200814" // string - Futures contract result, _, err := client.DeliveryApi.CancelDeliveryOrders(ctx, settle, contract, 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 [**[]FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetDeliveryOrder > FuturesOrder GetDeliveryOrder(ctx, settle, orderId) Get a single order Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Retrieve the data of the order with the specified ID | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency orderId := "12345" // string - Retrieve the data of the order with the specified ID result, _, err := client.DeliveryApi.GetDeliveryOrder(ctx, settle, orderId) 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 [**FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelDeliveryOrder > FuturesOrder CancelDeliveryOrder(ctx, settle, orderId) Cancel a single order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Retrieve the data of the order with the specified ID | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency orderId := "12345" // string - Retrieve the data of the order with the specified ID result, _, err := client.DeliveryApi.CancelDeliveryOrder(ctx, settle, orderId) 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 [**FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetMyDeliveryTrades > []MyFuturesTrade GetMyDeliveryTrades(ctx, settle, optional) List personal trading history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **GetMyDeliveryTradesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a GetMyDeliveryTradesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract | **order** | **optional.Int64**| Futures order ID, return related data only if specified | **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] **lastId** | **optional.String**| Specify list staring point using the `id` of last record in previous list-query results | **countTotal** | **optional.Int32**| Whether to return total number matched. Default to 0(no return) | [default to 0] ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.GetMyDeliveryTrades(ctx, settle, 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 [**[]MyFuturesTrade**](MyFuturesTrade.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryPositionClose > []PositionClose ListDeliveryPositionClose(ctx, settle, optional) List position close history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListDeliveryPositionCloseOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryPositionCloseOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliveryPositionClose(ctx, settle, 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 [**[]PositionClose**](PositionClose.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliveryLiquidates > []FuturesLiquidate ListDeliveryLiquidates(ctx, settle, optional) List liquidation history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListDeliveryLiquidatesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliveryLiquidatesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **at** | **optional.Int32**| Specify a liquidation timestamp | [default to 0] ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliveryLiquidates(ctx, settle, 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 [**[]FuturesLiquidate**](FuturesLiquidate.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListDeliverySettlements > []DeliverySettlement ListDeliverySettlements(ctx, settle, optional) List settlement history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListDeliverySettlementsOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListDeliverySettlementsOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **at** | **optional.Int32**| Specify a settlement timestamp | [default to 0] ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency result, _, err := client.DeliveryApi.ListDeliverySettlements(ctx, settle, 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 [**[]DeliverySettlement**](DeliverySettlement.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListPriceTriggeredDeliveryOrders > []FuturesPriceTriggeredOrder ListPriceTriggeredDeliveryOrders(ctx, settle, status, optional) List all auto orders ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **status** | **string**| Only list the orders with this status | **optional** | **ListPriceTriggeredDeliveryOrdersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListPriceTriggeredDeliveryOrdersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **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 ```golang 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", } ) settle := "usdt" // string - Settle currency status := "status_example" // string - Only list the orders with this status result, _, err := client.DeliveryApi.ListPriceTriggeredDeliveryOrders(ctx, settle, status, 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 [**[]FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CreatePriceTriggeredDeliveryOrder > TriggerOrderResponse CreatePriceTriggeredDeliveryOrder(ctx, settle, futuresPriceTriggeredOrder) Create a price-triggered order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **futuresPriceTriggeredOrder** | [**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md)| | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency futuresPriceTriggeredOrder := gateapi.FuturesPriceTriggeredOrder{} // FuturesPriceTriggeredOrder - result, _, err := client.DeliveryApi.CreatePriceTriggeredDeliveryOrder(ctx, settle, futuresPriceTriggeredOrder) 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 [**TriggerOrderResponse**](TriggerOrderResponse.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelPriceTriggeredDeliveryOrderList > []FuturesPriceTriggeredOrder CancelPriceTriggeredDeliveryOrderList(ctx, settle, contract) Cancel all open orders ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.DeliveryApi.CancelPriceTriggeredDeliveryOrderList(ctx, settle, contract) 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 [**[]FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetPriceTriggeredDeliveryOrder > FuturesPriceTriggeredOrder GetPriceTriggeredDeliveryOrder(ctx, settle, orderId) Get a price-triggered order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Retrieve the data of the order with the specified ID | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency orderId := "orderId_example" // string - Retrieve the data of the order with the specified ID result, _, err := client.DeliveryApi.GetPriceTriggeredDeliveryOrder(ctx, settle, orderId) 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 [**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelPriceTriggeredDeliveryOrder > FuturesPriceTriggeredOrder CancelPriceTriggeredDeliveryOrder(ctx, settle, orderId) cancel a price-triggered order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Retrieve the data of the order with the specified ID | ### Example ```golang 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", } ) settle := "usdt" // string - Settle currency orderId := "orderId_example" // string - Retrieve the data of the order with the specified ID result, _, err := client.DeliveryApi.CancelPriceTriggeredDeliveryOrder(ctx, settle, orderId) 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 [**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)