Sync GTD Orders
📜 Sync GTD Order Request​
| Field | Details |
|---|---|
| API Name | SyncGTDOrders |
| URL Format | <protocol>://<domain name:port>/<VirtualDir>/<URL> |
| Example URL | https://localhost:8080/OTPA/V1/SyncGTDOrders |
| Description | Syncs all GTD orders available in the system. Once the request is received, the system sends state‑based GTD order information messages. The request must include jToken received from the Authentication API response. |
📝 Sync GTD Order Request Parameters​
| Parameter | Data Type | Description |
|---|---|---|
| jMessageType | varchar(15) | Must be sent as SYNC_GTD_ORDER_REQ |
| jManagerID | varchar(50) | Manager Identification Number |
| jCustomerId | varchar(50) | Customer ID assigned to the user |
| jExchange | int | Exchange identifier |
| jToken | varchar(512) | Authentication token received from Authentication API |
| jEntrySequenceNumber | int64 | Last received sequence number (default = 0 if not provided) |
| jRequestID | varchar(255) | Echo back field |
Example Sync GTD Order Request​
{
"jMessageType": "SYNC_GTD_ORDER_REQ",
"jManagerID": "<MANAGER1>",
"jCustomerId": "<MEMBER>",
"jToken": "<Token received in the Authentication Response>",
"jEntrySequenceNumber": "<max sequence no>",
"jRequestID": "<Echo back field>"
}
💬 Sync GTD Order Response​
The response contains the following parameters:
| Parameter | Data Type | Description |
|---|---|---|
| jManagerId | varchar(50) | User ID assigned to the user |
| jCustomerId | varchar(50) | Customer ID assigned to the user |
| jLastSyncedPacket | int | Indicates if this is the last packet (1 = last packet) |
| jNoOfRecords | int | Number of GTD order records in the response |
| jOrderMessage | GTD Order Detail Structure (array) | Array containing GTD order details, with size equal to jNoOfRecords |
| jRequestID | varchar(255) | Echo‑back field |
| jResponseID | varchar(255) | System‑generated alphanumeric ID |
📝 GTD Order Detail Structure​
Each entry inside jOrderMessage contains the following fields:
| Parameter (Key) | Data Type | Description |
|---|---|---|
| Order Number | int | Unique order number |
| Cli Order Number | int | Gateway/Client order number (system‑generated) |
| Exchange | varchar(10) | Exchange |
| Scrip Token | int | Scrip token |
| Symbol | float | Exchange‑provided security scrip name |
| Series | varchar(3) | Exchange‑provided security series |
| InstrumentName | varchar(20) | Instrument name. Valid values: • Equity = blank • Future Index = FUTIDX • Interest Rate Future = FUTINT • Future Stock = FUTSTK • Option Index = OPTIDX • Option Stock = OPTSTK • MCX/NCDEX Futures = FUTCOM • MCX Spot = COM • NCDEXSpot = COMDTY • NSE Currency Future = FUTCUR, FUTIRD, FUTIRT,OPTCUR • NSE Currency Spot = INDEX, UNDCUR, UNDIRD, UNDIRT |
| Expiry Date | varchar(10) | Expiry date (ddMMMyyyy, e.g., 24JUN2004). Applicable for F&O only; otherwise blank. |
| Strike Price | float | Strike price (in rupees). Applicable for options only; otherwise -1. |
| Option Type | varchar(2) | Option type; applicable for options only; blank otherwise. |
| Buy Sell | int | Buy/Sell flag: • 1 → Buy• 2 → Sell |
| Order Original Qty | int | Original order quantity |
| Pending Qty | int | Pending quantity |
| TradedQTY | int | Traded quantity |
| DQ | int | Disclosed quantity |
| Order Price | float | Order price (in rupees) |
| Trigger Price | float | Trigger price (in rupees) |
| Order Type | varchar(10) | Order type |
| Order Status | varchar(15) | Order status |
| Reason | varchar(300) | Reason for rejection (if applicable) |
| Order Validity | varchar(100) | Order validity |
| Pro/Cli | int | Participant flag: • 1 → CLI• 2 → PRO |
| User ID | varchar(10) | Client code (blank for PRO users) |
| DealerCode | varchar(5) | Unique user identification code |
| Part Code | varchar(12) | Participant code; otherwise blank |
| Order Entry Time | varchar(10) | Order entry timestamp (e.g., 15Jun2018 15.25.15) |
| Last Modified Time | varchar(10) | Last modified timestamp (e.g., 15Jun2018 15.25.15) |
| Alias | varchar(5) | Alias ID; blank if not applicable |
| Product | varchar(5) | Product type of the order |
| Initiated By | varchar(25) | Application that initiated the order (e.g., ADMIN, NET) |
| Modified By | varchar(25) | Application that modified the order |
| Initiated By User Id | varchar(10) | User ID who initiated the order |
| Modified By User Id | varchar(10) | User ID who modified the order |
| Leg Indicator | int | Spread leg indicator |
| LocationID | varchar(5) | Location ID (PIN + NSECTCLBRANCH ID + NSECTCLID + ALGO FLAG + VENDOR CODE) |
| User Remarks | varchar(50) | User‑provided remarks |
| Misc | varchar(50) | Misc values: • SPO-LMT• SPO-MKT• PO-MKT• PO-LMT |
| SpreadFlag | int | Spread flag: • 1 → Spread• 0 → Normal |
| Spread Price | float | Spread price (in rupees) |
| AMO Order ID | varchar(50) | Order ID for AMO / EqGTD orders; otherwise blank |
| SequenceNo | int64 | Incremental sequence number |
| ManagerId | int | Manager ID |
| Days | int | Number of days (for GTD validity) |
| GTDOrderStatus | int | GTD order status |
| UniqueCode | varchar(12) | Alphanumeric value with special characters |
Example Response​
{
"jData": {
"ManagerID": "KOTAL_10.0.0.1",
"CustomerId": "KOTAK",
"NoOfRecords": 6,
"OrderDetail": [
{ "MessageCode": 2000, "OrderNumber": 1, "...": "..." },
{ "MessageCode": 2000, "OrderNumber": 2, "...": "..." },
{ "MessageCode": 2000, "OrderNumber": 3, "...": "..." },
{ "MessageCode": 2000, "OrderNumber": 4, "...": "..." },
{ "MessageCode": 2000, "OrderNumber": 5, "...": "..." },
{ "MessageCode": 2000, "OrderNumber": 6, "...": "..." }
]
}
}