Parse Contract Note PDF
curl --request POST \
--url https://api.casparser.in/v4/contract_note/parse \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form pdf_file='@example-file' \
--form 'password=<string>'import requests
url = "https://api.casparser.in/v4/contract_note/parse"
files = { "pdf_file": ("example-file", open("example-file", "rb")) }
payload = { "password": "<string>" }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('pdf_file', '<string>');
form.append('password', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.casparser.in/v4/contract_note/parse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.casparser.in/v4/contract_note/parse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pdf_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.casparser.in/v4/contract_note/parse"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pdf_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.casparser.in/v4/contract_note/parse")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pdf_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v4/contract_note/parse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pdf_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": "success",
"msg": "success",
"data": {
"contract_note_info": {
"contract_note_number": "CNT-25/26-73436720",
"trade_date": "2025-08-05",
"settlement_number": "2025149",
"settlement_date": "2025-08-06"
},
"broker_info": {
"broker_type": "zerodha",
"name": "Zerodha Broking Limited",
"sebi_registration": "INZ000031633"
},
"client_info": {
"name": "VIRENDER KUMAR",
"pan": "FAXAK2545F",
"ucc": "YS3654",
"place_of_supply": "DELHI",
"gst_state_code": "7",
"address": "<string>"
},
"equity_transactions": [
{
"isin": "INE172A01027",
"security_name": "CASTROLIND",
"security_symbol": "CASTROLIND",
"buy_quantity": 123,
"buy_wap": 123,
"buy_total_value": 123,
"sell_quantity": 123,
"sell_wap": 123,
"sell_total_value": 123,
"net_obligation": 123
}
],
"derivatives_transactions": [
{
"contract_description": "NIFTY24802410DPE",
"buy_sell_bf_cf": "B",
"quantity": 123,
"wap_per_unit": 123,
"brokerage_per_unit": 123,
"closing_rate_per_unit": 123,
"net_total": 123
}
],
"detailed_trades": [
{
"order_number": "1000000042939390",
"order_time": "13:13:13",
"trade_number": "4006567",
"trade_time": "13:13:13",
"security_description": "CASTROLIND-EQ/INE172A01027",
"buy_sell": "B",
"exchange": "NSE",
"quantity": 123,
"brokerage": 123,
"net_rate_per_unit": 123,
"closing_rate_per_unit": 123,
"net_total": 123,
"remarks": "<string>"
}
],
"charges_summary": {
"pay_in_pay_out_obligation": 123,
"taxable_value_brokerage": 123,
"exchange_transaction_charges": 123,
"cgst": 123,
"sgst": 123,
"igst": 123,
"securities_transaction_tax": 123,
"sebi_turnover_fees": 123,
"stamp_duty": 123,
"net_amount_receivable_payable": 123
}
}
}{
"status": "failed",
"msg": "Invalid PDF file or password."
}{
"status": "failed",
"msg": "Authentication failed: API key is missing. Please provide a valid API key in the x-api-key header."
}{
"status": "failed",
"msg": "Authentication failed: API quota exceeded or invalid API key. Please check your API key or quota limits."
}{
"status": "failed",
"msg": "Invalid PDF file or password."
}Contract Note Parser
Parse Contract Note PDF
This endpoint parses Contract Note PDF files from various brokers including Zerodha, Groww, Upstox, ICICI Securities, and others.
What is a Contract Note? A contract note is a legal document that provides details of all trades executed by an investor. It includes:
- Trade details with timestamps, quantities, and prices
- Brokerage and charges breakdown
- Settlement information
- Regulatory compliance details
Supported Brokers:
- Zerodha Broking Limited
- Groww Invest Tech Private Limited
- Upstox (RKSV Securities)
- ICICI Securities Limited
- Auto-detection for unknown brokers
Key Features:
- Auto-detection: Automatically identifies broker type from PDF content
- Comprehensive parsing: Extracts equity transactions, derivatives transactions, detailed trades, and charges
- Flexible input: Accepts both file upload and URL-based PDF input
- Password protection: Supports password-protected PDFs
The API returns structured data including contract note information, client details, transaction summaries, and detailed trade-by-trade breakdowns.
POST
/
v4
/
contract_note
/
parse
Parse Contract Note PDF
curl --request POST \
--url https://api.casparser.in/v4/contract_note/parse \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form pdf_file='@example-file' \
--form 'password=<string>'import requests
url = "https://api.casparser.in/v4/contract_note/parse"
files = { "pdf_file": ("example-file", open("example-file", "rb")) }
payload = { "password": "<string>" }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('pdf_file', '<string>');
form.append('password', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.casparser.in/v4/contract_note/parse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.casparser.in/v4/contract_note/parse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pdf_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.casparser.in/v4/contract_note/parse"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pdf_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.casparser.in/v4/contract_note/parse")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pdf_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v4/contract_note/parse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pdf_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": "success",
"msg": "success",
"data": {
"contract_note_info": {
"contract_note_number": "CNT-25/26-73436720",
"trade_date": "2025-08-05",
"settlement_number": "2025149",
"settlement_date": "2025-08-06"
},
"broker_info": {
"broker_type": "zerodha",
"name": "Zerodha Broking Limited",
"sebi_registration": "INZ000031633"
},
"client_info": {
"name": "VIRENDER KUMAR",
"pan": "FAXAK2545F",
"ucc": "YS3654",
"place_of_supply": "DELHI",
"gst_state_code": "7",
"address": "<string>"
},
"equity_transactions": [
{
"isin": "INE172A01027",
"security_name": "CASTROLIND",
"security_symbol": "CASTROLIND",
"buy_quantity": 123,
"buy_wap": 123,
"buy_total_value": 123,
"sell_quantity": 123,
"sell_wap": 123,
"sell_total_value": 123,
"net_obligation": 123
}
],
"derivatives_transactions": [
{
"contract_description": "NIFTY24802410DPE",
"buy_sell_bf_cf": "B",
"quantity": 123,
"wap_per_unit": 123,
"brokerage_per_unit": 123,
"closing_rate_per_unit": 123,
"net_total": 123
}
],
"detailed_trades": [
{
"order_number": "1000000042939390",
"order_time": "13:13:13",
"trade_number": "4006567",
"trade_time": "13:13:13",
"security_description": "CASTROLIND-EQ/INE172A01027",
"buy_sell": "B",
"exchange": "NSE",
"quantity": 123,
"brokerage": 123,
"net_rate_per_unit": 123,
"closing_rate_per_unit": 123,
"net_total": 123,
"remarks": "<string>"
}
],
"charges_summary": {
"pay_in_pay_out_obligation": 123,
"taxable_value_brokerage": 123,
"exchange_transaction_charges": 123,
"cgst": 123,
"sgst": 123,
"igst": 123,
"securities_transaction_tax": 123,
"sebi_turnover_fees": 123,
"stamp_duty": 123,
"net_amount_receivable_payable": 123
}
}
}{
"status": "failed",
"msg": "Invalid PDF file or password."
}{
"status": "failed",
"msg": "Authentication failed: API key is missing. Please provide a valid API key in the x-api-key header."
}{
"status": "failed",
"msg": "Authentication failed: API quota exceeded or invalid API key. Please check your API key or quota limits."
}{
"status": "failed",
"msg": "Invalid PDF file or password."
}Authorizations
Your API key for authentication.
Use sandbox-with-json-responses as Sandbox key.
Body
multipart/form-dataapplication/json
Was this page helpful?
⌘I

