Irage Trading APIs Documentation
Overview
This document (Version 1.0) describes the REST APIs and websocket connections used for trading activities. All APIs return JSON-formatted responses and use standard HTTP response codes.
Login
To use these APIs, the user needs to create a developer account, and register their application on our portal.Upon successful registration, user can then login to website https://app.arrow.trade
and create an authentication token for use, the same can be then accessed via the auth API below
Order Management
Get Orders
API
Retrieve orders for a specific (ucc)
user.
- URL:
/v1/orders
- Method: GET
- URL Params:
-
Header : Authentication (Bearer Token)
-
Success Response:
- Code : 200
- Content: {orders[...]}
{
"success": true,
"message": "Orders retrieved ...",
"data": [
{
"ui_id": 2013,
"user_order_id": 1000006,
"exchg_order_id": "101000009",
"order_status": "STANDING",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "LIMIT",
"symbol": "MIDCPNIFTY25MAR8675CE",
"symbol_id": 35068,
"quantity": 6,
"disclosed_quantity": 0,
"price": 207845,
"avg_trade_price": 0,
"user_tag": "my_user_tag",
"remaining_quantity": 6,
"filled_qty": 0,
"oms_error_code": 0,
"oms_error_description": "",
"exchange_time": "",
"created_time": "2025-03-24 11:41:02.197656879 +0530 IST",
"updated_time": ""
}
],
"timestamp": {
"start_time": "2025-03-24T11:44:32.754177584+05:30",
"end_time": "2025-03-24T11:44:32.754408119+05:30"
}
}
- Error Response:
- Code:
404 NOT FOUND
-
Content:
{error :Order not found!.}
-
CURL
curl --request 'https://{HOST_NAME}/v1/orders\
--header 'Accept: application/json' \
--header 'Authorization: {{bearerToken}}'
Regular order parameters
These parameters are common across different order varieties.
Parameter | Type | Description |
---|---|---|
user_order_id | string | Unique client order ID |
exchg_order_id | string | The user/partner generated ID for tracking back |
order_status | enum string | PENDING : Order is pending due to OMS not respondingREJECTED : Order rejected by OMS due to incorrect quantity or priceCANCELLED : Order cancelled in exchangeTRADED : Order BUY/SELL from standing position |
exchange | string | Name of the exchange: NSE , BSE , MCX |
segment | string | Segment: FO , CM |
side | int32 | Side is 1 or 2 ,1 is use for BUY ,2 is use for SELL |
validity | string | Validity of order: DAY , IOC |
order_type | enum string | Order type: LIMIT , MARKET |
symbol | string | Symbol names where you can trade both regular shares and F&O, such as ACC , HDFC BANK , BANKNIFTY24O1651900CE |
symbol_id | string | Unique symbol ID |
quantity | int | Number of units in multiples of lot_size |
disclosed_quantity | int | Number of shares visible (Keep more than 30% of quantity) |
price | float32 | Price at which order is placed |
exchange_time | string | Timestamp at which the order was registered by the exchange |
created_time | string | Created time refers to the time when the order is placed |
updated_time | string | Updated time refers to the time when the order is updated |
avg_trade_price | float32 | Average trade price is the accumulated average price when multiple shares are traded at different prices |
user_tag | enum string | An optional tag to apply to an order to identify it (alphanumeric, max 20 chars) |
filled_qty | int | Filled quantity refers to the number of shares that have been traded |
oms_error_code | string | OMS Error code in case the order is REJECTED or FAILED |
oms_error_description | string | Description of error in case the order is REJECTED or FAILED |
Get Transaction Orders
API
Retrieve orders all the orders except STANDING
orders.
- URL:
/v1/orders/history
- Method: GET
- URL Params:
-
Header : Authentication (Bearer Token)
-
Success Response:
- Code : 200
- Content: {orders[...]}
{
"success": true,
"message": "Orders retrieved ...",
"data": {
"1010": [
{
"ui_id": 1010,
"user_order_id": 1000015,
"exchg_order_id": "101000027",
"order_status": "EXECUTED",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "LIMIT",
"symbol": "MIDCPNIFTY25MAR8675CE",
"symbol_id": 35068,
"quantity": 3,
"disclosed_quantity": 0,
"price": 207818,
"avg_trade_price": 0,
"user_tag": "my_user_tag",
"remaining_quantity": 2,
"filled_qty": 1,
"oms_error_code": 0,
"oms_error_description": "",
"exchange_time": "2025-03-24 12:00:33.613173550 +0530 IST",
"created_time": "2025-03-24 12:00:33.613173546 +0530 IST",
"updated_time": ""
},
{
"ui_id": 1010,
"user_order_id": 1000015,
"exchg_order_id": "101000027",
"order_status": "CANCELLED",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "LIMIT",
"symbol": "MIDCPNIFTY25MAR8675CE",
"symbol_id": 35068,
"quantity": 3,
"disclosed_quantity": 0,
"price": 207818,
"avg_trade_price": 0,
"user_tag": "",
"remaining_quantity": 2,
"filled_qty": 1,
"oms_error_code": 0,
"oms_error_description": "",
"exchange_time": "",
"created_time": "2025-03-24 12:00:33.613173546 +0530 IST",
"updated_time": ""
}
],
"1011": [
{
"ui_id": 1011,
"user_order_id": 1000016,
"exchg_order_id": "101000029",
"order_status": "EXECUTED",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "LIMIT",
"symbol": "MIDCPNIFTY25MAR8675CE",
"symbol_id": 35068,
"quantity": 4,
"disclosed_quantity": 0,
"price": 207827,
"avg_trade_price": 0,
"user_tag": "my_user_tag",
"remaining_quantity": 3,
"filled_qty": 1,
"oms_error_code": 0,
"oms_error_description": "",
"exchange_time": "2025-03-24 12:00:33.645264795 +0530 IST",
"created_time": "2025-03-24 12:00:33.645264787 +0530 IST",
"updated_time": ""
}
],
"timestamp": {
"start_time": "2025-03-24T11:44:32.754177584+05:30",
"end_time": "2025-03-24T11:44:32.754408119+05:30"
}
}
}
- Error Response:
- Code:
404 NOT FOUND
-
Content:
{error :Order not found!.}
-
CURL
curl --request 'https://{HOST_NAME}/v1/orders/history\
--header 'Accept: application/json' \
--header 'Authorization: {{bearerToken}}'
Regular order parameters
These parameters are common across different order varieties.
Parameter | Type | Description |
---|---|---|
UIID | int32 | UI unique ID |
user_order_id | string | Unique client order ID |
exchg_order_id | string | The user/partner generated ID for tracking back |
order_status | enum string | PENDING : Order is pending due to OMS not respondingREJECTED : Order rejected by OMS due to incorrect quantity or priceCANCELLED : Order cancelled in exchangeTRADED : Order BUY/SELL from standing position |
exchange | string | Name of the exchange NSE BSE MCX |
segment | string | Segment FO CM |
side | int32 | Side is 1 or 2 ,1 is use for BUY ,2 is use for SELL |
validity | string | Validity of order DAY IOC |
order_type | enum string | Order type LIMIT MARKET |
symbol | string | Symbol names where you can trade both regular shares and F&O, such as ACC HDFC BANK BANKNIFTY24O1651900CE |
symbol_id | string | Unique symbol ID |
quantity | int | Number of units in multiples of lot_size |
disclosed_quantity | int | Number of shares visible (Keep more than 30% of quantity) |
remaining_quantity | int | Number of quanties available after sell |
price | float32 | Price at which order is placed |
exchange_time | string | Timestamp at which the order was registered by the exchange |
created_time | string | Created time refers to the time when the order is placed |
updated_time | string | Updated time refers to the time when the order is updated |
avg_trade_price | float32 | Average trade price is the accumulated average price when multiple shares are traded at different prices |
user_tag | enum string | An optional tag to apply to an order to identify it (alphanumeric, max 20 chars) |
filled_qty | int | Filled quantity refers to the number of shares that have been traded |
oms_error_code | string | OMS Error code in case the order is REJECTED or FAILED |
oms_error_description | string | Description of error in case the order is REJECTED or FAILED |
Get Order By ID
Retrieves the details of a specific order by its unique order_id
.
API
- URL:
/v1/order/:order_id
- Method: GET
- URL Params:
-
Header : Authentication (Bearer Token)
-
Success Response:
- Code : 200
- Content: {order{...}}
{
"cl_ordID": 1000004,
"exchg_ordID": 200079008000007,
"order_status": "STANDING",
"exchange":"NSE",
"segment": "FO",
"side":1,
"validity":"DAY",
"order_type":"LIMIT",
"symbol": "BANKNIFTY24O1651900CE",
"symbol_id": 43767,
"quantity":3000,
"disclosed_quantity":1000,
"price": 250.45,
"exchange_time":"2025-03-24 12:00:33.613173558 +0530 IST",
"created_time": "2025-03-24 12:00:33.613173546 +0530 IST",
"updated_time": "2025-03-24 12:00:33.613173560 +0530 IST",
"avg_trade_price": 255.40,
"user_tag": "strategy_1",
"remaining_quantity": 500,
"filled_qty": 0,
"oms_error_code": "",
"oms_error_description": ""
}
- Error Response:
- Code:
401 Unauthorized
- Response:
{
"error": "Invalid credentials",
"status": "failure"
}
- CURL
curl --request 'https://{HOST_NAME}/v1/order/109357000724680\
--header 'Accept: application/json' \
--header 'Authorization: {{bearerToken}}'
Regular order parameters
These parameters are common across different order.
Parameter | Type | Description |
---|---|---|
user_order_id | string | Unique client order ID |
exchg_order_id | string | The user/partner generated ID for tracking back |
order_status | enum string | PENDING : Order is pending due to OMS not respondingREJECTED : Order rejected by OMS due to incorrect quantity or priceCANCELLED : Order cancelled in exchangeTRADED : Order BUY/SELL from standing position |
exchange | string | Name of the exchange NSE BSE MCX |
segment | string | Segment FO CM |
side | int32 | Side is 1 or 2 ,1 is use for BUY ,2 is use for SELL |
validity | string | Validity of order DAY IOC |
order_type | enum string | Order type LIMIT MARKET |
symbol | string | Symbol names where you can trade both regular shares and F&O, such as ACC HDFC BANK BANKNIFTY24O1651900CE |
symbol_id | string | Unique symbol ID |
quantity | int | Number of units in multiples of lot_size |
disclosed_quantity | int | Number of shares visible (Keep more than 30% of quantity) |
price | float32 | Price at which order is placed |
exchange_time | string | Timestamp at which the order was registered by the exchange |
created_time | string | Created time refers to the time when the order is placed |
updated_time | string | Updated time refers to the time when the order is updated |
avg_trade_price | float32 | Average trade price is the accumulated average price when multiple shares are traded at different prices |
user_tag | string | An optional tag to apply to an order to identify it (alphanumeric, max 20 chars) |
filled_qty | int | Filled quantity refers to the number of shares that have been traded |
oms_error_code | string | OMS Error code in case the order is REJECTED or FAILED |
oms_error_description | string | Description of error in case the order is REJECTED or FAILED |
Get Trades
Retrieve trades for a specific (ucc)
user.
API
- URL:
/v1/trades
- Method: GET
- URL Params:
-
Header : Authentication (Bearer Token)
-
Success Response:
- Code : 200
- Content: {trades[...]}
{
"success": true,
"message": "Trades retrieved ...",
"data": [
{
"ucc": "KESHAV",
"exchange_destination": "NSEFO",
"symbol_id": 35068,
"symbol_name": "MIDCPNIFTY25MAR8675CE",
"fill_price": 207818,
"fill_quantity": 1,
"side": 1,
"fill_id": 1,
"exchange_id": "101000003",
"leaves_qty": 0,
"order_type": "LIMIT",
"user_tag": ""
},
{
"ucc": "KESHAV",
"exchange_destination": "NSEFO",
"symbol_id": 35068,
"symbol_name": "MIDCPNIFTY25MAR8675CE",
"fill_price": 207827,
"fill_quantity": 1,
"side": 1,
"fill_id": 2,
"exchange_id": "101000005",
"leaves_qty": 0,
"order_type": "LIMIT",
"user_tag": ""
},
{
"ucc": "KESHAV",
"exchange_destination": "NSEFO",
"symbol_id": 35068,
"symbol_name": "MIDCPNIFTY25MAR8675CE",
"fill_price": 207908,
"fill_quantity": 1,
"side": 1,
"fill_id": 10,
"exchange_id": "101000023",
"leaves_qty": 0,
"order_type": "LIMIT",
"user_tag": ""
}
],
"timestamp": {
"start_time": "2025-03-24T11:42:30.746013089+05:30",
"end_time": "2025-03-24T11:42:30.746065217+05:30"
}
}
- Error Response:
- Code:
401 Unauthorized
- Response:
{
"error": "Invalid credentials",
"status": "failure"
}
- CURL
curl --request 'https://{HOST_NAME}/v1/trades \
--header 'Accept: application/json' \
--header 'Authorization: {{bearerToken}}'
Regular trades parameters
These parameters are common across different trades.
Parameter | Type | Description |
---|---|---|
symbol_id | string | Unique symbol ID |
exchange | string | Name of the exchange NSE BSE MCX |
segment | string | Segment FO CM |
side | int32 | Side is 1 or 2 ,1 is use for BUY ,2 is use for SELL |
symbol_name | string | Symbols on which you can trade both regular shares and F&O include ACC.NSE.EQ HDFCBANK.NSE.EQ andBANKNIFTY24O1651900CE |
price | float32 | Price at which order is placed |
fill_price | float32 | The price at which we should BUY or SELL the specified quantities |
quantity | int | Number of units in multiples of lot_size |
fill_quantity | int | Number of quanties BUY or SELL out of total quanties order |
leaves_qty | int | Number of remianing quanties after BUY or SELL |
fill_id | string | Trade specific identification generated by exchange |
order_id | string | Order specific identification generated by iRage |
order_type | enum string | There is two type of order MARKET and LIMIT |
fill_timestamp | string | Timestamp at which the trade was filled at the exchange |
created_time | string | Created time refers to the time when the order is placed |
exchange_time | string | Timestamp at which the order was registered by the exchange |
user_tag | string | An optional tag to apply to an order to identify it (alphanumeric, max 20 chars) |
Create Orders
Create new order for a specific (ucc)
user.
- Base URL:
v1/order
Create Normal Order
API
- Method: POST
- URL Params:
- Header : Authentication (Bearer Token)
- Body :
{}
{
"ui_id": 40098,
"price": 11026.35,
"quantity":5,
"symbol_id":35000,
"side": 1,
"exchange": "NSE",
"segment": "FO",
"update_type": "NEW_ORDER",
"order_type": "MARKET",
"user_tag":"HFTStrategy"
}
- Success Response:
- Code : 201
{
"success": true,
"message": "Order created ...",
"data": 40098,
"timestamp": {
"start_time": "2025-03-24T11:46:36.303115137+05:30",
"end_time": "2025-03-24T11:46:36.303249484+05:30"
}
}
- Error Response:
- Code:
400 Bad Request
-
Content:
{error :No Order Created!.}
-
CURL
curl --request POST 'https://{HOST_NAME}/v1/order' \
--header 'Authorization: {{bearerToken}}'
-header 'Content-Type: text/plain' \
--data '{
"ui_id": 40098,
"price": 1102635,
"quantity":5,
"symbol_id":35000,
"side": 1,
"exchange": "NSE",
"segment": "FO",
"update_type": "NEW_ORDER",
"order_type": "MARKET",
"user_tag":"HFTStrategy"
}'
Regular create order parameters
These parameters are common across different order varieties.
Parameter | Type | Description |
---|---|---|
symbol_id | string | Unique symbol ID |
exchange | string | Name of the exchange NSE BSE MCX |
segment | string | Segment FO CM |
price | float32 | Price at which order is placed |
quantity | int | Number of units in multiples of lot_size |
side | int32 | Side is 1 or 2 ,1 is use for BUY ,2 is use for SELL |
order_type | enum string | Order type LIMIT MARKET |
validity | string | Validity of order DAY IOC |
disclosed_quantity | int | Number of shares visible (Keep more than 30% of quantity) |
user_tag | enum string | An optional tag to apply to an order to identify it (alphanumeric, max 20 chars) |
Slice New Order
Slice new order for a specific (ucc)
user.
API
- URL:
v1/slice
- Method: POST
- URL Params:
- Header : Authentication (Bearer Token)
- Body :
{}
{
"symbol_id":"43767",
"exchange":"NSE",
"segment":"FO",
"price": 400.00,
"quantity":2,
"side": 1,
"slice_max_qty": 2000,
"slice_type": "IOC",
"slice_freq": "DAY",
"user_tag": "strategy_1"
}
- Success Response:
- Code : 201
{
"status": "success",
"data": {
"order_id": "151220000000000"
}
}
- Error Response:
- Code:
400 Bad Request
-
Content:
{error :No Order Created!.}
-
CURL
curl --request POST 'https://{HOST_NAME}/v1/orders/slice' \
--header 'Authorization: {{bearerToken}}'
-header 'Content-Type: text/plain' \
--data '{
"symbol_id":"43767",
"exchange":"NSE",
"segment":"FO",
"price": 400.00,
"quantity":2,
"side": 1,
"slice_max_qty": 2000,
"slice_type": "IOC",
"slice_freq": "DAY",
"user_tag": "strategy_1"
}'
Regular create order parameters These parameters are common across different order varieties.
Parameter | Type | Description |
---|---|---|
symbol_id | string | Unique symbol ID |
exchange | string | Name of the exchange NSE BSE MCX |
segment | string | Segment FO CM |
price | float32 | Price at which order is placed |
quantity | int | Number of units in multiples of lot_size |
side | int32 | Side is 1 or 2 ,1 is use for BUY ,2 is use for SELL |
slice_max_qty | int | Max slice quantity for the order |
slice_type | enum string | Slice type of IOC ,VWAP ,TWAP |
slice_freq | int | Frequency of TWAP |
user_tag | enum string | An optional tag to apply to an order to identify it (alphanumeric, max 20 chars) |
WebSocket Response Examples
Below are sample responses received over WebSocket after placing an order:
Standing Order Response:
{
"ui_id": 40098,
"user_order_id": 1000001,
"exchg_order_id": "101000001",
"order_status": "STANDING",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "MARKET",
"symbol": "FINNIFTY25MAY26700PE",
"symbol_id": 35000,
"quantity": 5,
"disclosed_quantity": 0,
"price": 11026.35,
"avg_trade_price": 0,
"user_tag": "TEST",
"remaining_quantity": 5,
"filled_qty": 0,
"oms_error_code": 0,
"oms_error_description": "",
"exchange_time": "",
"created_time": "2025-04-25 15:15:18.621833819 +0530 IST",
"updated_time": ""
}
Rejected Order Response:
{
"ui_id": 40098,
"user_order_id": 1000002,
"exchg_order_id": "",
"order_status": "REJECTED",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "MARKET",
"symbol": "RELIANCE25MAYFUT",
"symbol_id": 35000,
"quantity": 5,
"disclosed_quantity": 0,
"price": 11026.35,
"avg_trade_price": 0,
"user_tag": "TEST",
"remaining_quantity": 0,
"filled_qty": 0,
"oms_error_code": 99,
"oms_error_description": "New Order Failed - Reason Code = E_RMS_DPR",
"exchange_time": "",
"created_time": "2025-04-25 15:14:46.066680383 +0530 IST",
"updated_time": ""
}
Modify Order
Replace order for a specific (ucc)
user.
API
- URL:
v1/order
- Method: PUT
- URL Params:
- Header : Authentication (Bearer Token)
- Body :
{}
{
"ucc":"keshav",
"ui_id": 2013,
"price": 207845,
"quantity":4,
"symbol_id":35068,
"side": 1,
"exchange": "NSE",
"segment": "FO",
"order_type": "LIMIT",
"update_type": "MODIFY_ORDER"
}
- Success Response:
- Code : 201
{
"success": true,
"message": "Order modified ...",
"data": 2013,
"timestamp": {
"start_time": "2025-03-24T11:54:59.364828106+05:30",
"end_time": "2025-03-24T11:54:59.365077399+05:30"
}
}
- Error Response:
- Code:
401 Unauthorized
- Response:
{
"error": "Invalid credentials",
"status": "failure"
}
- CURL
curl --request PUT 'https://{HOST_NAME}/v1/order' \
--header 'Authorization: {{bearerToken}}'
-header 'Content-Type: text/plain' \
--data '{
"ucc":"keshav",
"ui_id": 2013,
"price": 207845,
"quantity":4,
"symbol_id":35068,
"side": 1,
"exchange": "NSE",
"segment": "FO",
"order_type": "LIMIT",
"update_type": "MODIFY_ORDER"
}'
WebSocket Response Examples
Below are sample responses received over WebSocket after modifying an order:
Rejected Modify Order Response
{
"ui_id": 40098,
"user_order_id": 1000003,
"exchg_order_id": "101000001",
"order_status": "REJECTED",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "MARKET",
"symbol": "RELIANCE25MAYFUT",
"symbol_id": 35000,
"quantity": 5,
"disclosed_quantity": 0,
"price": 11030.00,
"avg_trade_price": 0,
"user_tag": "TEST",
"remaining_quantity": 5,
"filled_qty": 0,
"oms_error_code": 99,
"oms_error_description": "MOD/CXL REJ: NO ORDER STANDING ON ORIG_CID(41)",
"exchange_time": "",
"created_time": "2025-04-25 15:56:53.822101709 +0530 IST",
"updated_time": "2025-04-25 16:00:27.252822419 +0530 IST"
}
Standing Order Response After Modification
{
"ui_id": 40098,
"user_order_id": 1000001,
"exchg_order_id": "101000001",
"order_status": "STANDING",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "MARKET",
"symbol": "RELIANCE25MAYFUT",
"symbol_id": 35000,
"quantity": 4,
"disclosed_quantity": 0,
"price": 11028.50,
"avg_trade_price": 0,
"user_tag": "TEST",
"remaining_quantity": 4,
"filled_qty": 0,
"oms_error_code": 0,
"oms_error_description": "",
"exchange_time": "",
"created_time": "2025-04-25 15:15:18.621833819 +0530 IST",
"updated_time": "2025-04-25 16:00:00.000000000 +0530 IST"
}
Cancel Order
Cancel Normal Order
Cancel normal order for a specific (ucc)
user.
API
- URL:
/v1/order
- Method: DELETE
- URL Params:
- Header : Authentication (Bearer Token)
- Body :
{}
{
"ucc":"keshav",
"ui_id": 1010,
"price": 216175,
"quantity":3,
"symbol_id":35041,
"side": 1,
"exchange": "NSE",
"segment": "FO",
"update_type": "CANCEL_ORDER",
"order_type":"LIMIT"
}
- Success Response:
- Code : 201
{
"success": true,
"message": "Order canceled ...",
"data": 1010,
"timestamp": {
"start_time": "2025-03-24T12:01:05.17458952+05:30",
"end_time": "2025-03-24T12:01:05.174694614+05:30"
}
}
- Error Response:
- Code:
400 Bad Request
-
Content:
{error :No Order Deleted!.}
-
CURL
curl --request DELETE 'https://{HOST_NAME}/v1/order' \
--header 'Authorization: {{bearerToken}}'
-header 'Content-Type: text/plain' \
--data '{
"ucc":"keshav",
"ui_id": 1010,
"price": 216175,
"quantity":3,
"symbol_id":35041,
"side": 1,
"exchange": "NSE",
"segment": "FO",
"update_type": "CANCEL_ORDER",
"order_type":"LIMIT"
}'
Slice Cancel Order
Slice cancel order for a specific (ucc)
user.
API
- URL:
v1/slice
- Method: DELETE
- URL Params:
- Header : Authentication (Bearer Token)
- Body :
{}
{
"symbol_id":"43767",
"exchange":"NSE",
"segment":"FO",
"price":16400.00,
"quantity":2,
"side": 1,
"slice_max_qty": 2000,
"slice_type": "IOC",
"slice_freq": "DAY",
"user_tag": "strategy_1"
}
- Success Response:
- Code : 201
{
"status": "success",
"data": {
"order_id": "151220000000000"
}
}
- Error Response:
- Code:
400 Bad Request
-
Content:
{error :No Order Created!.}
-
CURL
curl --request DELETE 'https://{HOST_NAME}/v1/orders/slice' \
--header 'Authorization: {{bearerToken}}'
-header 'Content-Type: text/plain' \
--data '{
"symbol_id":"43767",
"exchange":"NSE",
"segment":"FO",
"price":"16400",
"quantity":20,
"side": 1,
"slice_max_qty": 2000,
"slice_type": "IOC",
"slice_freq": "DAY",
"user_tag": "strategy_1"
}'
WebSocket Response Examples
Below are sample responses received over WebSocket after cancelling an order:
Cancelled Order Response
{
"ui_id": 40098,
"user_order_id": 1000001,
"exchg_order_id": "101000001",
"order_status": "CANCELLED",
"exchange": "NSE",
"segment": "FO",
"side": 1,
"validity": "DAY",
"order_type": "MARKET",
"symbol": "RELIANCE25MAYFUT",
"symbol_id": 35000,
"quantity": 5,
"disclosed_quantity": 0,
"price": 11026.35,
"avg_trade_price": 0,
"user_tag": "TEST",
"remaining_quantity": 5,
"filled_qty": 0,
"oms_error_code": 0,
"oms_error_description": "",
"exchange_time": "",
"created_time": "2025-04-25 15:15:18.621833819 +0530 IST",
"updated_time": "2025-04-25 16:02:00.000000000 +0530 IST"
}
Portfolio Management
Get Positions
Retrieve positions for a specific (ucc)
user.
API
- URL:
/v1/positions
- Method: GET
- URL Params:
-
Header : Authentication (Bearer Token)
-
Success Response:
- Code : 200
- Content: {positions[...]}
{
"success": true,
"message": "Positions retrieved ...",
"data": [
{
"ucc": "KESHAV",
"exchange_destination": "NSEFO",
"symbol_id": 35068,
"symbol_name": "MIDCPNIFTY25MAR8675CE",
"expiry": "2025-03-27",
"strike": 8675,
"instrument_type": "CE",
"underlying": "MIDCPNIFTY",
"buy_quantity": 2280,
"buy_value": 473949240,
"buy_avg_price": 207872,
"sell_quantity": 0,
"sell_value": 0,
"sell_avg_price": 0,
"net_quantity": 2280,
"realized_pnl": 473949240,
"order_type": "LIMIT",
"user_tag": "my_user_tag"
}
],
"timestamp": {
"start_time": "2025-03-24T11:41:05.313009683+05:30",
"end_time": "2025-03-24T11:41:05.313535334+05:30"
}
}
- Error Response:
- Code:
404 NOT FOUND
-
Content:
{error :No Positions Found!.}
-
CURL
curl --request 'https://{HOST_NAME}/v1/positions \
--header 'Accept: application/json' \
--header 'Authorization: {{bearerToken}}'
Regular positions parameters
These parameters are common across different positions.
Parameter | Type | Description |
---|---|---|
security_id | string | Unique security ID |
symbol | string | Symbol names where you can trade both regular shares and F&O, such as ACC HDFC BANK BANKNIFTY24O1651900CE |
exchange | string | Name of the exchange NSE BSE MCX |
segment | string | Segment FO CM |
buy_avg | float32 | Buy Avg |
buy_qty | int | Buy quantity |
sell_avg | float32 | Average sell price of the share |
net_qty | int | Net quantity |
realized_pnl | float32 | Realized Profit |
multiplier | int | multiplier |
day_buy_quantity | int | In day buying quantity |
day_buy_price | float32 | In day buying price |
day_sell_price | float32 | In day selling price |
day_sell_quantity | int | In day selling quantity |
overnight_quantity | int | In overnight quantity |
Get Funds
Retrieve funds for a specific (ucc)
user.
API
- URL:
/v1/funds
- Method: GET
- URL Params:
-
Header : Authentication (Bearer Token)
-
Success Response:
- Code : 200
- Content: {funds}
{
"success": true,
"message": "Funds retrieved ...",
"data": {
"utilized_margin": 19860097.65,
"allocated_margin": 20000000000000,
"available_margin": 19999980139902.35,
"delivery_sell_benefit": 0,
"pay_in": 0,
"collateral_equity": 10000000000000,
"span_exposure": 372435.15,
"realised_pl": 58917.75,
"unrealised_pl": 2086252.95,
"cash_margin": 10000000000000,
"ofs": 0,
"option_premium_present": 0
},
"timestamp": {
"start_time": "2025-04-02T11:22:13.117147882+05:30",
"end_time": "2025-04-02T11:22:13.117150548+05:30"
}
}
- Error Response:
- Code:
404 NOT FOUND
-
Content:
{error :No Funds Found!.}
-
CURL
curl --request 'https://{HOST_NAME}/v1/funds \
--header 'Accept: application/json' \
--header 'Authorization: {{bearerToken}}'
Regular funds parameters
These parameters are common across different positions.
Parameter | Type | Description |
---|---|---|
utilized_margin | float64 | It is used by user at time of buy the stock*utilized = span+exposure |
allocated_margin | float64 | It is the amount of funds that have been blocked or used for your current open positions and pending ordersallocated = cash + pay-in + non-cash |
available_margin | float64 | It is represents the total amount of funds that are available for you to use for new tradessavailabe = allocated - utilized |
delivery_sell_benefit | float64 | delivery sell bebefit |
pay_in | float64 | Funds added on Saturday and Sunday will reflect under Pay-in on Monday.MARGIN_CASH_CURRENT - MARGIN_CASH_OPEN |
collateral_equity | float64 | The equity collateral margin represents the margin received against pledged stocks, ETFs, and mutual funds after deducting the haircut MARGIN_NONCASH_CURRENT |
span_exposure | float64 | The total margin that a trader must maintain for their open positions |
realised_pl | float64 | It is calculated when a trade is squared-off, taking into account the closed F&O and intraday equity positions. |
unrealised_pl | float64 | Unrealized profit or loss refers to the change in value of an asset that has not yet been sold |
cash_margin | float64 | It is MARGIN_CASH_CURRENT |
ofs | float64 | offer for sell |
option_premium_present | float64 | An option premium is the income received by an investor who sells an option contract, or the current price of an option contract that has yet to expire |
MarketData Subscription
For market data subscription, we provide fast websocket based communication, since its a full duplex and enables bi-directional flow of messages. The websocket endpoint to connect is: wss://ws.irage.in. For making a connection user would need an authentication token and seed, both of which can be obtained in form of credential file via login to the user portal.
Below is a sample to connect to our websocket endpoints.
import { connect } from "nats";
const creds = `-----BEGIN NATS USER JWT-----
eyJ0eXAiOiJqdSDJB....
------END NATS USER JWT------
************************* IMPORTANT *************************
NKEY Seed printed below can be used sign and prove identity.
NKEYs are sensitive and should be treated as secrets.
-----BEGIN USER NKEY SEED-----
SUAIBDPBAUTW....
------END USER NKEY SEED------
`;
const nc = await connect({
servers: "wss://ws.irage.in",
authenticator: credsAuthenticator(new TextEncoder().encode(creds)),
});
Subscribe to symbol
As of the existing version user can subscribe to individual symbols by passing the symbol name obtained in the instrument file
nc.subscribe('BCAST.HDFCBANK.NSE.EQ', dataHandlerFunc);
Parameter | Type | Description |
---|---|---|
askp | float | best ask price in paise |
bidp | float | best bid price in paise |
symbol | string | Symbol names where you can trade both regular shares and F&O, such as HDFCBANK.NSE.EQ |
exchange | enum string | Name of the exchange NSE BSE MCX |
segment | enum string | Segment FO CM |
ltp | float | Last traded price |
price | float | mid of askp and bidp |
security_id | string | Unique security ID |
volume | int | total traded volume |
vwap | float | total traded value |
{
"askp": 1765.35,
"bidp": 1765.30,
"exchange": "NSE",
"ltp": 1765.30,
"symbol": "HDFCBANK.NSE.EQ",
"price": 1765.32,
"segment": "CM",
"security_id": "1333",
"volume": 7355237,
"vwap": 175571
}
Disclaimer
Please be advised that these APIs are currently in the development phase. As we continue to enhance and optimize our services, the API specifications, endpoints, response formats, and authentication methods may undergo slight modifications and same will be published regularly on our website