Cancel Order
When the order you've placed is still being processed or has not yet been completed, you can cancel it at any time if needed.
Note
If your app type is partner you will not be able to call this API. Please go to the EaseAPI For Business section to see how partners can use EaseAPI.
Sample code¶
curl --location 'https://easeapi.venturasecurities.com/trade/v1/cancel' \
--header 'x-client-id: AA0605' \
--header 'x-app-key: 8ab5rt7yp2lm9qw4s1ex' \
--header 'authorization: Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...' \
--header 'Content-Type: application/json' \
--data '{
"order_no": "1191250120123"
}'
import requests
import json
url = "https://easeapi.venturasecurities.com/trade/v1/cancel"
payload = json.dumps({
"order_no": "1191250120123"
})
headers = {
'x-client-id': 'AA0605',
'x-app-key': '8ab5rt7yp2lm9qw4s1ex',
'authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
"order_no": "1191250120123"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://easeapi.venturasecurities.com/trade/v1/cancel',
headers: {
'x-client-id': 'AA0605',
'x-app-key': '8ab5rt7yp2lm9qw4s1ex',
'authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response¶
{
"client_id": "AA0605",
"order_no": "1191250120123",
"message": "Order cancellation request submitted successfully. Your Order Ref No. 1191250120123",
"status": "success"
}
Request Parameters¶
Parameter | Description |
---|---|
order_no |
This is the unique order number provided for cancelling the order |
Response Parameters¶
Parameter |
Description |
---|---|
client_id |
The client id of the user who cancelled the order |
order_no |
his is the order number of the order that was cancelled |
message |
If there was an error during the cancellation process, this message provides a reason for the failure |
status |
Indicates the status of the order cancellation process. It can be either "success" or "error" |