Mutual funds¶
The mutual fund APIs allow buying, selling, and managing SIPs of mutual funds listed on Zerodha's Coin platform, where successful purchases are delivered to the buyer's DEMAT account. The APIs are built on top of the BSE STARMF platform. The mutual fund APIs have been grouped here under a separate section as they differ in structure, although not substantially, from the other trading APIs.
type | endpoint | |
---|---|---|
POST | /mf/orders | Place a buy or a sell order |
DELETE | /mf/orders/:order_id | Cancel an open or pending order |
GET | /mf/orders | Retrieve the list of all orders (open and executed) over the last 7 days |
GET | /mf/orders/:order_id | Retrieve an individual order |
POST | /mf/sips | Place a SIP order |
PUT | /mf/sips/:order_id | Modify an open SIP order |
DELETE | /mf/sips/:order_id | Cancel an open SIP order |
GET | /mf/sips/ | Retrieve the list of all open SIP orders |
GET | /mf/sips/:order_id | Retrieve an individual SIP order |
GET | /mf/holdings | Retrieve the list of mutual fund holdings available in the DEMAT |
GET | /mf/instruments | Retrieve the master list of all mutual funds available on the platform |
Note
Dividend reinvestment schemes are currently not supported.
Placing orders¶
Unlike stock APIs, mutual fund orders are not sent to the exchange immediately, but at a preset times, in batches, every day. More information can be found on Coin. A placed order can be cancelled and placed again any number of times before its cut-off time. To modify an existing order for a particular fund, you just have to place a new order, as it'll overwrite the existing order.
Note
Mutual fund orders are not sent to the exchange immediately. They're collected, batched, and sent to the exchange at 01:30 PM on market days.
curl "https://api.kite.trade/mf/orders" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
-d "tradingsymbol=INF174K01LS2" \
-d "transaction_type=BUY" \
-d "amount=1000"
{
"status": "success",
"data": {
"order_id": "3bb085d1-5038-450e-a807-6543fef6c9ae"
}
}
Order parameters¶
parameter | |
---|---|
tradingsymbol string |
Tradingsymbol (ISIN) of the fund |
transaction_type string |
BUY or SELL |
quantity float64 |
Quantity to SELL. Not applicable on BUYs. If the holding is less than minimum_redemption_quantity , all the units have to be sold |
amount float64 |
Amount worth of units to purchase. Not applicable on SELLs |
tag string |
An optional tag to apply to an order to identify it (alphanumeric, max 8 chars) |
Response attributes¶
attribute | |
---|---|
order_id string |
Unique order id |
Cancelling orders¶
As long as an order is open in the system, it can be cancelled.
curl --request DELETE \
"https://api.kite.trade/mf/orders/123456" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
{
"status": "success",
"data": {
"order_id": "3bb085d1-5038-450e-a807-6543fef6c9ae"
}
}
Response attributes¶
attribute | |
---|---|
order_id string |
Unique order id |
Retrieving orders¶
This API returns all orders placed in the last 7 days.
curl "https://api.kite.trade/mf/orders" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token"
{
"status": "success",
"data": [
{
"status": "REJECTED",
"purchase_type": "FRESH",
"folio": null,
"order_timestamp": "2021-06-30 08:33:07",
"average_price": 0.0,
"exchange_order_id": "254657127",
"last_price": 30.6800,
"tradingsymbol": "INF179K01VY8",
"settlement_id": "2122061",
"transaction_type": "BUY",
"order_id": "271989e0-a64e-4cf3-b4e4-afb8f38dd203",
"amount": 1000.0,
"tag": null,
"placed_by": "ZV8062",
"exchange_timestamp": "2021-06-30",
"variety": "amc_sip",
"last_price_date": "2021-06-29",
"status_message": "AMC SIP: Insufficient balance.",
"fund": "HDFC Balanced Advantage Fund - Direct Plan",
"quantity": 0.0
},
{
"status": "REJECTED",
"purchase_type": "ADDITIONAL",
"folio": null,
"order_timestamp": "2021-06-30 01:30:02",
"average_price": 0.0,
"exchange_order_id": null,
"last_price": 52.7980,
"tradingsymbol": "INF174K01LS2",
"settlement_id": null,
"transaction_type": "BUY",
"order_id": "ef7e696c-2fa6-400b-b180-eb25e6a04ccf",
"amount": 2000.0,
"tag": "coinandroidsip",
"placed_by": "ZV8062",
"exchange_timestamp": null,
"variety": "sip",
"last_price_date": "2021-06-29",
"status_message": "SIP: Insufficient balance.",
"fund": "Kotak Flexicap Fund - Direct Plan",
"quantity": 0.0
},
{
"status": "OPEN",
"purchase_type": "FRESH",
"folio": null,
"order_timestamp": "2021-06-29 12:20:28",
"average_price": 0.0,
"exchange_order_id": null,
"last_price": 10.4324,
"tradingsymbol": "INF761K01EE1",
"settlement_id": null,
"transaction_type": "BUY",
"order_id": "2b6ad4b7-c84e-4c76-b459-f3a8994184f1",
"amount": 5000.0,
"tag": null,
"placed_by": "ZV8062",
"exchange_timestamp": null,
"variety": "regular",
"last_price_date": "2021-06-29",
"status_message": "Insufficient fund. 1/5",
"fund": "BOI AXA Arbitrage Fund - Direct Plan",
"quantity": 0.0
},
{
"status": "REJECTED",
"purchase_type": "FRESH",
"folio": null,
"order_timestamp": "2021-06-29 08:36:41",
"average_price": 0.0,
"exchange_order_id": "254447867",
"last_price": 271.7500,
"tradingsymbol": "INF179K01WA6",
"settlement_id": "2122060",
"transaction_type": "BUY",
"order_id": "40410882-b1f8-4938-bb08-4bef2765cbfb",
"amount": 1000.0,
"tag": null,
"placed_by": "ZV8062",
"exchange_timestamp": "2021-06-29",
"variety": "amc_sip",
"last_price_date": "2021-06-29",
"status_message": "AMC SIP: Insufficient balance.",
"fund": "HDFC Balanced Advantage Fund - Direct Plan",
"quantity": 0.0
},
{
"status": "OPEN",
"purchase_type": "FRESH",
"folio": null,
"order_timestamp": "2021-06-24 15:37:27",
"average_price": 0.0,
"exchange_order_id": null,
"last_price": 11.5182,
"tradingsymbol": "INF109K01V59",
"settlement_id": null,
"transaction_type": "BUY",
"order_id": "e67b8741-5054-4fd5-a2da-8c672e1f494a",
"amount": 5000.0,
"tag": null,
"placed_by": "ZV8062",
"exchange_timestamp": null,
"variety": "regular",
"last_price_date": "2021-06-29",
"status_message": "Insufficient fund. 3/5",
"fund": "ICICI Prudential Bond Fund - Direct Plan",
"quantity": 0.0
}
]
}
Response attributes¶
attribute | |
---|---|
order_id string |
Unique order id |
exchange_order_id null, string |
Exchange generated order id |
tradingsymbol string |
ISIN of the fund |
status null, string |
Current status of the order. Most common values or COMPLETE, REJECTED, CANCELLED, and OPEN. There may be other values as well |
status_message null, string |
Textual description of the order's status. Failed orders come with human readable explanation |
folio null, string |
Folio number generated by AMC for the completed purchase order |
fund string |
Name of the fund |
order_timestamp string |
Timestamp at which the order was registered by the API |
exchange_timestamp string |
Date on which the order was registered by the exchange. Orders that don't reach the exchange have null timestamps |
settlement_id string |
Exchange settlement ID |
transaction_type string |
BUY or SELL |
amount float64 |
Amount placed for purchase of units |
variety string |
Order variety (regular, sip) |
purchase_type null, string |
FRESH or ADDITIONAL (null incase of SELL order) |
quantity float64 |
Number of units allotted or sold |
price float64 |
Buy or sell price |
last_price float64 |
Last available NAV price of the fund |
average_price float64 |
Allotted or sold NAV price |
placed_by string |
Id of the user that placed the order |
last_price_date string |
Date for which last NAV is available |
tag string |
Tag that was sent with an order to identify it (alphanumeric, max 8 chars) |
Retrieving an individual order¶
While the orders list API returns orders within the last 7 days, given an order ID, this API will return the order details irrespective of its age.
curl "https://api.kite.trade/mf/orders/123123"
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
{
"status": "success",
"data": {
"status": "OPEN",
"purchase_type": "FRESH",
"exchange_order_id": null,
"last_price": 10.4324,
"order_timestamp": "2021-06-29 12:20:28",
"fund": "BOI AXA Arbitrage Fund - Direct Plan",
"tradingsymbol": "INF761K01EE1",
"tag": null,
"placed_by": "ZV8062",
"last_price_date": "2021-06-29",
"folio": null,
"variety": "regular",
"exchange_timestamp": null,
"average_price": 0.0,
"settlement_id": null,
"transaction_type": "BUY",
"order_id": "2b6ad4b7-c84e-4c76-b459-f3a8994184f1",
"amount": 5000.0,
"status_message": "Insufficient fund. 1/5",
"quantity": 0
}
}
Placing SIP orders¶
SIP (Systematic Investment Plan) orders persist in the system once created and send orders to the exchange at recurring intervals. For instance, buying 5000 worth of units of a particular fund on the first of every month. It's important to note that prior to creating a SIP on an account, there has to have been at least one investment in the target fund. If not, an order worth initial_amount
is created automatically along with the SIP.
curl "https://api.kite.trade/mf/sips" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
-d "tradingsymbol=INF174K01LS2" \
-d "frequency=monthly" \
-d "instalment_day=1" \
-d "instalments=-1" \
-d "initial_amount=5000" \
-d "amount=1000"
{
"status": "success",
"data": {
"sip_id": "986124545877922"
}
}
parameter | |
---|---|
tradingsymbol string |
ISIN of the fund |
amount float64 |
Amount worth of units to purchase. It should be equal to or greater than minimum_additional_purchase_amount and in multiple of purchase_amount_multiplier in the instrument master. |
initial_amount float64 |
Amount worth of units to purchase before the SIP starts. Should be equal to or greater than minimum_purchase_amount and in multiple of purchase_amount_multiplier . This is only considered if there have been no prior investments in the target fund. |
frequency string |
weekly, monthly, or quarterly |
instalment_day int64 |
If frequency is monthly, the day of the month (1, 5, 10, 15, 20, 25) to trigger the order on |
instalments int64 |
Number of instalments to trigger. If set to -1, instalments are triggered at fixed intervals until the SIP is cancelled |
tag string |
An optional tag to apply to an order to identify it (alphanumeric, max 8 chars) |
Response attributes¶
attribute | |
---|---|
sip_id string |
Unique SIP id |
Modifying SIPs¶
Unlike SIPs with a regular AMC, SIPs on Coin can be modified at any point of time. For instance, they can be created to invest INR 5000 every month, but can be modified to invest INR 1500 weekly.
curl --request PUT \
"https://api.kite.trade/mf/sip/1234" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
-d "frequency=monthly" \
-d "instalments=10" \
-d "amount=1000" \
-d "status=paused" \
-d "instalment_day=1"
{
"status": "success",
"data": {
"sip_id": "986124545877922"
}
}
parameter | |
---|---|
amount float64 |
Amount worth of units to purchase. It should be equal to or greater than minimum_additional_purchase_amount and in multiple of purchase_amount_multiplier in the instrument master. |
frequency string |
weekly, monthly, or quarterly |
instalment_day int64 |
If frequency is monthly, the day of the month (1, 5, 10, 15, 20, 25) to trigger the order on |
instalments int64 |
Number of instalments to trigger. If set to -1, instalments are triggered indefinitely until the SIP is cancelled |
status string |
Pause or unpause an SIP (active or paused ) |
Response attributes¶
attribute | |
---|---|
order_id string |
Unique order id |
Cancelling SIPs¶
A SIP order can be cancelled at any time, as long as it hasn't self-cancelled based on the instalments
param.
Note
There has to have been at least one investment in a fund prior to starting an SIP. This can be handled with the initial_amount
field.
curl --request DELETE \
"https://api.kite.trade/mf/sips/123456" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
{
"status": "success",
"data": {
"sip_id": "986124545877922"
}
}
Response attributes¶
attribute | |
---|---|
sip_id string |
Unique SIP id |
Retrieving all SIPs¶
This API returns the list of all active and paused SIPs
curl "https://api.kite.trade/mf/sips"
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
{
"data": [
{
"status": "ACTIVE",
"sip_reg_num": null,
"created": "2021-05-05 05:56:27",
"dividend_type": "idcw",
"instalment_amount": 500.0,
"fund": "Aditya Birla Sun Life Liquid Fund - Direct Plan",
"instalments": -1,
"next_instalment": "2021-05-12",
"transaction_type": "BUY",
"trigger_price": 0,
"step_up": {
"05-05": 10
},
"tradingsymbol": "INF209K01VD7",
"tag": "coiniossip",
"frequency": "weekly",
"last_instalment": "2021-05-05 05:56:27",
"pending_instalments": -1,
"instalment_day": 0,
"sip_type": "sip",
"completed_instalments": 0,
"sip_id": "892741486820670"
},
{
"status": "ACTIVE",
"sip_reg_num": null,
"created": "2021-05-25 10:55:09",
"dividend_type": "idcw",
"instalment_amount": 1000.0,
"fund": "HDFC Balanced Advantage Fund - Direct Plan",
"instalments": -1,
"next_instalment": "2021-06-01",
"transaction_type": "BUY",
"trigger_price": 0,
"step_up": {
"25-05": 10
},
"tradingsymbol": "INF179K01VY8",
"tag": "coiniossip",
"frequency": "weekly",
"last_instalment": "2021-05-25 10:55:09",
"pending_instalments": -1,
"instalment_day": 0,
"sip_type": "sip",
"completed_instalments": 0,
"sip_id": "109195857904698"
},
{
"status": "ACTIVE",
"sip_reg_num": "15158182",
"created": "2021-05-22 10:45:29",
"dividend_type": "idcw",
"instalment_amount": 1000.0,
"fund": "HDFC Balanced Advantage Fund - Direct Plan",
"instalments": 9999,
"next_instalment": "2021-07-12",
"transaction_type": "BUY",
"trigger_price": 0,
"step_up": {},
"tradingsymbol": "INF179K01VY8",
"tag": "coinandroidsip",
"frequency": "monthly",
"last_instalment": "2021-06-10 08:37:11",
"pending_instalments": 9998,
"instalment_day": 10,
"sip_type": "amc_sip",
"completed_instalments": 1,
"sip_id": "846479755969168"
},
{
"status": "ACTIVE",
"sip_reg_num": "16055666",
"created": "2021-06-18 03:56:46",
"dividend_type": "idcw",
"instalment_amount": 1000.0,
"fund": "HDFC Balanced Advantage Fund - Direct Plan",
"instalments": 9999,
"next_instalment": "2021-07-30",
"transaction_type": "BUY",
"trigger_price": 0,
"step_up": {},
"tradingsymbol": "INF179K01VY8",
"tag": "coinandroidsip",
"frequency": "monthly",
"last_instalment": "2021-06-30 08:33:07",
"pending_instalments": 9998,
"instalment_day": 30,
"sip_type": "amc_sip",
"completed_instalments": 1,
"sip_id": "749073272501476"
},
{
"status": "ACTIVE",
"sip_reg_num": null,
"created": "2020-11-20 01:06:11",
"dividend_type": "growth",
"instalment_amount": 7427.0,
"fund": "HDFC Hybrid Equity Fund - Direct Plan",
"instalments": -1,
"next_instalment": "2021-02-19",
"transaction_type": "BUY",
"trigger_price": 0,
"step_up": {
"20-11": 30
},
"tradingsymbol": "INF179K01XZ1",
"tag": "coinandroidsip",
"frequency": "quarterly",
"last_instalment": "2020-11-20 01:06:11",
"pending_instalments": -1,
"instalment_day": 0,
"sip_type": "sip",
"completed_instalments": 0,
"sip_id": "576440634181776"
}]
}
Response attributes¶
attribute | |
---|---|
sip_id string |
Unique SIP id |
tradingsymbol string |
ISIN of the fund. |
fund string |
Name of the fund |
dividend_type string |
Dividend type (growth, payout) |
transaction_type string |
BUY or SELL |
status string |
ACTIVE, PAUSED or CANCELLED |
created string |
Timestamp at which the SIP was registered by the API |
frequency string |
Frequency at which order is triggered (monthly, weekly, or quarterly) |
next_instalment string |
Upcoming instalment date |
instalment_amount int64 |
Amount worth of units to purchase in each instalment |
instalments int64 |
Number of instalments (-1 in case of SIPs active until cancelled) |
last_instalment string |
Timestamp at which the last instalment was triggered |
pending_instalments int64 |
Number of instalments pending (-1 in case of SIPs active until cancelled) |
instalment_day int64 |
Calendar day in a month on which SIP order to be triggered (valid only incase of frequency monthly, else 0) |
completed_instalments int64 |
Total number of completed instalments from the start |
tag string |
Tag that was sent with an order to identify it (alphanumeric, max 8 chars) |
Retrieving an individual SIP¶
Given a SIP id, this call returns its details. This also works for deleted SIPs that are not included in the SIP list.
curl "https://api.kite.trade/mf/sips/1234" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
{
"status": "success",
"data": {
"status": "ACTIVE",
"sip_reg_num": null,
"pending_instalments": -1,
"created": "2022-02-15 13:39:44",
"step_up": {
"15-02": 10
},
"dividend_type": "growth",
"instalment_amount": 5000.00,
"tag": "coiniossip",
"instalments": -1,
"next_instalment": "2022-02-22",
"transaction_type": "BUY",
"trigger_price": 0,
"fund": "Aditya Birla Sun Life Overnight Fund - Direct Plan",
"tradingsymbol": "INF209KB1ZH2",
"frequency": "weekly",
"last_instalment": "2022-02-15 13:39:44",
"instalment_day": 0,
"sip_type": "sip",
"fund_source": "pool",
"completed_instalments": 0,
"sip_id": "181635213661372"
}
}
Holdings¶
Holdings contain the user's portfolio of allotted mutual fund units.
curl "https://api.kite.trade/mf/holdings" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
{
"status": "success",
"data": [
{
"folio": "3108290884",
"average_price": 78.43,
"last_price": 84.86,
"last_price_date": "",
"pledged_quantity": 0,
"fund": "INVESCO INDIA TAX PLAN - DIRECT PLAN",
"tradingsymbol": "INF205K01NT8",
"pnl": 0,
"quantity": 382.488
},
{
"folio": "5102495241",
"average_price": 1874.101138,
"last_price": 2081.4984,
"last_price_date": "",
"pledged_quantity": 0,
"fund": "Indiabulls Liquid Fund - Direct Plan",
"tradingsymbol": "INF666M01451",
"pnl": 0,
"quantity": 1.334
},
{
"folio": "9104386836",
"average_price": 116.7,
"last_price": 101.13,
"last_price_date": "",
"pledged_quantity": 0,
"fund": "BOI AXA TAX ADVANTAGE FUND - DIRECT PLAN",
"tradingsymbol": "INF761K01884",
"pnl": 0,
"quantity": 257.057
}
]
}
Response attributes¶
attribute | |
---|---|
folio null, string |
Folio number generated by AMC for the completed purchase order (null incase of SELL order) |
fund string |
Name of the fund |
tradingsymbol string |
ISIN of the fund. |
average_price float64 |
Allotted NAV price for a completed BUY order; Selling NAV price for completed SELL order |
last_price float64 |
Last available NAV price of the fund |
pnl float64 |
Net returns of the holding. Based on the last available NAV price. |
last_price_date string |
Date for which last NAV is available |
quantity float64 |
Quantity available in the client's holding for this ISIN. |
Retrieving the full instrument list¶
Unlike the rest of the calls that return JSON, the instrument list API returns a Gzipped CSV dump of mutual funds supported by Zerodha's Coin platform.
curl "https://api.kite.trade/mf/instruments" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token" \
tradingsymbol,amc,name,purchase_allowed,redemption_allowed,minimum_purchase_amount,purchase_amount_multiplier,minimum_additional_purchase_amount,minimum_redemption_quantity,redemption_quantity_multiplier,dividend_type,scheme_type,plan,settlement_type,last_price,last_price_date
INF846K01DP8,AXISMUTUALFUND_MF,Axis Equity Fund - Direct Plan - Growth,1,1,5000.0,1.0,100.0,1.0,0.001,growth,equity,direct,T3,20.09,2016-11-11
INF846K01EW2,AXISMUTUALFUND_MF,Axis Long Term Equity Fund - Direct Growth,1,1,500.0,500.0,500.0,1.0,0.001,growth,elss,direct,T3,33.0425,2016-11-11
INF174K01LS2,KOTAKMAHINDRAMF,Kotak Select Focus Fund- Direct Plan - Growth,1,1,5000.0,1.0,1000.0,0.001,0.001,growth,equity,direct,T3,26.549,2016-11-11
INF174K01336,KOTAKMAHINDRAMF,Kotak Select Focus Fund-Growth,1,1,5000.0,0.01,1000.0,0.001,0.001,growth,equity,regular,T3,25.635,2016-11-11
Response columns¶
column | |
---|---|
tradingsymbol string |
ISIN of the fund |
amc string |
AMC code as per the exchange |
name string |
Fund name |
purchase_allowed string |
0 or 1 |
redemption_allowed string |
0 or 1 |
minimum_purchase_amount float64 |
Minimum purchase amount for the first BUY |
purchase_amount_multiplier float64 |
Buy amount should be in multiple of this value |
minimum_additional_purchase_amount float64 |
Minimum additional BUY amount |
minimum_redemption_quantity float64 |
Minimum SELL quantity |
redemption_quantity_multiplier float64 |
SELL quantity multiple |
dividend_type string |
growth or payout |
scheme_type string |
equity , debt , elss |
plan string |
direct or regular |
settlement_type string |
Settlement type of the fund (T1 , T2 etc.) |
last_price float64 |
Last available NAV price of the fund |
last_price_date string |
Last available NAV's date |