Skip to Main Content
POST/NorenWClientAPI/GetEnabledGTTs

Get Enabled GTT Orders

Fetch the alert types (ai_t values) enabled for your account — call this before Place GTT Order / Set Alert so you send a supported ai_t.

API Endpoint

MethodPOST
URLhttps://api.shoonya.com/NorenWClientAPI/GetEnabledGTTs
Content-Typeapplication/x-www-form-urlencoded
PayloadjData=<JSON payload>&jKey=<AccessToken>
Naming vs. behaviorThe endpoint name says "GTTs" but the response is a list of enabled alert types (ai_t values), used by both Place GTT Order and Set Alert — it does not return your pending GTT orders (that's Get Pending GTT Order). This same endpoint is what "Get Enabled Alert Types" refers to in the Alerts section.

Parameters

FieldTypeRequiredDescription
uidstringRequiredUser ID of the logged-in user.

Request Examples

import requests, json

payload = {"uid": "AB1234"}
data = f"jData={json.dumps(payload)}&jKey={accessToken}"

response = requests.post(
    "https://api.shoonya.com/NorenWClientAPI/GetEnabledGTTs",
    data=data,
)
result = response.json()
alert_types = [row["ai_t"] for row in result.get("ai_ts", [])]
print("Enabled alert types:", alert_types)
const payload = { uid: "AB1234" };
const data = `jData=${JSON.stringify(payload)}&jKey=${accessToken}`;

const res = await fetch("https://api.shoonya.com/NorenWClientAPI/GetEnabledGTTs", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: data,
});
const result = await res.json();
console.log("Enabled alert types:", (result.ai_ts || []).map(r => r.ai_t));
curl -X POST https://api.shoonya.com/NorenWClientAPI/GetEnabledGTTs \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode 'jData={"uid":"AB1234"}' \
  --data-urlencode "jKey=$ACCESS_TOKEN"

Response

json
// Success
{
  "stat": "OK",
  "request_time": "04062021121503",
  "ai_ts": [
    { "ai_t": "ATP" },
    { "ai_t": "LTP" }
  ]
}

// Failure
{
  "stat": "Not_Ok",
  "emsg": "Session Expired : Invalid Session Key"
}
FieldDescription
statOK or Not_Ok.
ai_tsArray of { ai_t } objects — the alert types your account can use in Place GTT Order and Set Alert.
emsgPresent only on failure.

Best Practices

  • Cache the result rather than calling this before every Place GTT Order / Set Alert call — enabled alert types change rarely, if ever, for a given account.
  • Validate any hardcoded ai_t constant (like "LTP") against this endpoint at startup rather than assuming it's always enabled — account-level differences are the whole reason this call exists.
  • Don't confuse this with a list of your own live GTT orders — for that, use Get Pending GTT Order instead.