GTT order through APIv2

Is it possible to place GTT order through the APIv2?

  1. Why is the following throwing UDAPI100038 error? Symbol is GodrejInd. I am trying to test order placement script in python? Market is closed now, so setting is_amo to True
url = "https://api.upstox.com/v2/order/place"

headers = {
    'Authorization': f'Bearer {My-access-token}',
    'accept'       : 'application/json',
    'content-type' : 'application/json'
}
params = {
        "quantity"          : 1,
        "product"           : "D",
        "validity"          : "DAY",
        "price"             : 620,
        "tag"               : "string",
        "instrument_token"  : 'NSE_EQ|INE233A01035',
        "order_type"        : "LIMIT",
        "transaction_type"  : "BUY",
        "disclosed_quantity": 0,
        "trigger_price"     : 0,
        "is_amo"            : True
    }
response = requests.post(url, headers=headers, params=params)
response_json = json.loads(response.text)
print(response_json)  # return status 'errorCode': 'UDAPI100038', 'message': 'Invalid input passed to the API', 'propertyPath': None, 'invalidValue': None,

Pl. clarify both points. Thanks in advance.

1 Like

Please verify the correctness of the code. Also, I have renamed the ā€˜params’ variable to ā€˜data.’ Please ensure that the code provided below has been tested:

data = {
    "quantity": 1,
    "product": "D",
    "validity": "DAY",
    "price": 620,
    "tag": "string",
    "instrument_token": 'NSE_EQ|INE233A01035',
    "order_type": "LIMIT",
    "transaction_type": "BUY",
    "disclosed_quantity": 0,
    "trigger_price": 0,
    "is_amo": True
}

response = requests.post(url, headers=headers, json=data)

Currently, it is not possible to place a GTT (Good Till Triggered) order via API v2. We are actively working on enabling GTT functionality within the V2 API. Updates will be provided to you as soon as it becomes available.

I hope the information above is helpful.

Hello Upstox API Dev Team,
cc @Pradeep_Jaiswar

Do we have any updates on this feature yet?
GTT order through APIv2

Not yet.As of now, I don’t have any ETA for this. We will update this post once we have more information.

1 Like