Skip to main content

Close Positions

Close an open tracking position.

HTTP Request

POST /api/v1/copy/mix-trader/order-close-positions

Request Parameters

ParameterTypeRequiredDescription
trackingNostringYesPosition ID (tracking number)
symbolstringYesTrading pair symbol (e.g., BTCUSDT)
productTypestringYesProduct type. Only FUSD is supported
orderTypestringNoOrder type: LIMIT or MARKET. Default: MARKET
quantitystringNoClose quantity. Default: full position
pricestringConditionalClose price. Required for LIMIT orders

Request Example

curl -X POST "https://open-api.bydoxe.com/api/v1/copy/mix-trader/order-close-positions" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000" \
-H "Content-Type: application/json" \
-d '{
"trackingNo": "123456789",
"symbol": "BTCUSDT",
"productType": "FUSD",
"orderType": "MARKET",
"quantity": "0.5"
}'

Response Parameters

ParameterTypeDescription
codestringResponse code
msgstringResponse message
requestTimenumberRequest timestamp in milliseconds
dataobjectResponse data
> trackingNostringTracking number
> clientOidstringClient order ID

Response Example

{
"code": "00000",
"msg": "success",
"requestTime": 1763459280000,
"data": {
"trackingNo": "123456789",
"clientOid": "uuid-order-id"
}
}

Error Codes

CodeMessage
45001Parameter trackingNo cannot be empty
45001Parameter symbol cannot be empty
45001Parameter productType cannot be empty
45001Invalid productType
45001Parameter price is required for LIMIT orders
45001Invalid quantity parameter
45002User not found
45003Not a copy trader
45004Position not found
45006Order already in progress
50001Failed to get current price
50000System error