Skip to main content

Create Stop Limit

Type: POST Description: /future/trade/v1/entrust/create-profit


Limit Flow Rules

200/s/apikey


Parameters

NameTypeMandatoryDefaultDescriptionRanges
symbolstringFALSEN/ATrading pair
origQtyintegerTRUEQuantity (contracts)
triggerProfitPriceintegerTRUETake-profit trigger price
triggerStopPriceintegerTRUEStop-loss trigger price
expireTimeintegerTRUEExpiration time (timestamp)
positionSidestringTRUEPosition sideLONG; SHORT
profitDelegateOrderTypestringTRUETake-profit order typeLIMIT; MARKET
profitDelegateTimeInForcestringTRUETake-profit order time in forceGTC; FOK; IOC; GTX
profitDelegatePricenumberFALSETake-profit order price
stopDelegateOrderTypestringTRUEStop-loss order typeLIMIT; MARKET
stopDelegateTimeInForcestringTRUEStop-loss order time in forceGTC; FOK; IOC; GTX
stopDelegatePricenumberFALSEStop-loss order price

Request Example

curl -X POST "https://fapi.xt.com/future/trade/v1/entrust/create-profit" \
-H "validate-appkey: $APPKEY" # Required
-H "validate-timestamp: $TIMESTAMP" # Required
-H "validate-signature: $SIGNATURE" # Required
-H "Content-Type: application/x-www-form-urlencoded" # Required
-d "origQty=1" # Required
-d "triggerProfitPrice=2000" # Required
-d "triggerStopPrice=100" # Required
-d "expireTime=1739558400000" # Required (timestamp)
-d "positionSide=LONG" # Required
-d "profitDelegateOrderType=LIMIT" # Required
-d "profitDelegateTimeInForce=IOC" # Required
-d "stopDelegateOrderType=LIMIT" # Required
-d "stopDelegateTimeInForce=IOC" # Required
-d "symbol=btc_usdt"

Response Example

{
"error": {
"code": "",
"msg": ""
},
"msgInfo": "",
"result": true,
"returnCode": 0
}

Error Codes

Error CodeDescription
invalid_time_in_forceFailed to set time-in-force for TP/SL
invalid_paramsInvalid or missing parameters
invalid_quantity_scaleQuantity must be a positive integer
invalid_trigger_profit_priceInvalid take-profit trigger price
invalid_trigger_stop_priceInvalid stop-loss trigger price
quantity_can_not_less_thanOrder quantity is below the minimum limit
invalid_priceInvalid price setting
more_than_availableExceeds available quantity
trigger_profit_price_less_than_entry_priceTake-profit price must be higher than entry price (LONG)
trigger_profit_price_less_than_mark_priceTake-profit price must be higher than mark price (LONG)
trigger_profit_price_less_than_index_priceTake-profit price must be higher than index price (LONG)
trigger_profit_price_more_than_entry_priceTake-profit price must be lower than entry price (SHORT)
trigger_profit_price_more_than_mark_priceTake-profit price must be lower than mark price (SHORT)
trigger_profit_price_more_than_index_priceTake-profit price must be lower than index price (SHORT)
trigger_stop_price_less_than_entry_priceStop-loss price must be higher than entry price (SHORT)
trigger_stop_price_less_than_mark_priceStop-loss price must be higher than mark price (SHORT)
trigger_stop_price_less_than_index_priceStop-loss price must be higher than index price (SHORT)
trigger_stop_price_more_than_entry_priceStop-loss price must be lower than entry price (LONG)
trigger_stop_price_more_than_mark_priceStop-loss price must be lower than mark price (LONG)
trigger_stop_price_more_than_index_priceStop-loss price must be lower than index price (LONG)
user_can_not_tradeAccount prohibited from trading
sub_account_not_tradeSub-account not allowed to trade
user_can_not_open_positionAccount restricted from opening positions
invalid_symbolTrading pair does not exist
symbol_is_not_tradingTrading pair is not in trading state
symbol_is_not_open_positionTrading pair not open for position
The trading pair currently does not support placing orders through OpenAPIsymbol_not_support_openapi