Skip to main content

Overview

CAS Generator triggers a mutual fund CAS statement to be emailed to your user — no manual portal visits needed. Coverage: Uses KFintech’s email mailback service. KFintech and CAMS have a mutual partnership that provides data from both RTAs (Registrar and Transfer Agents), so this endpoint retrieves mutual fund data from both KFintech and CAMS, covering all mutual funds in India. Use cases:
  • Client onboarding (request 50 years of history)
  • Automated monthly portfolio updates
  • Filling gaps in transaction history
KFintech emails the CAS to the user’s registered email within a few minutes. The CAS is not returned in the API response.

Request a CAS statement

import requests

response = requests.post(
    "https://api.casparser.in/v4/kfintech/generate",
    headers={"x-api-key": "YOUR_API_KEY"},
    json={
        "email": "investor@example.com",
        "from_date": "1990-01-01",
        "to_date": "2024-01-15",
        "password": "Abcdefghi12$"
    }
)

data = response.json()
# {"status": "success", "msg": "CAS request submitted. Check email shortly."}

Parameters

ParameterRequiredDescription
emailYesUser’s email registered with KFintech
pan_noNoUser’s PAN number (optional)
from_dateYesStart date (YYYY-MM-DD)
to_dateYesEnd date (YYYY-MM-DD)
passwordYesPassword for the PDF

Integration patterns

Pattern 1: Generate + Gmail Import

Combine CAS Generator with Gmail Inbox Import for a seamless flow:
# 1. Request CAS generation
requests.post(
    "https://api.casparser.in/v4/kfintech/generate",
    headers={"x-api-key": API_KEY},
    json={
        "email": "user@gmail.com",
        "from_date": "2020-01-01",
        "to_date": "2024-12-31",
        "password": "Abcdefghi12$"
    }
)

# 2. Wait for email (1-2 minutes)
time.sleep(120)

# 3. Import from Gmail
response = requests.post(
    "https://api.casparser.in/v4/inbox/cas",
    headers={
        "x-api-key": API_KEY,
        "x-inbox-token": inbox_token
    }
)

Pattern 2: User-initiated

Let users trigger generation and upload manually:
// Frontend
const requestCAS = async () => {
  await fetch('/api/generate-cas', {
    method: 'POST',
    body: JSON.stringify({ email: user.email, pan: user.pan })
  });
  
  alert('CAS will arrive in your email in 1-2 minutes. Upload it here when received.');
};

Timing expectations

StepDuration
API request< 1 second
KFintech processing1-2 minutes
Email deliveryDepends on email provider

Date range options

from datetime import datetime, timedelta

# Last 1 year
requests.post(..., json={
    "email": "user@example.com",
    "from_date": (datetime.now() - timedelta(days=365)).strftime("%Y-%m-%d"),
    "to_date": datetime.now().strftime("%Y-%m-%d"),
    "password": "Abcdefghi12$"
})

# Complete history (50+ years)
requests.post(..., json={
    "email": "user@example.com",
    "from_date": "1970-01-01",
    "to_date": datetime.now().strftime("%Y-%m-%d"),
    "password": "Abcdefghi12$"
})

Credit usage

OperationCredits
Generate CAS0.5

Comparison: CDSL Fetch vs CAS Generator

FeatureCDSL FetchCAS Generator
SpeedReal-time (~20s)1-2 minutes
Data sourceCDSL eCAS (all holdings)KFintech + CAMS (all MFs)
HistoryCurrent holdings50+ years transactions
User inputPAN + BO ID + DOB + OTPEmail + date range
Asset classesDemat + Non-Demat (stocks, bonds, MFs, etc.)Mutual funds
Important: CDSL eCAS statements contain holdings from both CDSL and NSDL depositories. Similarly, NSDL eCAS contains both NSDL and CDSL holdings. This is a consolidated view across all depositories, not limited to the issuing depository.

Next steps