Skip to main content

Cancel Order Sandbox Enabled Deprecated

API to cancel an open or pending which can be applied to both After Market Orders (AMO) and regular orders. It may also serve to exit a Cover Order (CO).

Request

curl --location --request DELETE 'https://api-hft.upstox.com/v2/order/cancel?order_id=240108010445130' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

For additional samples in various languages, please refer to the Sample code section on this page.


Query Parameters

NameRequiredTypeDescription
order_idtruestringThe order ID for which the order must be cancelled. For the regex pattern applicable to this field, see the Field Pattern Appendix.
Responses

Response Body

{
"status": "success",
"data": {
"order_id": "1644490272000"
}
}
NameTypeDescription
statusstringA string indicating the outcome of the request. Typically success for successful operations.
dataobjectResponse data for Cancel order request
data.order_idstringReference order ID

Sample Code

Cancel an open order

curl --location --request DELETE 'https://api-hft.upstox.com/v2/order/cancel?order_id=240108010445130' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
Loading...