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": "123456"
  }
}

Order parameters

parameter  
tradingsymbol Tradingsymbol (ISIN) of the fund
transaction_type BUY or SELL
quantity Quantity to SELL. Not applicable on BUYs. If the holding is less than minimum_redemption_quantity, all the units have to be sold
amount Amount worth of units to purchase. Not applicable on SELLs
tag An optional tag to apply to an order to identify it (alphanumeric, max 8 chars)

Response attributes

attribute  
order_idstring 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": "123456"
  }
}

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": [{
    "order_id": "123123",
    "exchange_order_id": "12341234",
    "tradingsymbol": "INF090I01239",
    "status": "COMPLETE",
    "status_message": "",
    "folio": "1234ABC/123",
    "fund": "Franklin India Prima Plus",
    "order_timestamp": "2016-07-05 13:38",
    "exchange_timestamp": "2016-07-06",
    "settlement_id": "1617100",
    "transaction_type": "BUY",
    "variety": "regular",
    "purchase_type": "FRESH",
    "quantity": 10,
    "price": 0,
    "last_price": 580,
    "last_price_date": "2016-07-10",
    "average_price": 500.4463,
    "placed_by": "AB0012",
    "tag": ""
  }]
}

Response attributes

attribute  
order_idstring Unique order id
exchange_order_idnull, string Exchange generated order id
tradingsymbolstring ISIN of the fund
statusstring Current status of the order. Most common values or COMPLETE, REJECTED, CANCELLED, and OPEN. There may be other values as well
status_messagestring Textual description of the order's status. Failed orders come with human readable explanation
folionull, string Folio number generated by AMC for the completed purchase order
fundstring Name of the fund
order_timestampstring Timestamp at which the order was registered by the API
exchange_timestampstring Date on which the order was registered by the exchange. Orders that don't reach the exchange have null timestamps
settlement_idstring Exchange settlement ID
transaction_typestring BUY or SELL
varietystring Order variety (regular, sip)
purchase_typenull, string FRESH or ADDITIONAL (null incase of SELL order)
quantityfloat Number of units allotted or sold
pricefloat Buy or sell price
last_pricefloat Last available NAV price of the fund
average_pricefloat Allotted or sold NAV price
placed_bystring Id of the user that placed the order
tagstring 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": {
    "order_id": "123123",
    "exchange_order_id": "12341234",
    "tradingsymbol": "INF090I01239",
    "status": "COMPLETE",
    "status_message": "",
    "folio": "1234ABC/123",
    "fund": "Franklin India Prima Plus",
    "order_timestamp": "2016-07-05 13:38",
    "exchange_timestamp": "2016-07-06",
    "settlement_id": "1617100",
    "transaction_type": "BUY",
    "variety": "regular",
    "purchase_type": "FRESH",
    "quantity": 10,
    "price": 0,
    "last_price": 580,
    "average_price": 500.4463,
    "placed_by": "AB0012",
    "tag": ""
  }
}

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": {
    "order_id": "123457",
    "sip_id": "123457"
  }
}
parameter  
tradingsymbol ISIN of the fund
amount Amount worth of units to purchase. It should be equal to or greated than minimum_additional_purchase_amount and in multiple of purchase_amount_multiplier in the instrument master.
initial_amount 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 weekly, monthly, or quarterly
instalment_day If frequency is monthly, the day of the month (1, 5, 10, 15, 20, 25) to trigger the order on
instalments Number of instalments to trigger. If set to -1, instalments are triggered at fixed intervals until the SIP is cancelled
tag An optional tag to apply to an order to identify it (alphanumeric, max 8 chars)

Response attributes

attribute  
order_idstring, null Unique order id (in case initial_amount was used to create an initial investment)
sip_idstring 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":{}
}
parameter  
amount Amount worth of units to purchase. It should be equal to or greated than minimum_additional_purchase_amount and in multiple of purchase_amount_multiplier in the instrument master.
frequency weekly, monthly, or quarterly
instalment_day If frequency is monthly, the day of the month (1, 5, 10, 15, 20, 25) to trigger the order on
instalments Number of instalments to trigger. If set to -1, instalments are triggered idefinitely until the SIP is cancelled
status Pause or unpause an SIP (active or paused)

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" \

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" \
{
  "status": "success",
  "data": [{
    "sip_id": "1234",
    "tradingsymbol": "INF090I01239",
    "fund": "Franklin India Prima Plus",
    "dividend_type": "growth",
    "transaction_type": "BUY",
    "status": "ACTIVE",
    "created": "2016-01-01 13:00:00",
    "frequency": "monthly",
    "instalment_amount": 1000,
    "instalments": -1,
    "last_instalment": "2017-07-05 07:33:32",
    "pending_instalments": -1,
    "instalment_date": 5,
    "tag": ""
  }]
}

Response attributes

attribute  
sip_idstring Unique SIP id
tradingsymbolstring ISIN of the fund.
fundstring Name of the fund
dividend_typestring Dividend type (growth, payout)
transaction_typestring BUY or SELL
statusstring ACTIVE, PAUSED or CANCELLED
createdstring Timestamp at which the SIP was registered by the API
frequencystring Frequency at which order is triggered (monthly, weekly, or quarterly)
instalment_amountint Amount worth of units to purchase in each instalment
instalmentsint Number of instalments (-1 in case of SIPs active until cancelled)
last_instalmentstring Timestamp at which the last instalment was triggered
pending_instalmentsint Number of instalments pending (-1 in case of SIPs active until cancelled)
instalment_dayint Calendar day in a month on which SIP order to be triggered (valid only incase of frequency monthly, else 0)
tagstring 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": {
    "sip_id": "1234",
    "tradingsymbol": "INF090I01239",
    "fund": "Franklin India Prima Plus",
    "dividend_type": "growth",
    "transaction_type": "BUY",
    "status": "ACTIVE",
    "created": "2016-01-01 13:00:00",
    "frequency": "monthly",
    "instalment_amount": 1000,
    "instalments": -1,
    "last_instalment": "2017-07-05 07:33:32",
    "pending_instalments": -1,
    "instalment_date": 5,
    "tag": ""
  }
}

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": "123123/123",
    "fund": "Kotak Select Focus Fund - Direct Plan",
    "tradingsymbol": "INF174K01LS2",
    "average_price": 30.729,
    "last_price": 33.014,
    "pnl": 594.769,
    "last_price_date": "2016-11-11",
    "quantity": 260.337
  }]
}

Response attributes

attribute  
folionull, string Folio number generated by AMC for the completed purchase order (null incase of SELL order)
fundstring Name of the fund
tradingsymbolstring ISIN of the fund.
average_pricefloat Allotted NAV price for a completed BUY order; Selling NAV price for completed SELL order
last_pricefloat Last available NAV price of the fund
pnlfloat Net returns of the holding. Based on the last available NAV price.
last_price_datestring Date for which last NAV is available
quantityfloat 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  
tradingsymbolstring ISIN of the fund
amcstring AMC code as per the exchange
namestring Fund name
purchase_allowedstring 0 or 1
redemption_allowedstring 0 or 1
minimum_purchase_amountfloat Minimum purchase amount for the first BUY
purchase_amount_multiplierfloat Buy amount should be in multiple of this value
minimum_additional_purchase_amountfloat Minimum additional BUY amount
minimum_redemption_quantityfloat Minimum SELL quantity
redemption_quantity_multiplierfloat SELL quantity multiple
dividend_typestring growth or payout
scheme_typestring equity, debt, elss
planstring direct or regular
settlement_typestring Settlement type of the fund (T1, T2 etc.)
last_pricefloat Last available NAV price of the fund
last_price_datestring Last available NAV's date