Modify Bracket/Cover Order


PURPOSE


This method allows the developer to modify BO/CO order with advance options. You can place, modify and cancels a BO/CO order with the help of this API. Similar to most of the other APIs, it also requires an active session and you need to be logged in to use it. By taking Place/Modify/Cancel decision, exchange, exchange type and other order details as input parameters, it returns client code, order ids, scrip code and status of execution in the response.

Request Method: POST

Request format: JSON

Request Header:

Content-Type: application/json

Ocp-Apim-Subscription-Key:
to be provided after registration


REQUEST BODY


HEADER

Field Name Description Data Type
(max length)
Validation Sample Value
appName App Name provided at the time of registration String Cannot be empty. IIFLMarDEMO
appVer Developer App Version String Cannot be empty. 1.0
Key UserKey generated at the time of registration String Cannot be empty. ABpyyGUh1nsbesSlup3VKURkI4tQDe8y
osName Channel of order String Cannot be empty. WEB, Android, iOS
requestCode Request Code of the API called String Cannot be empty. IIFLMarRQOrdReq
userId User ID generated at the time of registration String Cannot be empty. ZkhghN5uKj
password Password generated at the time of registration String Cannot be empty. lfjnfS7rHGjEFzZ3xJHKww==

BODY

Field Name Description Data Type
(max length)
Sample Value
ClientCode This is the client code String S0002
OrderRequesterCode Clientcode of customer String S0002
OrderFor P - Place
M - Modify
C - Cancels
String M
Exchange BSE-B
NSE-N
char N
ExchangeType CASH-C
DERIVATIVE-D
CURRENCY-U
char C
Price Initial rate of market double 2210
OrderID This is the system generated long 0
Qty This is the order traded quantity long 9
OrderDateTime This is system generated DateTime /Date(1557308002000)/
ScripCode This is the script code Long 2885
AtMarket True/False bool false
RemoteOrderID This is the System generated string 0
ExchOrderID This is the traded script order ID string 1100000000007917
DisQty DisQty long 0
StopLossPrice This is the Stop Loss of trade double 0
IsStopLossOrder IsStopLossOrder bool false
IOCOrder True
False
bool false
IsIntraday True
False
bool false
ValidTillDate This is the valid date of trade DateTime /Date(1557308057777+0530)/
AHPlaced Y-Yes
N-No
char N
PublicIP Public IP string 192.168.84.215
iOrderValidity Day = 0
GTD = 1
GTC = 2
IOC = 3
EOS = 4
VTD = 5
FOK = 6
Int16 0
TrailingSL This is the stop loss trading double 0.005
LegType LegType Int32 0
TMOPartnerOrderID TMOPartnerOrderID Int32 0
AppSource This is client AppSource code Int 89

REQUEST:

{
  "p_data": {
    "head": {
      "appName": "IIFLMarDUMMY",
      "appVer": "1.0",
      "key": "1234567890123456789",
      "osName": "Android",
      "requestCode": "IIFLMarRQAMSMOOrde",
      "userId": "abcd1234",
      "password": "wdafesfj123"
    },
    "body": {
      "ClientCode": "S0002",
      "OrderRequesterCode": "S0002",
      "OrderFor": "M",
      "Exchange": "N",
      "ExchangeType": "C",
      "ScripCode": 2885,
      "Price": 2210,
      "OrderID": 0,
      "OrderType": "buy",
      "Qty": 9,
      "OrderDateTime": "/Date(1557308002000)/",
      "AtMarket": false,
      "RemoteOrderID": "0",
      "ExchOrderID": "1100000000007917",
      "DisQty": 0,
      "IsStopLossOrder": false,
      "StopLossPrice": 0,
      "IOCOrder": false,
      "IsIntraday": false,
      "ValidTillDate": "/Date(1557308057777+0530)/",
      "AHPlaced": "N",
      "PublicIP": "192.168.84.215",
      "iOrderValidity": 0,
      "TrailingSL": 0.005,
      "LegType": 0,
      "TMOPartnerOrderID": 0
    }
  },
  "AppSource": 89
}

RESPONSE BODY


HEADER

Field Name Description Data Type
(max length)
List of Values Sample Value
responseCode This is the response code of API String - IIFLMarRQLoginForVendor
status This is the response code of API String 0
2
0
statusDescription This is the response code of API String 0 - Success
2 - Invalid head parameters
Success

BODY

Field Name Description Data Type
(max length)
List Values Sample Value
Status Returns the status of the response. Integer 0 :-Success
1:- Order information not found
-1:-Error while processing your request.
2:-Invalid Input Parameters. / This client is not mapped for login manager
-2:- 403 : Access denied
9:- Invalid session,
2:- This client is not mapped for login manager
0
Message Returns the status of the response. String A – Invalid Input Parameters
B – “ ”
C – Order information not found
D – Error while processing your request
E – Access Denied
G – The client is not mapped for login manager
“ ”
ClientCode This is the client code String S0002
LocalOrderID LocalOrderID UInt16 0
BrokerOrderID This is the system generated UInt32 770691
ExchOrderID This is the traded script order ID UInt64 1100000000007917
ExchType CASH-C
DERIVATIVE-D
CURRENCY-U
Char C
Exch BSE-B
NSE-N
Char N
RMSResponseCode This is the system generated Integer 0
Time Date/Time DateTime /Date(1604946600000+0530)/
ScripCode This is the script code Int32 2885

Success Response

{
  "body": {
    "BrokerOrderID": 770691,
    "ClientCode": "S0002",
    "Exch": "N",
    "ExchOrderID": 1100000000007917,
    "ExchType": "C",
    "LocalOrderID": 0,
    "Message": "",
    "RMSResponseCode": 0,
    "ScripCode": 2885,
    "Status": 0,
    "Time": "/Date(1604946600000+0530)/"
  },
  "head": {
    "responseCode": "IIFLMarRQAMSMOOrde",
    "status": "0",
    "statusDescription": "Success"
  }
}

Failure Response

{
  "body": {
    "BrokerOrderID": 0,
    "ClientCode": "S0002",
    "Exch": "N",
    "ExchOrderID": 0,
    "ExchType": "C",
    "LocalOrderID": 0,
    "Message": "Order information not found",
    "RMSResponseCode": 1,
    "ScripCode": 2885,
    "Status": 0,
    "Time": "/Date(1604989512128+0530)/"
  },
  "head": {
    "responseCode": "IIFLMarRQAMSMOOrde",
    "status": "0",
    "statusDescription": "Success"
  }
}

Failure Response

{
    "body": null,
    "head": {
        "responseCode": "IIFLMarRQAMSMOOrde",
        "status": "2",
        "statusDescription": "This client is not mapped for login manager"
    }
}