Professional Documents
Culture Documents
OMEx (Odin Message Extender) - API Documentation
OMEx (Odin Message Extender) - API Documentation
API DOCUMENTATION
Version: 1.0.0.11
OMEx (Odin Message Extender) – API Documentation
REVISION HISTORY
Name Date Version Rest Summary of changes
API
Version
Bhushit Anjaria 26/10/2018 1.0.0.0 1.0.0.0 Initial Draft Document
Bhushit Anjaria 27/11/2018 1.0.0.1 1.0.0.1 Added few columns in Trade response
and changed few element names
Bhushit Anjaria 12/12/2018 1.0.0.2 1.0.0.2 API for sync request is added in the
document
Bhushit Anjaria 17/01/2019 1.0.0.3 1.0.0.3 Multileg API added in the document
Dhanashree Gavade 14/06/2019 1.0.0.4 1.0.0.4 Position Conversion
User Status (Login/Market Allowed,
Active/Inactive user, CRP/CFT change,
Password change/Reset, Lock/Unclok,
User logout)
Market Status
Dhanashree Gavade 30/8/2019 1.0.0.5 1.0.0.5 GTD Order Reponses
GTD for sync request/response
Swapnil Nangare 27/09/2019 1.0.0.6 1.0.0.6 Client Order Number field description
updated
Online Stoploss Trigger Response
added
Dhanashree Gavade 15/01/2020 1.0.0.8 1.0.0.8 GTD Order Status table added in
Annexure
GTD Order Response field description
updated.
Note added for Surveillance Failed
orders.
Dhanashree Gavade 30/1/2020 1.0.0.9 1.0.0.9 Order Price added in Online Trade
Response and Sync Trade Response
Change in description of formatting of
Time parameter.
Dhanashree Gavade 03/03/2020 1.0.0.10 1.0.0.10 Sync Position Conversion Request
Sync Position Conversion Response
Dhanashree Gavade 12/02/2020 1.0.0.10 1.0.0.10 Unique Code added in all transactional
packet.
Dhanashree Gavade 22/09/2020 1.0.0.11 1.0.0.11 API Register Response changed.
HeartBeat packet
OMEx (Odin Message Extender) – API Documentation
REVIEW HISTORY
Reviewer Name Doc Version Date sent for Date Review Approved /
Reviewed review Filed Rejected (with
reasons)
Jey Ganesh 1.0.0.0 29/10/2018 30/10/2018 Approved
Jey Ganesh 1.0.0.1 27/11/2018 27/11/2018 Approved
Jey Ganesh 1.0.0.2 12/12/2018 12/12/2018 Approved
Jey Ganesh 1.0.0.3 17/01/2019 17/01/2019 Approved
Giridhar Nayak 1.0.0.4 15/06/2019 15/06/2019 Approved
Giridhar Nayak 1.0.0.5 30/08/2019 30/08/2019 Approved
Giridhar Nayak 1.0.0.6 28/09/2019 28/09/2019 Approved
Giridhar Nayak 1.0.0.7 04/10/2019 04/10/2019 Approved
Giridhar Nayak 1.0.0.8 15/01/2020 15/01/2020 Approved
Giridhar Nayak 1.0.0.9 31/1/2020 31/1/2020 Approved
Giridhar Nayak 1.0.0.10 14/02/2020 14/02/2020 Approved
Giridhar Nayak 1.0.0.11 23/09/2020 23/09/2020 Approved
OMEx (Odin Message Extender) – API Documentation
Although 63MT has made every effort to provide accurate information at the date of publication, it
does not give any representations or warranties as to the accuracy, reliability or completeness of the
information in this document. Accordingly, 63MT, its subsidiaries and their employees, officers and
contractors shall not, to the extent permitted by law, be liable for any direct or indirect loss arising in
any way (including by way of negligence) from or in connection with anything provided in or omitted
from this document or from any action taken, or inaction, in reliance on this document.
63MT reserves the right to amend details in this document at any time and without notice.
OMEx (Odin Message Extender) – API Documentation
Change Notification
This document is available from 63 Moons technologies Ltd. on a subscription basis. It is supplied to
Open Interface users as part of their contractual arrangements relating to the use of WEB REST API.
Updates to this Manual will be issued periodically to all manual holders incorporating notified changes
and referencing the revised version.
Change Implementation
In general, changes to Open Interface messages and values will be implemented by releasing a new
software version on the implementation date. Users will be required to move over to the new version
on the implementation date, and the old version will not be supported after that date. However, there
may be circumstances in which the previous version will be maintained for a short period to facilitate
the transition. This will be advised when the change is notified.
OMEx (Odin Message Extender) – API Documentation
CONTENTS
1 General Guidelines
1. The API call listed below will work on HTTP Request and Response basis. Each of the requests
and responses will be in specific JSON format.
2. JSON values in request and response are string values.
3. All the API requests should have the Request Id as part of the request body. ODIN TPA system
will echo back the request id in the response for the calling system to identify the
requests\transactions uniquely.
4. Request should contain the base64 encoded system access key (shall be shared manually) as a
part of request body and will be used as authentication for security.
5. API Calling format is as mentioned below
https://< domain name >/OTPA/V1/<apiname>
Method: POST
Domain_Name: This will be server details where the server is hosted.
6. Odin TPA system will expose the following REST API calls:
a. Authenticate
b. RegisterAPIRequest
c. LoginToWebSocket
7. Rest Request Parameters
Following are the parameters required for request in JSON format.
All the requests after the Authentication Request should contain the Authorization Token to be passed in
REST Request header.
Note:
➢ Authorization Token is the token which is received from OTPA as jToken in
Authentication Response (Refer: Authentication response in section 2.2).
➢ Authorization Token will be blank in case of Authentication Request.
8. In case online order and trade message send request to third party web hook is failed
then system would try to make an attempt to push messages to the web hook for ‘n’
(configurable) number of times. In case all the attempts to web hook are failed then
OTPA web service will declare this third-party app as disconnected and will not send
any further online order and trade messages. To start receiving online order and trade
messages third party system must resend authentication and registration request again.
9. Price will be multiplied by Decimal locator Provided by exchange in scrip master. For
example, for NSECDS & BSECDS price is multiplied by 10,000,000(1 Crore) and for
MCXSX Currency segment price is multiplied by 10,000 (10 thousand)
OMEx (Odin Message Extender) – API Documentation
2 Authentication
API Name Authenticate
URL <protocol>://<domain name>/<VirtualDir>/<URL>
Example:
https://localhost:8080/OTPA/V1/Authenticate
Description Invoke this API to get the authorization token to use any further API requests.
“API key” and “secret key” are required to generate the authorization token.
The authorization token is valid for one day i.e. till 11:59:59 PM on the day it
is created. The user must get a new authorization token every day and has to
use the latest token for the subsequent requests.
Example:
Request = {
jAPIKey: <API Key>,
jSecretKey: <Secret Key>,
jRequestID: < Echo back field >
}
OMEx (Odin Message Extender) – API Documentation
Example:
Response = {
jRequestID : <Echo back field>,
jResponseID : <System generated alpha numeric id>,
jStatuscode : <1= Success, -1 = Failure>,
jErrorString : <Free Flowing Error Message>,
jToken: <should be passed in further request. Valid till 11:59pm>,
}
OMEx (Odin Message Extender) – API Documentation
3.1 Register
API Name RegisterAPIRequest
URL <protocol>://<domain name>/<VirtualDir>/<URL>
Example:
https://localhost:8080/OTPA/V1/RegisterAPIRequest
Description This message is sent by the client for creating a session with the system. The trading
engine will authenticate the user by validating the request and respond with a
response message. Registration Request must contain jToken received in
Authentication Request response
Example:
request: {
jRequestID: <ServerID>,
jToken: <Token>,
jConnMode : <response_mode>,
URL: <Web hook URL>
}
OMEx (Odin Message Extender) – API Documentation
Example:
response: {
jRequestID: <ServerID>,
jResponseID: <response_id>,
jWebSocketDetail: <ws/wss>://<domain name / IP address>:<port>,
jStatuscode : <1= Success, -1 = Failure>,
jHeartbeatIntervalInSecs: <TimeInterval>,
jErrorString : <Free Flowing Error Message>
}
OMEx (Odin Message Extender) – API Documentation
Description This request is for checking socket connectivity. Once logon request is successful O
start sending online order and trade messages. Login Request must contain jToken
received in Authentication Request response
Example:
Socket Logon Request = {
jMessageType: “WEB_LOGON_REQ”,
jAPIKey: <API Key>,
jSecretKey: <Secret Key>,
jToken: <Token received in the Authentication Response>,
jRequestID: < Echo back field >
}
OMEx (Odin Message Extender) – API Documentation
Example:
Socket Logon Response = {
jMessageType: “WEB_LOGON_RES”,
jRequestID : <Echo back field>,
jResponseID : <System generated alpha numeric id>,
jStatuscode : <1= Success, -1 = Failure>,
jErrorString : <Free Flowing Error Message>
}
OMEx (Odin Message Extender) – API Documentation
TriggerPrice int Trigger Price at which Stop loss Order should be active in
market. This field is applicable only for a StopLoss order
Note: Consider order status of 2nd packet for status updation in case of Surveillance rejected order
OMEx (Odin Message Extender) – API Documentation
CPID varchar(6) CP Id
UCC varchar(6) Alias UCC Code
Product Varchar(5) ProductType of the order
InitiatedBy varchar(25) Initiated from application
ModifiedBy varchar(25) Modified from application
InitiatedByUserId varchar(25) Initiated from user id
ModifiedByUserId varchar(25) Modified from user id
LegIndicator varchar(25) Normal Order = Blank
Spread Order = Blank
MAIN LEG INDICATOR = 9;
SL LEG INDICATOR = 10;
PROFIT LEG INDICATOR = 11;
UserRemarks varchar(10) User Remarks
Misc varchar(10) Values will be:
SPO-LMT, SPO-MKT, PO-MKT, PO-LMT
7 Sync Orders
Description This request is for Sync all orders available in the system. On receiving Sync Order
request system will send state based order information messages. Sync Order
Request must contain jToken received in Authentication Request response
Example:
Socket Logon Request = {
jMessageType: “SYNC_ORDER_REQ”,
jManagerID: <MANAGER1>,
jCustomerId: <MEMBER>,
jToken: <Token received in the Authentication Response>,
jEntrySequenceNumber: <max sequence no>
jRequestID: < Echo back field >
}
OMEx (Odin Message Extender) – API Documentation
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 Future and option segment only. For other
blank
Strike Price float Exchange provided Strike price (in Rs.).
Applicable for options only. For other -1
Option Type varchar (2) Option Type Applicable for options only. For other blank
Buy Sell int Buy Sell Flag
Values:
1 – Buy
2 – Sell
Order Original Qty Int Original Quantity
Order Entry Time varchar (10) Order Entry Time in date – time – 15Jun2018 15.25.15
Last Modified Time varchar (10) Order Last Modified Date & time – 15 Jun 2018 15.25.15
AMO Order ID Varchar (50) Order id for AMO/ EqGTD orders otherwise blank
Example:
jData: {
"ManagerID": "KOTAL_10.0.0.1",
“NoOfRecords” : 6
“OrderDetail” : [
8 Sync Trades
Description This request is for Sync all trades available in the system. On
receiving Sync Trade request system will send trade information
messages. Sync Trade Request must contain jToken received in
Authentication Request response
Description This request is for Sync all multi leg orders available in the system.
On receiving Sync multi leg orders request system will send multi
leg orders information messages. Sync multi leg orders Request
must contain jToken received in Authentication Request response
10 Position Conversion
GTDOrderStatus int NA
MessageSequenceNumber Int64 Running Message Sequence Number. For order’s latest
status always consider max sequence number.
UniqueCode varchar(12) Alphanumeric value with special characters.
OMEx (Odin Message Extender) – API Documentation
Example:
jData: {
"MsgType": "USD_IND",
"MsgHeader" : {"ManagerId”:O1},
Parameter
Data Type Description
(Key)
MessageType Varchar(10) MKT_STAT
ManagerID Int Manager Id
BranchID varchar(25) Branch ID
1 – Normal Market Open
2 – Normal Market Close
3 – Pre-Open
4 - Pre-Open Close
5- Auction Market Open
6- Auction Market Close
7- Auction Market Open
8 - Post Trade / Close Open
9 - Post Trade / Close Close
10 - Special Market Open
Event Type int 11 - Special Market Close
TriggerPrice int Trigger Price at which Stop loss Order should be active in
market. This field is applicable only for a StopLoss order
Description This request is for Sync all GTD orders available in the system. On receiving Sync GTD
Order request system will send state based order information messages. Sync GTD
Order Request must contain jToken received in Authentication Request response
Example:
Socket Logon 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 >
}
OMEx (Odin Message Extender) – API Documentation
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 Future and option segment only. For other
blank
Strike Price float Exchange provided Strike price
(in Rs).
Applicable for options only. For other -1
Option Type varchar (2) Option Type Applicable for options only. For other blank
Buy Sell int Buy Sell Flag
Values:
1 – Buy
2 – Sell
Order Original Qty Int Original Quantity
Order Entry Time varchar (10) Order Entry Time in date – time – 15Jun2018 15.25.15
Last Modified Time varchar (10) Order Last Modified Date & time – 15 Jun 2018 15.25.15
AMO Order ID Varchar (50) Order id for AMO/ EqGTD orders otherwise blank
Example:
jData: {
"ManagerID": "KOTAL_10.0.0.1",
“NoOfRecords” : 6
“OrderDetail” : [
Description This request is for Sync all rejected orders available in the system. On receiving Sync
Rejected Order request system will send state based order information messages.
Sync Rejected Order Request must contain jToken received in Authentication
Request response
Example:
Socket Logon Request = {
jMessageType: “SYNC_ORDER_REQ”,
jManagerID: <MANAGER1>,
jCustomerId: <MEMBER>,
jToken: <Token received in the Authentication Response>,
jEntrySequenceNumber: <max sequence no>
jRequestID: < Echo back field >
}
OMEx (Odin Message Extender) – API Documentation
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 Future and option segment only. For other
blank
Strike Price float Exchange provided Strike price
(in Rs).
Applicable for options only. For other -1
Option Type varchar (2) Option Type Applicable for options only. For other blank
Buy Sell int Buy Sell Flag
Values:
1 – Buy
2 – Sell
Order Original Qty Int Original Quantity
Order Entry Time varchar (10) Order Entry Time in date – time – 15Jun2018 15.25.15
Last Modified Time varchar (10) Order Last Modified Date & time – 15 Jun 2018 15.25.15
AMO Order ID Varchar (50) Order id for AMO/ EqGTD orders otherwise blank
Example:
jData: {
"ManagerID": "KOTAL_10.0.0.1",
“NoOfRecords” : 6
“OrderDetail” : [
Description This Position Conversion request is for Sync all position conversion orders available in
the system. On receiving Sync Position Conversion Order request system will send
state based order information messages. Sync Position Conversion Order Request
must contain jToken received in Authentication Request response
Example:
Socket Logon Request = {
jMessageType: “SYNC_POS_CONV”,
jManagerID: <MANAGER1>,
jCustomerId: <MEMBER>,
jToken: <Token received in the Authentication Response>,
jEntrySequenceNumber: <max sequence no>
jRequestID: < Echo back field >
}
OMEx (Odin Message Extender) – API Documentation
MCXSpot = 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 Future and option segment only. For other
blank
Strike Price float Exchange provided Strike price
(in Rs).
Applicable for options only. For other -1
Option Type varchar (2) Option Type Applicable for options only. For other blank
Buy Sell int Buy Sell Flag
Values:
1 – Buy
2 – Sell
Order Original Qty Int Original Quantity
TradedQTY Int NA
DQ Int NA
Order Price Float NA
Last Modified Time varchar (10) Order Last Modified Date & time – 15 Jun 2018 15.25.15
Example:
jData: {
"ManagerID": "KOTAL_10.0.0.1",
“NoOfRecords” : 6
“OrderDetail” : [
17 HeartBeat
Example:
HeartBeat Packet = {
jMessageType: “HEARTBEAT”
}
OMEx (Odin Message Extender) – API Documentation
18 Annexure
MarketSegment ID’s:
Exchange Market Segment ID
NSE Cash 1
NSE Derivatives 2
BSE Cash 3
BSE Derivatives 4
MCX Futures 5
MCX Spot 6
NCDEX Futures 7
NCDEX Spot 8
MCX SX Currency Futures 11
MCX SX Currency SPOT 12
NSECDS Futures 13
NSECDS SPOT 14
MSX Cash 15
MSX Derivatives 16
BSE OFS 25
NSE-OFS 33
ICEX 34
BSECDS CUR 38
Option Type:
Parameter Parameter Name
CE European Call
PE European Put
CA American Call
PA American Put
OMEx (Odin Message Extender) – API Documentation
Order Type:
Abbreviation Description Value
RL Regular Lot Limit 1
RL MKT Regular Lot market 2
SL Stop Loss Limit 3
SL MKT Stop Loss market 4
OL Odd Lot 5
CA / AU Call Auction / Auction 7
BL Block Deal 8
Product Type:
Product type Value
Margin / Intraday M
DELIVERY / Carryforward D
MTF MF
PTST PT
MarginPlus MP
Bracket Order B
AMO Margin / AMO AM
Intraday
AMO Delivery / AMO AD
Carryforward
OFS O
OMEx (Odin Message Extender) – API Documentation
Validity:
Validity Value
DAY 1
GTD 2
GTC 3
IOC 4
EOSESS 1
EOTODY 2
EOSTLM 3
EOS 5
FOK 6
GTT 7
FAK 8
GTM 9
GTW 10
OMEx (Odin Message Extender) – API Documentation
AON 11
ATBEST 12
Order Status:
Value Status
1 CLIENT XMITTED
2 GATEWAY XMITTED
3 OMS XMITTED
4 EXCHANGE XMITTED
5 PENDING
6 CANCELLED
7 EXECUTED
8 ADMIN PENDING
9 GATEWAY REJECT
10 OMS REJECT
11 ORDER ERROR
12 FROZEN
13 M.PENDING [MINIADMINPENDING]
14 A.ACCEPT [ADMINACCEPT]
15 A.REJECT [ADMINREJECT]
16 A.MODIFY [ADMINMODIFY]
17 A.CANCEL [ADMINCANCEL]
18 AMO SUBMITTED
19 AMO CANCELLED
20 COMPLETED
21 STOPPED
22 CONVERTED
OMEx (Odin Message Extender) – API Documentation
User Status:
Parameter Parameter Name
A Active
V Inactive
S Suspend