forked from supabase-community/chatgpt-your-files
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocument.json
More file actions
1 lines (1 loc) · 47.5 KB
/
document.json
File metadata and controls
1 lines (1 loc) · 47.5 KB
1
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://api.dhan.co","description":"Generated server url"}],"paths":{"/orders/{order-id}":{"get":{"tags":["Orders"],"summary":"get order by id","description":"Users can retrieve the details and status of an order from the orderbook placed during the day.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getOrderByOrderId","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"order-id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}}}},"put":{"tags":["Orders"],"summary":"modify pending order","description":"Using this API one can modify pending order in orderbook. The variables that can be modified are price, quantity, order type & validity.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"modifyOrder","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"order-id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderModifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatusResponse"}}}}}},"delete":{"tags":["Orders"],"summary":"cancel given order","description":"Users can cancel a pending order in the orderbook using the order id of an order.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"cancelOrder","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"order-id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatusResponse"}}}}}}},"/positions/convert":{"post":{"tags":["Portfolio"],"summary":"convert position","description":"Users can convert their open position from intraday to delivery or delivery to intraday.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"convertPosition","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionConversionRequest"}}},"required":true},"responses":{"202":{"description":"Successful operation","content":{"application/json":{}}}}}},"/orders":{"get":{"tags":["Orders"],"summary":"get current orders list","description":"This API lets you retrieve an array of all orders requested in a day with their last updated status.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getOrders","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderResponse"}}}}}}},"post":{"tags":["Orders"],"summary":"place an order","description":"The order request API lets you place new orders.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"placeOrder","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatusResponse"}}}}}}},"/orders/slicing":{"post":{"tags":["Orders"],"summary":"place slice order","description":"The order request API lets you place new slice orders.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"placeSliceOrder","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderStatusResponse"}}}}}}}},"/killSwitch":{"post":{"tags":["KillSwitch"],"summary":"Manage Kill Switch","description":"This API lets you activate the killSwitch for your account, which will disable trading for current trading day","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"killSwitch","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"killSwitchStatus","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KillSwitchResponse"}}}}}}},"/edisbulk/form":{"post":{"tags":["EDIS"],"summary":"EDIS BULK Generate Form","description":"Retrieve escaped html form of CDSL and enter T-PIN to mark the stock for EDIS approval. Partner has to render this form at their end to unescape.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"generateBulkEdisForm","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdisBulkFormRequest"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdisFormResponse"}}}}}}},"/edis/form":{"post":{"tags":["EDIS"],"summary":"EDIS Generate Form","description":"Retrieve escaped html form of CDSL and enter T-PIN to mark the stock for EDIS approval. Partner has to render this form at their end to unescape.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"generateEdisForm","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdisFormRequest"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdisFormResponse"}}}}}}},"/charts/intraday":{"post":{"tags":["Charts"],"summary":"intraday OHLC, 1 minute candle","description":"Retrieve OHLC & Volume of 1 minute candle for desired instrument for current day. This data available for all segments including futures & options.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getIntradayCharts","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntradayChartsRequest"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartsResponse"}}}}}}},"/charts/historical":{"post":{"tags":["Charts"],"summary":"histotical OHLC, 1 day candle","description":"Retrieve OHLC & Volume of daily candle for desired instrument. The data for any scrip is available back upto the date of its inception.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getHistoricalCharts","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoricalChartsRequest"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartsResponse"}}}}}}},"/trades":{"get":{"tags":["Trades"],"summary":"get all trades","description":"This API lets you retrieve an array of all trades executed in a day.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getAllTrades","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeResponse"}}}}}}}},"/trades/{order-id}":{"get":{"tags":["Trades"],"summary":"get trades by order","description":"Users can retrieve the trade details using an order id. Often during partial trades or Bracket/ Cover Orders, traders get confused in reading trade from tradebook. The response of this API will include all the trades generated for a particular order id.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getTradesByOrderId","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"order-id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeResponse"}}}}}}}},"/tradeHistory/{from_date}/{to_date}/{page_number}":{"get":{"tags":["Trades"],"summary":"get trade history","description":"Users can retrieve the trade history Often during partial trades or Bracket/ Cover Orders, traders get confused in reading trade from tradebook. The response of this API will include all the trades generated for a particular order id.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getTradeHistory","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"from_date","in":"path","description":"date format : yyyy-MM-dd","required":true,"schema":{"type":"string","description":"date format : yyyy-MM-dd"}},{"name":"to_date","in":"path","description":"date format : yyyy-MM-dd","required":true,"schema":{"type":"string","description":"date format : yyyy-MM-dd"}},{"name":"page_number","in":"path","description":"default value : 0 ","required":true,"schema":{"type":"string","description":"default value : 0 "}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeHistoryResponseModel"}}}}}}}},"/positions":{"get":{"tags":["Portfolio"],"summary":"get current positions","description":"Users can retrieve a list of all open positions for the day. This includes all F&O carryforward positions as well.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getPositions","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PositionResponse"}}}}}}}},"/orders/external/{correlation-id}":{"get":{"tags":["Orders"],"summary":"get order by corelation id","description":"In case the user has missed order id due to unforeseen reason, this API retrieves the order status using a field called correlation id, Provided by API consumer during order placement.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"getOrderByCorrelationId","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"correlation-id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}}}}},"/ledger":{"get":{"tags":["Ledger"],"summary":"get Ledger report","description":"Get Trading Account Ledger with all Credit and Debit transaction details","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"boledger","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"from_date","in":"query","description":"date format : yyyy-MM-dd","required":false,"schema":{"type":"string","description":"date format : yyyy-MM-dd"}},{"name":"to_date","in":"query","description":"date format : yyyy-MM-dd","required":false,"schema":{"type":"string","description":"date format : yyyy-MM-dd"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoLedgerResponse"}}}}}}},"/holdings":{"get":{"tags":["Portfolio"],"summary":"get current holdings","description":"Users can retrieve all holdings bought/sold in previous trading sessions. All T1 and delivered quantities can be fetched.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"holdings","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HoldingResponse"}}}}}}}},"/fundlimit":{"get":{"tags":["FundLimit"],"summary":"get fund limit details","description":"Get all information of your trading account like balance, margin utilised, collateral, etc.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"fundlimit","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundLimitResponse"}}}}}}},"/edis/tpin":{"get":{"tags":["EDIS"],"summary":"EDIS T-PIN Generation","description":"Get T-PIn on customer's registered mobile number using this API.","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"requestEdisTpin","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Successful operation","content":{"application/json":{}}}}}},"/edis/inquire/{isin}":{"get":{"tags":["EDIS"],"summary":"EDIS Check Authorized Quantity","description":"You can check the status of stock whether it is approved and marked for sell action. User have to enter ISIN of the stock. An International Securities Identification Number (ISIN) is a 12-digit alphanumeric code that uniquely identifies a specific security. You can get ISIN of portfolio stocks, in response of holdings API.Or use ALL as a special case to query all holdings' edis auth status","externalDocs":{"description":"please refer the link for detailed docs","url":"https://dhanhq.co/docs/v1/"},"operationId":"edisQtyStatus","parameters":[{"name":"access-token","in":"header","required":true,"schema":{"type":"string"}},{"name":"isin","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdisQtyStatusResponse"}}}}}}}},"components":{"schemas":{"OrderModifyRequest":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"orderId":{"type":"string","description":"Order specific identification generated by Dhan"},"orderType":{"type":"string","description":"| **Enum Values** | **Description** |\n|------------------|-----------------------------|\n| LIMIT | For Limit Order types |\n| MARKET | For market Order types |\n| STOP_LOSS | For Stop Loss Limit orders |\n| STOP_LOSS_MARKET | For Stop Loss Market orders |","enum":["LIMIT","MARKET","STOP_LOSS","STOP_LOSS_MARKET"]},"legName":{"type":"string","description":"filed description goes here","enum":["ENTRY_LEG","STOP_LOSS_LEG","TARGET_LEG","NA"]},"quantity":{"type":"integer","description":"Number of shares for the order","format":"int32"},"price":{"type":"number","description":"Price at which the order is requested to execute","format":"float"},"disclosedQuantity":{"type":"integer","description":"Number shares visible in the market depth","format":"int32"},"triggerPrice":{"type":"number","description":"Price at which the order is triggered","format":"float"},"validity":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|-----------------------|\n| DAY | Valid till end of day |\n| IOC | Immediate or Cancel |","enum":["DAY","IOC","GTC","GTD"]}}},"OrderStatusResponse":{"type":"object","properties":{"orderId":{"type":"string","description":"Order specific identification generated by Dhan"},"orderStatus":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|---------------------------------------------|\n| TRANSIT | Did not reach the exchange server |\n| PENDING | Reached at exchange end, awaiting execution |\n| REJECTED | Rejected at exchange/broker’s end |\n| CANCELLED | Cancelled by user |\n| TRADED | Executed |\n| EXPIRED | Validity of order is expired |","enum":["TRANSIT","PENDING","REJECTED","CANCELLED","TRADED","EXPIRED"]}}},"PositionConversionRequest":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"fromProductType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|------------------------------------------------|\n| CNC | Cash & Carry for equity deliveries |\n| INTRADAY | Intraday for Equity, Futures & Options |\n| MARGIN | Carry Forward in Futures & Options |","enum":["CNC","INTRADAY","MARGIN","MTF","CO","BO"]},"exchangeSegment":{"type":"string","description":"| **Enums** | **Exchange** | **Segment** |\n|--------------|--------------|-------------------|\n| NSE_EQ | NSE | Equity Cash |\n| NSE_FNO | NSE | Futures & Options |\n| NSE_CURRENCY | NSE | Currency |\n| BSE_EQ | BSE | Equity Cash |\n| BSE_FNO | BSE | Futures & Options |\n| BSE_CURRENCY | BSE | Currency |\n| MCX_COMM | MCX | Commodity |\n","enum":["NSE_EQ","NSE_FNO","NSE_CURRENCY","BSE_EQ","BSE_FNO","BSE_CURRENCY","MCX_COMM"]},"positionType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|-----------------------------------------------------|\n| LONG | When net bought quantity is more than sold quantity |\n| SHORT | When net sold quantity is more than bought quantity |\n| CLOSED | When no open position standing |","enum":["LONG","SHORT","CLOSED"]},"securityId":{"type":"string","description":"Exchange standard identification for each scrip"},"tradingSymbol":{"type":"string","description":"Exchange standard trading symbol"},"convertQty":{"type":"integer","description":"Number of shares for the conversion","format":"int32"},"toProductType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|------------------------------------------------|\n| CNC | Cash & Carry for equity deliveries |\n| INTRADAY | Intraday for Equity, Futures & Options |\n| MARGIN | Carry Forward in Futures & Options |","enum":["CNC","INTRADAY","MARGIN","MTF","CO","BO"]}}},"OrderRequest":{"required":["exchangeSegment","transactionType"],"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"correlationId":{"maxLength":25,"minLength":0,"type":"string","description":"The user/partner generated id for tracking back"},"transactionType":{"type":"string","description":"Signifies the type of transaction wether it's BUY or SELL","enum":["BUY","SELL"]},"exchangeSegment":{"type":"string","description":"| **Enums** | **Exchange** | **Segment** |\n|--------------|--------------|-------------------|\n| NSE_EQ | NSE | Equity Cash |\n| NSE_FNO | NSE | Futures & Options |\n| NSE_CURRENCY | NSE | Currency |\n| BSE_EQ | BSE | Equity Cash |\n| BSE_FNO | BSE | Futures & Options |\n| BSE_CURRENCY | BSE | Currency |\n| MCX_COMM | MCX | Commodity |\n","enum":["NSE_EQ","NSE_FNO","NSE_CURRENCY","BSE_EQ","BSE_FNO","BSE_CURRENCY","MCX_COMM"]},"productType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|------------------------------------------------|\n| CNC | Cash & Carry for equity deliveries |\n| INTRADAY | Intraday for Equity, Futures & Options |\n| MARGIN | Carry Forward in Futures & Options |\n| CO | Cover Order; entry and stop loss |\n| BO | Bracket Order; entry, stop loss & target price |\n| MTF | Margin Traded Fund |\n**CO & BO product types will be valid only for Intraday**","enum":["CNC","INTRADAY","MARGIN","MTF","CO","BO"]},"orderType":{"type":"string","description":"| **Enum Values** | **Description** |\n|------------------|-----------------------------|\n| LIMIT | For Limit Order types |\n| MARKET | For market Order types |\n| STOP_LOSS | For Stop Loss Limit orders |\n| STOP_LOSS_MARKET | For Stop Loss Market orders |","enum":["LIMIT","MARKET","STOP_LOSS","STOP_LOSS_MARKET"]},"validity":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|-----------------------|\n| DAY | Valid till end of day |\n| IOC | Immediate or Cancel |","enum":["DAY","IOC","GTC","GTD"]},"tradingSymbol":{"type":"string","description":"Exchange standard trading symbol"},"securityId":{"type":"string","description":"Exchange standard identification for each scrip"},"quantity":{"type":"integer","description":"Number of shares for the order","format":"int32"},"disclosedQuantity":{"type":"integer","description":"Number shares visible in the market depth","format":"int32"},"price":{"type":"number","description":"Price at which the order is requested to execute","format":"float"},"triggerPrice":{"type":"number","description":"Price at which the order is triggered","format":"float"},"afterMarketOrder":{"type":"boolean","description":"Flag to inform that the order placed is After Market Order"},"amoTime":{"type":"string","description":"Flag to inform after what time AMO is pumped","enum":["OPEN","OPEN_30","OPEN_60"]},"boProfitValue":{"type":"number","description":"Bracket order Target price","format":"float"},"boStopLossValue":{"type":"number","description":"Bracket Order/Cover Order Stop Loss Price","format":"float"},"drvExpiryDate":{"type":"string","description":"For F&O, expiry date of contract"},"drvOptionType":{"type":"string","description":"For Options, type CALL or PUT","enum":["CALL","PUT","NA"]},"drvStrikePrice":{"type":"number","description":"For Options, Strike Price","format":"float"}}},"KillSwitchResponse":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"killSwitchStatus":{"type":"string","description":"| **Enum Values** | **Description** |\n|-------------------|------------------------|\n| ACTIVATE | KillSwitch Activated |\n| DEACTIVATE | KillSwitch Deactivated |"}}},"EdisBulkFormRequest":{"required":["exchange","isin","segment"],"type":"object","properties":{"isin":{"type":"array","items":{"type":"string"}},"exchange":{"type":"string","enum":["NSE","BSE","MCX","ALL"]},"segment":{"type":"string","enum":["EQ","COMM","FNO","CURR"]}}},"EdisFormResponse":{"type":"object","properties":{"dhanClientId":{"type":"string"},"edisFormHtml":{"type":"string"}}},"EdisFormRequest":{"required":["bulk","exchange","isin","qty","segment"],"type":"object","properties":{"isin":{"type":"string"},"qty":{"minimum":1,"type":"integer","format":"int32"},"exchange":{"type":"string","enum":["NSE","BSE","MCX","ALL"]},"segment":{"type":"string","enum":["EQ","COMM","FNO","CURR"]},"bulk":{"type":"boolean"}}},"IntradayChartsRequest":{"type":"object","properties":{"securityId":{"type":"string","description":"Exchange standard identification for each scrip"},"exchangeSegment":{"type":"string","description":"| **Enums** | **Exchange** | **Segment** |\n|--------------|--------------|-------------------|\n| NSE_EQ | NSE | Equity Cash |\n| NSE_FNO | NSE | Futures & Options |\n| NSE_CURRENCY | NSE | Currency |\n| BSE_EQ | BSE | Equity Cash |\n| BSE_FNO | BSE | Futures & Options |\n| BSE_CURRENCY | BSE | Currency |\n| MCX_COMM | MCX | Commodity |\n| IDX_I | INDEX | Indices |","enum":["NSE_EQ","NSE_FNO","NSE_CURRENCY","BSE_EQ","BSE_FNO","BSE_CURRENCY","MCX_COMM","IDX_I"]},"instrument":{"type":"string","description":"Represents the security instrument type, refer charts annexure for possible values.","enum":["INDEX","FUTIDX","OPTIDX","EQUITY","FUTSTK","OPTSTK","FUTCOM","OPTFUT","FUTCUR","OPTCUR"]}}},"ChartsResponse":{"type":"object","properties":{"open":{"type":"array","description":"Array of values represting OHLC open value","items":{"type":"number","description":"Array of values represting OHLC open value","format":"double"}},"high":{"type":"array","description":"Array of values represting OHLC high value","items":{"type":"number","description":"Array of values represting OHLC high value","format":"double"}},"low":{"type":"array","description":"Array of values represting OHLC low value","items":{"type":"number","description":"Array of values represting OHLC low value","format":"double"}},"close":{"type":"array","description":"Array of values represting OHLC close value","items":{"type":"number","description":"Array of values represting OHLC close value","format":"double"}},"volume":{"type":"array","description":"Array of values represting volume","items":{"type":"number","description":"Array of values represting volume","format":"double"}},"start_Time":{"type":"array","description":"Array of values represting date times in seconds since January 01, 1980","items":{"type":"number","description":"Array of values represting date times in seconds since January 01, 1980","format":"double"}}}},"HistoricalChartsRequest":{"type":"object","properties":{"symbol":{"type":"string","description":"Exchange standard trading symbol, refer charts annexure for possible values."},"exchangeSegment":{"type":"string","description":"| **Enums** | **Exchange** | **Segment** |\n|--------------|--------------|-------------------|\n| NSE_EQ | NSE | Equity Cash |\n| NSE_FNO | NSE | Futures & Options |\n| NSE_CURRENCY | NSE | Currency |\n| BSE_EQ | BSE | Equity Cash |\n| BSE_FNO | BSE | Futures & Options |\n| BSE_CURRENCY | BSE | Currency |\n| MCX_COMM | MCX | Commodity |\n| IDX_I | INDEX | Indices |","enum":["NSE_EQ","NSE_FNO","NSE_CURRENCY","BSE_EQ","BSE_FNO","BSE_CURRENCY","MCX_COMM","IDX_I"]},"instrument":{"type":"string","description":"Represents the security instrument type, refer charts annexure for possible values.","enum":["INDEX","FUTIDX","OPTIDX","EQUITY","FUTSTK","OPTSTK","FUTCOM","OPTFUT","FUTCUR","OPTCUR"]},"expiryCode":{"type":"integer","description":"Represents the expiry code value, refer charts annexure for possible values.","format":"int32"},"fromDate":{"type":"string","description":"Chart data request start date in format YYYY-MM-DD","format":"date"},"toDate":{"type":"string","description":"Chart data request end date in format YYYY-MM-DD","format":"date"}}},"TradeResponse":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"orderId":{"type":"string","description":"Order specific identification generated by Dhan"},"exchangeOrderId":{"type":"string","description":"Order specific identification generated by Exchange"},"exchangeTradeId":{"type":"string","description":"Trade specific identification, generated by exchange once order is executed"},"transactionType":{"type":"string","description":"Signifies the type of transaction wether it's BUY or SELL","enum":["BUY","SELL"]},"exchangeSegment":{"type":"string","description":"| **Enums** | **Exchange** | **Segment** |\n|--------------|--------------|-------------------|\n| NSE_EQ | NSE | Equity Cash |\n| NSE_FNO | NSE | Futures & Options |\n| NSE_CURRENCY | NSE | Currency |\n| BSE_EQ | BSE | Equity Cash |\n| BSE_FNO | BSE | Futures & Options |\n| BSE_CURRENCY | BSE | Currency |\n| MCX_COMM | MCX | Commodity |\n","enum":["NSE_EQ","NSE_FNO","NSE_CURRENCY","BSE_EQ","BSE_FNO","BSE_CURRENCY","MCX_COMM"]},"productType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|------------------------------------------------|\n| CNC | Cash & Carry for equity deliveries |\n| INTRADAY | Intraday for Equity, Futures & Options |\n| MARGIN | Carry Forward in Futures & Options |\n| CO | Cover Order; entry and stop loss |\n| BO | Bracket Order; entry, stop loss & target price |\n| MTF | Margin Traded Fund |\n**CO & BO product types will be valid only for Intraday**","enum":["CNC","INTRADAY","MARGIN","MTF","CO","BO"]},"orderType":{"type":"string","description":"| **Enum Values** | **Description** |\n|------------------|-----------------------------|\n| LIMIT | For Limit Order types |\n| MARKET | For market Order types |\n| STOP_LOSS | For Stop Loss Limit orders |\n| STOP_LOSS_MARKET | For Stop Loss Market orders |","enum":["LIMIT","MARKET","STOP_LOSS","STOP_LOSS_MARKET"]},"tradingSymbol":{"type":"string","description":"Exchange standard trading symbol"},"customSymbol":{"type":"string","description":"Custom trading symbol"},"securityId":{"type":"string","description":"Exchange standard identification for each scrip"},"tradedQuantity":{"type":"integer","description":"Number of shares traded","format":"int32"},"tradedPrice":{"type":"number","description":"Price at which trade executed","format":"float"},"createTime":{"type":"string","description":"Record create date time"},"updateTime":{"type":"string","description":"Record update date time"},"exchangeTime":{"type":"string","description":"Time at which order reached at exchange end"},"drvExpiryDate":{"type":"string","description":"For F&O, expiry date of contract"},"drvOptionType":{"type":"string","description":"For Options, type CALL or PUT","enum":["CALL","PUT","NA"]},"drvStrikePrice":{"type":"number","description":"For Options, Strike Price","format":"float"}}},"TradeHistoryResponseModel":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"orderId":{"type":"string","description":"Order specific identification generated by Dhan"},"exchangeOrderId":{"type":"string","description":"Order specific identification generated by Exchange"},"exchangeTradeId":{"type":"string","description":"Trade specific identification, generated by exchange once order is executed"},"transactionType":{"type":"string","description":"Signifies the type of transaction wether it's BUY or SELL","enum":["BUY","SELL"]},"exchangeSegment":{"type":"string","description":"| **Enums** | **Exchange** | **Segment** |\n|--------------|--------------|-------------------|\n| NSE_EQ | NSE | Equity Cash |\n| NSE_FNO | NSE | Futures & Options |\n| NSE_CURRENCY | NSE | Currency |\n| BSE_EQ | BSE | Equity Cash |\n| BSE_FNO | BSE | Futures & Options |\n| BSE_CURRENCY | BSE | Currency |\n| MCX_COMM | MCX | Commodity |\n","enum":["NSE_EQ","NSE_FNO","NSE_CURRENCY","BSE_EQ","BSE_FNO","BSE_CURRENCY","MCX_COMM"]},"productType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|------------------------------------------------|\n| CNC | Cash & Carry for equity deliveries |\n| INTRADAY | Intraday for Equity, Futures & Options |\n| MARGIN | Carry Forward in Futures & Options |\n| CO | Cover Order; entry and stop loss |\n| BO | Bracket Order; entry, stop loss & target price |\n| MTF | Margin Traded Fund |\n**CO & BO product types will be valid only for Intraday**","enum":["CNC","INTRADAY","MARGIN","MTF","CO","BO"]},"orderType":{"type":"string","description":"| **Enum Values** | **Description** |\n|------------------|-----------------------------|\n| LIMIT | For Limit Order types |\n| MARKET | For market Order types |\n| STOP_LOSS | For Stop Loss Limit orders |\n| STOP_LOSS_MARKET | For Stop Loss Market orders |","enum":["LIMIT","MARKET","STOP_LOSS","STOP_LOSS_MARKET"]},"tradingSymbol":{"type":"string","description":"Exchange standard trading symbol"},"customSymbol":{"type":"string","description":"Custom trading symbol"},"securityId":{"type":"string","description":"Exchange standard identification for each scrip"},"tradedQuantity":{"type":"integer","description":"Number of shares traded","format":"int32"},"tradedPrice":{"type":"number","description":"Price at which trade executed","format":"float"},"isin":{"type":"string","description":"Isin Number of that scrip"},"instrument":{"type":"string","description":"Instrument of that scrip"},"sebiTax":{"type":"number","description":"SEBI tax","format":"double"},"stt":{"type":"number","description":"stt","format":"double"},"brokerageCharges":{"type":"number","description":"Brokerage Charges","format":"double"},"serviceTax":{"type":"number","description":"Service tax","format":"double"},"exchangeTransactionCharges":{"type":"number","description":"Exchange Transaction Charges","format":"double"},"stampDuty":{"type":"number","description":"Stamp duty paid on transfer of shares","format":"double"},"createTime":{"type":"string","description":"Record create date time"},"updateTime":{"type":"string","description":"Record update date time"},"exchangeTime":{"type":"string","description":"Time at which order reached at exchange end"},"drvExpiryDate":{"type":"string","description":"For F&O, expiry date of contract"},"drvOptionType":{"type":"string","description":"For Options, type CALL or PUT","enum":["CALL","PUT","NA"]},"drvStrikePrice":{"type":"number","description":"For Options, Strike Price","format":"float"}}},"PositionResponse":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"tradingSymbol":{"type":"string","description":"Exchange standard trading symbol"},"securityId":{"type":"string","description":"Exchange standard identification for each scrip"},"positionType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|-----------------------------------------------------|\n| LONG | When net bought quantity is more than sold quantity |\n| SHORT | When net sold quantity is more than bought quantity |\n| CLOSED | When no open position standing |","enum":["LONG","SHORT","CLOSED"]},"exchangeSegment":{"type":"string","description":"| **Enums** | **Exchange** | **Segment** |\n|--------------|--------------|-------------------|\n| NSE_EQ | NSE | Equity Cash |\n| NSE_FNO | NSE | Futures & Options |\n| NSE_CURRENCY | NSE | Currency |\n| BSE_EQ | BSE | Equity Cash |\n| BSE_FNO | BSE | Futures & Options |\n| BSE_CURRENCY | BSE | Currency |\n| MCX_COMM | MCX | Commodity |\n","enum":["NSE_EQ","NSE_FNO","NSE_CURRENCY","BSE_EQ","BSE_FNO","BSE_CURRENCY","MCX_COMM"]},"productType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|------------------------------------------------|\n| CNC | Cash & Carry for equity deliveries |\n| INTRADAY | Intraday for Equity, Futures & Options |\n| MARGIN | Carry Forward in Futures & Options |\n| CO | Cover Order; entry and stop loss |\n| BO | Bracket Order; entry, stop loss & target price |\n| MTF | Margin Traded Fund |\n**CO & BO product types will be valid only for Intraday**","enum":["CNC","INTRADAY","MARGIN","MTF","CO","BO"]},"buyAvg":{"type":"number","description":"Average buy price","format":"float"},"costPrice":{"type":"number","description":"Cost price","format":"float"},"buyQty":{"type":"integer","description":"Total quantity bought","format":"int32"},"sellAvg":{"type":"number","description":" Average sell price","format":"float"},"sellQty":{"type":"integer","description":"Total quantities sold","format":"int32"},"netQty":{"type":"integer","description":"buyQty minus sellQty equals netQty","format":"int32"},"realizedProfit":{"type":"number","description":"Profit or loss booked","format":"float"},"unrealizedProfit":{"type":"number","description":"Profit or loss standing for open position","format":"float"},"rbiReferenceRate":{"type":"number","description":"RBI mandated reference rate for forex","format":"float"},"multiplier":{"type":"integer","description":"Multiplying factor for currency F&O","format":"int32"},"carryForwardBuyQty":{"type":"integer","description":"Carry forward F&O long quantities","format":"int32"},"carryForwardSellQty":{"type":"integer","description":"Carry forward F&O short quantities","format":"int32"},"carryForwardBuyValue":{"type":"number","description":"Carry forward F&O long value","format":"float"},"carryForwardSellValue":{"type":"number","description":"Carry forward F&O short value","format":"float"},"dayBuyQty":{"type":"integer","description":"Quantities bought today","format":"int32"},"daySellQty":{"type":"integer","description":"Quantities sold today","format":"int32"},"dayBuyValue":{"type":"number","description":"Value of quantities bought today","format":"float"},"daySellValue":{"type":"number","description":"Value of quantities sold today","format":"float"},"drvExpiryDate":{"type":"string","description":"For F&O, expiry date of contract"},"drvOptionType":{"type":"string","description":"For Options, type CALL or PUT","enum":["CALL","PUT","NA"]},"drvStrikePrice":{"type":"number","description":"For Options, Strike Price","format":"float"},"crossCurrency":{"type":"boolean"}}},"OrderResponse":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"orderId":{"type":"string","description":"Order specific identification generated by Dhan"},"exchangeOrderId":{"type":"string","description":"Order specific identification generated by Exchange"},"correlationId":{"type":"string","description":"The user/partner generated id for tracking back"},"orderStatus":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|---------------------------------------------|\n| TRANSIT | Did not reach the exchange server |\n| PENDING | Reached at exchange end, awaiting execution |\n| REJECTED | Rejected at exchange/broker’s end |\n| CANCELLED | Cancelled by user |\n| TRADED | Executed |\n| EXPIRED | Validity of order is expired |","enum":["TRANSIT","PENDING","REJECTED","CANCELLED","TRADED","EXPIRED"]},"transactionType":{"type":"string","description":"Signifies the type of transaction wether it's BUY or SELL","enum":["BUY","SELL"]},"exchangeSegment":{"type":"string","description":"| **Enums** | **Exchange** | **Segment** |\n|--------------|--------------|-------------------|\n| NSE_EQ | NSE | Equity Cash |\n| NSE_FNO | NSE | Futures & Options |\n| NSE_CURRENCY | NSE | Currency |\n| BSE_EQ | BSE | Equity Cash |\n| BSE_FNO | BSE | Futures & Options |\n| BSE_CURRENCY | BSE | Currency |\n| MCX_COMM | MCX | Commodity |\n","enum":["NSE_EQ","NSE_FNO","NSE_CURRENCY","BSE_EQ","BSE_FNO","BSE_CURRENCY","MCX_COMM"]},"productType":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|------------------------------------------------|\n| CNC | Cash & Carry for equity deliveries |\n| INTRADAY | Intraday for Equity, Futures & Options |\n| MARGIN | Carry Forward in Futures & Options |\n| CO | Cover Order; entry and stop loss |\n| BO | Bracket Order; entry, stop loss & target price |\n| MTF | Margin Traded Fund |\n**CO & BO product types will be valid only for Intraday**","enum":["CNC","INTRADAY","MARGIN","MTF","CO","BO"]},"orderType":{"type":"string","description":"| **Enum Values** | **Description** |\n|------------------|-----------------------------|\n| LIMIT | For Limit Order types |\n| MARKET | For market Order types |\n| STOP_LOSS | For Stop Loss Limit orders |\n| STOP_LOSS_MARKET | For Stop Loss Market orders |","enum":["LIMIT","MARKET","STOP_LOSS","STOP_LOSS_MARKET"]},"validity":{"type":"string","description":"| **Enum Values** | **Description** |\n|-----------------|-----------------------|\n| DAY | Valid till end of day |\n| IOC | Immediate or Cancel |","enum":["DAY","IOC","GTC","GTD"]},"tradingSymbol":{"type":"string","description":"Exchange standard trading symbol"},"securityId":{"type":"string","description":"Exchange standard identification for each scrip"},"quantity":{"type":"integer","description":"Number of shares for the order","format":"int32"},"disclosedQuantity":{"type":"integer","description":"Number shares visible in the market depth","format":"int32"},"price":{"type":"number","description":"Price at which the order is requested to execute","format":"float"},"triggerPrice":{"type":"number","description":"Price at which the order is triggered","format":"float"},"afterMarketOrder":{"type":"boolean","description":"Flag to inform that the order placed is After Market Order"},"boProfitValue":{"type":"number","description":"Bracket order Target price","format":"float"},"boStopLossValue":{"type":"number","description":"Bracket Order/Cover Order Stop Loss Price","format":"float"},"legName":{"type":"string","enum":["ENTRY_LEG","STOP_LOSS_LEG","TARGET_LEG","NA"]},"createTime":{"type":"string","description":"Time at which the record is created"},"updateTime":{"type":"string","description":"Time at which the record is updated"},"exchangeTime":{"type":"string","description":"Time at which order reached at exchange end"},"drvExpiryDate":{"type":"string","description":"For F&O, expiry date of contract"},"drvOptionType":{"type":"string","description":"For Options, type CALL or PUT","enum":["CALL","PUT","NA"]},"drvStrikePrice":{"type":"number","description":"For Options, Strike Price","format":"float"},"omsErrorCode":{"type":"string","description":"When order is rejected or failed, omsErrorCode would be populated"},"omsErrorDescription":{"type":"string","description":"When order is rejected or failed, omsErrorDescription would be populated"},"filled_qty":{"type":"integer","description":"Filled Quantity","format":"int32"},"algoId":{"type":"string","description":"Algo_ID"}}},"BoLedgerResponse":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"narration":{"type":"string","description":"narration"},"voucherdate":{"type":"string","description":"voucher date"},"exchange":{"type":"string","description":"exchange name"},"voucherdesc":{"type":"string","description":"voucher decscription"},"vouchernumber":{"type":"string","description":"voucher number"},"debit":{"type":"string","description":"debited amount"},"credit":{"type":"string","description":"credited amount"},"runbal":{"type":"string","description":"runnable balance"}}},"HoldingResponse":{"type":"object","properties":{"exchange":{"type":"string","description":"Enum values is either NSE or BSE","enum":["NSE","BSE","MCX","ALL"]},"tradingSymbol":{"type":"string","description":"Exchange standard trading symbol"},"securityId":{"type":"string","description":"Exchange standard identification for each scrip"},"isin":{"type":"string","description":"International Securities Identification Number"},"totalQty":{"type":"integer","description":"Total number of shares in holding for given stock","format":"int32"},"dpQty":{"type":"integer","description":"Quantities present in depository","format":"int32"},"t1Qty":{"type":"integer","description":"Quantities not delivered to depository","format":"int32"},"availableQty":{"type":"integer","description":"Quantities available for transactions","format":"int32"},"collateralQty":{"type":"integer","description":"Quantities placed as collateral with broker","format":"int32"},"avgCostPrice":{"type":"number","description":"Average Buy Price of total quantities","format":"float"}}},"FundLimitResponse":{"type":"object","properties":{"dhanClientId":{"type":"string","description":"User specific identification generated by Dhan"},"availabelBalance":{"type":"number","description":"Available amount to trade","format":"float"},"sodLimit":{"type":"number","description":"Start of the day amount","format":"float"},"collateralAmount":{"type":"number","description":"Amount received against collateral","format":"float"},"receiveableAmount":{"type":"number","description":"Amount available against selling deliveries","format":"float"},"utilizedAmount":{"type":"number","description":"Amount utilised in the day","format":"float"},"blockedPayoutAmount":{"type":"number","description":"Amount blocked against payout request","format":"float"},"withdrawableBalance":{"type":"number","description":"Amount available to withdraw to bank","format":"float"}}},"EdisQtyStatusResponse":{"type":"object","properties":{"clientId":{"type":"string"},"isin":{"type":"string"},"totalQty":{"type":"string"},"aprvdQty":{"type":"string"},"status":{"type":"string"},"remarks":{"type":"string"}}}}}}