Skip to main content

Create Close Position Order

Create a specific close order

HTTP Request

POST /contract/v3/private/copytrading/order/close

Request Parameters

ParameterRequiredTypeComments
symboltruestringSymbol
orderLinkIdfalsestringUnique user-set order ID. Maximum length of 36 characters
parentOrderIdfalsestringRequired if not passing parentOrderLinkId
parentOrderLinkIdfalsestringRequired if not passing parentOrderId

Response Parameters

ParameterTypeComments
orderIdstringOrder ID
orderLinkIdstringUnique user-set order ID. Maximum length of 36 characters

Request Example

curl --location --request POST 'https://api-testnet.bybit.com/contract/v3/private/copytrading/order/close' \
--header 'X-BAPI-SIGN-TYPE: 2' \
--header 'X-BAPI-SIGN: XXXXX' \
--header 'X-BAPI-API-KEY: XXXXX' \
--header 'X-BAPI-TIMESTAMP: 1670831398044' \
--header 'X-BAPI-RECV-WINDOW: 5000' \
--header 'Content-Type: application/json' \
--data-raw '{"symbol":"BTCUSDT","parentOrderId":"cf252fd5-f25f-4623-9080-c60201b22575"}'

Response Example

{
"retCode": 0,
"retMsg": "success",
"result": {
"orderId": "419190fe-016c-469a-810e-936bef2f5d59",
"orderLinkId": ""
}
}