Skip to content

Modify Order

While an order is still being processed or hasn't been fully executed yet, you can change certain details such as the price or quantity. To make these changes, ensure you use the correct order type in the web address.

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/modify' \
--header 'x-client-id: AA0605' \
--header 'x-app-key: 8ab5rt7yp2lm9qw4s1ex' \
--header 'authorization: Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...' \
--header 'Content-Type: application/json' \
--data '{
    "order_type": "LMT",
    "quantity": 1,
    "price": 1220.0,
    "trigger_price": 0.0,
    "disc_quantity": 0,
    "remarks": "",
    "order_no": "1191250120123",
    "validity": "DAY"
}'
import requests
import json

url = "https://easeapi.venturasecurities.com/trade/v1/modify"
payload = json.dumps({
    "order_type": "LMT",
    "quantity": 1,
    "price": 1220.0,
    "trigger_price": 0,
    "disc_quantity": 0,
    "remarks": "",
    "order_no": "1191250120123",
    "validity": "DAY"
})
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_type": "LMT",
    "quantity": 1,
    "price": 1220.0,
    "trigger_price": 0,
    "disc_quantity": 0,
    "remarks": "",
    "order_no": "1191250120123",
    "validity": "DAY"
});

let config = {
    method: 'post',
    maxBodyLength: Infinity,
    url: 'https://easeapi.venturasecurities.com/trade/v1/modify',
    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 modification request submitted successfully. Your Order Ref No. 1191250120123",
    "status": "success"
}

Request parameters

Parameter
Description
order_no This is the order number of the order you want to modify
order_type This parameter specifies the type of order. It can be MKT for market orders, SLM for stop-loss market orders, SLL for stop-loss limit orders, and LMT for limit orders
quantity Use this parameter to set a new quantity for the open order
price This parameter allows you to set a new limit price for the open order
trigger_price If the order type is SLM, SLL, this parameter sets a new trigger price for the order
disc_quantity Use this parameter to set a new disclosed quantity for the open order
remarks This parameter allows you to set new remarks for the open order

Response Parameter

Parameter
Description
client_id The client id of the user who placed the order
order_no This is the order number of the order that was modified
message This is a message received when the order modification request is successfully processed
status Indicates the status of the order modification process. It can be either "success" or "error"