Issue while modifying a GTT order via API

To modifiy a GTT order via API:

Do we have to pass all the rules (ENTRY, TARGET, STOPLOSS).

I just want to update the stoploss here, please assist.

Hi @MUKESH_7659293,

Even if you intend to modify only the stop-loss leg of the GTT order, you must also include the entry rule and the target rule (if a target rule was specified when placing the order).

Thank you!

@Ketan Thanks for quick revert.

But here, the Entry leg order is already completed.

Yes, @MUKESH_7659293, even if the entry leg has been completed, you must include the entry order in the request payload when modifying a GTT order.

Thank you!

@Ketan
I tried, following:

curl --location 'https://api.upstox.com/v3/order/gtt/modify' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: ••••••' \
--header 'Cookie: __cf_bm=dQ8EXqttKErQgAz4l.XL8AFAPrvH8DQR2SmmrTCbd2Q-1741319838-1.0.1.1-QZwzPF7y1dCV6z65OJ72sQL5KMai2qZtPKh_hHsQZtb2yaJFbejK.c1fT.cdTpJm; _cfuvid=A.PzRIcOyydZQhHEM5TGTHq8WzySAz4PnUa.TaLyAkI-1741319838017-0.0.1.1-604800000' \
--data '{
  "type": "MULTIPLE",
  "quantity": 75,
  "gtt_order_id": "GTT-C25070300020498",
  "rules": [
    {
      "strategy": "ENTRY",
      "trigger_type": "IMMEDIATE",
      "trigger_price": 89
    },
    {
      "strategy": "TARGET",
      "trigger_type": "IMMEDIATE",
      "trigger_price": 51
    },
    {
      "strategy": "STOPLOSS",
      "trigger_type": "IMMEDIATE",
      "trigger_price": 95
    }
  ]
}'

But getting following response:

{
    "status": "error",
    "errors": [
        {
            "errorCode": "UDAPI100012",
            "message": "Invalid Endpoint",
            "propertyPath": null,
            "invalidValue": null,
            "error_code": "UDAPI100012",
            "property_path": null,
            "invalid_value": null
        }
    ]
}

It looks like you’re making a POST request, but the modify endpoint requires a PUT request. This is why you’re encountering an “invalid endpoint” error.

Please refer to the example codes for placing, modifying, and canceling orders here:
Modify GTT Order Example

Thanks!

In the API doc, it still still showing as POST.
Please correct it.

Also, when I post a put request for GTT order modification, whats the role of Entry Rule here?

Is there any validation check or will it be simply ignored if my entry leg is completed?

Hi @MUKESH_7659293, in this case entry leg payload is simply ignored.