Skip to main content

Overview

Contract notes are daily trade confirmations from brokers. CAS Parser extracts structured trade data from these PDFs.

Supported Brokers

BrokerAuto-detectedPassword
ZerodhaPAN number
GrowwPAN number
UpstoxPAN number
ICICI DirectPAN number
The API auto-detects the broker — no need to specify which broker issued the contract note.

Parse a contract note

import requests

response = requests.post(
    "https://api.casparser.in/v4/contract_note/parse",
    headers={"x-api-key": "YOUR_API_KEY"},
    files={"file": open("contract_note.pdf", "rb")},
    data={"password": "ABCDE1234F"}
)

data = response.json()
for trade in data.get("trades", []):
    print(f"{trade['symbol']}: {trade['quantity']} @ ₹{trade['price']}")

Response format

{
  "status": "success",
  "broker": "zerodha",
  "trade_date": "2024-01-15",
  "client": {
    "name": "John Doe",
    "client_id": "AB1234",
    "pan": "ABCDE1234F"
  },
  "trades": [
    {
      "symbol": "RELIANCE",
      "isin": "INE002A01018",
      "exchange": "NSE",
      "segment": "EQ",
      "trade_type": "BUY",
      "quantity": 10,
      "price": 2450.50,
      "trade_value": 24505.00,
      "brokerage": 12.25,
      "stt": 24.51,
      "other_charges": 5.67,
      "net_value": 24547.43
    }
  ],
  "summary": {
    "total_buy_value": 24505.00,
    "total_sell_value": 0,
    "total_charges": 42.43,
    "net_obligation": 24547.43
  }
}

Trade fields

FieldDescription
symbolTrading symbol (e.g., RELIANCE)
isinISIN code
exchangeNSE, BSE
segmentEQ (equity), FO (F&O), etc.
trade_typeBUY or SELL
quantityNumber of shares
pricePer-share price
trade_valuequantity × price
brokerageBroker fee
sttSecurities Transaction Tax
other_chargesExchange fees, GST, etc.
net_valueFinal settlement amount

Credit usage

OperationCredits
Parse contract note0.5
Contract notes cost half a credit compared to CAS parsing (1 credit).

Use cases

  • Portfolio tracking — Automatically import trades into your app
  • Tax calculation — Extract capital gains data for ITR filing
  • Trade analytics — Analyze trading patterns and costs
  • Reconciliation — Match broker records with demat statements

Next steps