Skip to content

EDIS

To sell holding stocks, one needs to complete the CDSL eDIS flow, generate T-PIN & mark stock to complete the sell action.Following are the APIs-

GET /edis/tpin Generate T-PIN
POST /edis/from Retrieve escaped html form & enter T-PIN
GET /edis/inquire/{isin} Inquire the status of stock for edis approval.

generate_tpin Generate T-PIN
open_browser_for_tpin Retrieve escaped html form & enter T-PIN
edis_inquiry Inquire the status of stock for edis approval.

Generate T-PIN

Get T-Pin on your registered mobile number using this API.

curl --request GET \
--url https://api.dhan.co/edis/tpin \
--header 'Content-Type: application/json' \
--header 'access-token: JWT'
dhan.generate_tpin()


Request Structure

No Body


Response Structure

202 Accepted

Generate eDIS Form

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. You can get ISIN of portfolio stocks, in response of holdings API.

curl --request POST \
--url https://api.dhan.co/edis/form \
--header 'Content-Type: application/json' \
--header 'access-token: ' \
--data '{}'
dhan.open_browser_for_tpin(data)


Request Structure

{
    "isin": "INE733E01010",  
    "qty": 1,
    "exchange": "NSE",
    "segment": "EQ",
    "bulk": true
}
dhan.open_browser_for_tpin(
    isin='INE733E01010',
    qty=1,
    exchange=NSE,
    segment='EQ',
    bulk=true
)


Parameters

Field Field Type Description
isin string International Securities Identification Number
qty int Number of shares to mark for edis transaction
exchange string Exhange NSE BSE
segment string Segment EQ
bulk boolean To mark edis for all stocks in portfolio


Response Structure

{
    "dhanClientId": "1000000401",
    "edisFormHtml": "<!DOCTYPE html> <html>     <script>window.onload= function()
        {submit()};function submit(){ document.getElementById(\"submitbtn\").click();    }
        </script><body onload=\"submit()\">     <form name=\"frmDIS\" method=\"post\" 
        action=\"https://edis.cdslindia.com/eDIS/VerifyDIS/\" style=\"                
        text-align: center; margin-top: 35px; /* margin-bottom: 15px; */ \">             
        <input type= \"hidden\" name= \"DPId\" value= \"83400\" >  
        <input type= \"hidden\" name= \"ReqId\" value= \"291951000000401\" >             
        <input type= \"hidden\" name= \"Version\" value= \"1.1\" >             
        <input type= \"hidden\" name= \"TransDtls\" value= \"kQBOKYtPSbWmbLYOih9ZXaLZuA3Ig5ycFPangwWZKTPgmIqdfXL58qN3tGfDlVH+S613mfqTkIWVkQTiMrqUHkzvTRxkr7NtJtP7O3Z7+Xro9Fs5svt2tQDrNJGSd1oEqc4dhoc+FCS8u9ZhNCFqkZ30djjKqjTp1j12fv4cZVwzupyLfVVyh0U8TwwqSAEP4mdq3uiimxADlrHVRrn5NSL+ndUn5BhplI7F9Ksiscj9hxz6iK2Os8m5JMFBU7bmNmIWWHEgTLOz0N+roldjRs2M8mVXSx+M+41jrdSWaCnMxvm+L2HNbsT94Zv8wEWmxSCcSDcvVFhbpcWP5RVQMHQpV6cw6+s7qfn1AWexGiUJk3APPnhYdXPjwIewhyL5rEhNRnCy+cZaJSzsBpatfOJO3xjrZd6zDv6raf/4EUwHJ8yOVYjG5L4uAjnsfBy0SCuqYnxmMphI8/mnJlopH71Kvi9IkH/wPBiKvOkNYpJD3+CFXE6No3RrRiC8DF1pkSaMm7IxdHr0ui2QBmyqcg==\" >  
        <input style=\"display: none;\" id=\"submitbtn\" type= \"submit\" value=\"Submit\">     
        </form> </body> </html>"
}


Parameters

Field Field type Description
dhanClientId string User specific identification generated by Dhan
edisFormHtml string Escaped HTML Form

EDIS Status & Inquiry

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.

Alternatively, you can pass "ALL" instead of ISIN to get eDIS status of all holdings in your portfolio.

curl --request GET \
--url https://api.dhan.co/edis/inquire/{isin} \
--header 'Content-Type: application/json' \
--header 'access-token: JWT'
dhan.edis_inquiry(isin)


Request Structure

No Body


Response Structure

{
    "clientId": "1000000401",
    "isin": "INE00IN01015",
    "totalQty": 10,
    "aprvdQty": 4,
    "status": "SUCCESS",
    "remarks": "eDIS transaction done successfully"
}


Parameters

Field Field type Description
clientId string User specific identification
isin string International Securities Identification Number
totalQty string Total number of shares for given stock
aprvdQty string Number of approved stocks
status string Status of the edis order
remark string remarks of the order status


Note: For description of enum values, refer Annexure