← Back to blog

Extract PAN Card Data with Zapier: Google Drive to Google Sheets

Watch an India-KYC Drive folder, call Cryvis POST /v1/documents/pan with multipart file via Custom Request, and append PAN number, name, and holder type to Google Sheets.

Indian KYC packs often land as PAN card scans in a shared Drive folder before anyone opens a CRM. This Zap watches an India-KYC folder, posts each new file to Cryvis POST /v1/documents/pan, and appends structured rows to Google Sheets — including holder_type and pan_structure fields you can use for Individual vs Company routing.

Multi-document HubSpot flow: Automate KYC. Driver's license companion: Extract driver's license data. Hub: /blog/zapier.

Architecture

Google Drive
  /India-KYC/pan-inbox/
        |
        v  (New File in Folder)
Zapier
        |
        v
Webhooks: Custom Request
  POST https://api.cryvis.com/v1/documents/pan
  -F file=@scan.jpg
  -H "Authorization: Bearer ..."
        |
        v
Google Sheets
  pan_number | full_name | father_name | dob | holder_type | ...

Prerequisites

  • Cryvis API key (console)
  • Google Drive folder dedicated to PAN uploads (isolate from Aadhaar/passport)
  • Google Sheet with a header row
  • Zapier Google Drive + Sheets + Webhooks by Zapier

Step 1: Folder and Sheet schema

Drive path example: India-KYC / pan-inbox. Optionally move processed files to pan-done to avoid re-processing.

Sheet columns:

ColumnCryvis data field
A processed_atZapier {{zap_meta_human_now}}
B drive_file_idDrive trigger
C file_nameDrive trigger
D pan_numberpan_number
E full_namefull_name
F father_namefather_name
G date_of_birthdate_of_birth
H holder_type_codeholder_type_code
I holder_typeholder_type
J seriespan_structure.series
K name_initialpan_structure.name_initial
L sequencepan_structure.sequence
M check_digitpan_structure.check_digit
N statusok / error

Step 2: Watch Drive

Google Drive → New File in Folder

  • Folder: pan-inbox
  • Include file contents if your Drive action exposes binary for the next step

If the trigger only returns metadata, add Google Drive → Upload File is wrong here — you need the existing file's content. Use Google Drive → Get File / download-style action so Zapier has binary for multipart. Watching metadata alone is not enough.

Step 3: Call Cryvis PAN

Webhooks by Zapier → Custom Request

SettingValue
MethodPOST
URLhttps://api.cryvis.com/v1/documents/pan
Data Pass-Through?No
HeadersAuthorization: Bearer YOUR_API_KEY
Payload TypeForm / multipart
Form fieldValue
fileFile from Drive (required) — map the binary, not a URL string

Supported types: PDF, JPEG, PNG, WebP.

cURL equivalent:

curl -X POST https://api.cryvis.com/v1/documents/pan \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@pan-card.jpg"

Step 4: Response fields

{
  "success": true,
  "data": {
    "pan_number": "ABCPS1234F",
    "full_name": "RAHUL SHARMA",
    "father_name": "SURESH SHARMA",
    "date_of_birth": "1992-08-14",
    "holder_type_code": "P",
    "holder_type": "Individual",
    "pan_structure": {
      "series": "ABC",
      "holder_type_code": "P",
      "holder_type": "Individual",
      "name_initial": "S",
      "sequence": "1234",
      "check_digit": "F"
    }
  },
  "meta": {
    "request_id": "req_pan_01hxyz"
  }
}

holder_type_code is the 4th character semantics (e.g. P = Individual, C = Company). Use holder_type for human-readable Sheets filters.

Docs: /docs/api/extractPan · Product: /apis/pan.

Step 5: Filter then append to Sheets

Filter by Zapier — only continue if success (Text) Exactly matches true (or your Custom Request exposes it as boolean true).

Google Sheets → Create Spreadsheet Row

Map each column from Step 1. For nested structure:

series       = data__pan_structure__series
name_initial = data__pan_structure__name_initial
sequence     = data__pan_structure__sequence
check_digit  = data__pan_structure__check_digit

Zapier flattens nested JSON with double underscores depending on the step; pick the fields Zapier shows after a test run. Set status = ok on the success path.

Step 6: Paths by holder type

Add Paths by Zapier after a successful extract:

PathRuleAction
Individualholder_type_code (Text) Exactly matches POptional Slack “retail KYC”
Companyholder_type_code Exactly matches CFlag for entity KYC pack
OtherAlways / FallbackOps review

You are not calling another Cryvis endpoint here — only branching on returned enums.

Step 7: Move processed files

Google Drive → Move File from pan-inboxpan-done. Prevents the New File trigger from re-ingesting the same scan.

Step 8: Errors

On Custom Request failure (or Filter false):

  1. Write a Sheets row with status=error, pan_number blank, file_name set.
  2. Move the file to pan-failed instead of pan-done.
  3. Alert Slack with Drive link only — not the image bytes.

Common issues:

  • Wrong field name (document instead of file)
  • HEIC uploads (convert before Cryvis, or reject in Filter)
  • Multi-page PDF of an entire KYC pack — prefer a cropped PAN-only file for higher accuracy

Validation tips without inventing APIs

Cryvis returns structured pan_structure. You can add Filters such as:

  • pan_number (Text) Exactly matches length 10 (use Formatter → Text → Length, then Filter)
  • Normalize to uppercase before compare with Formatter

Do not claim a separate “PAN verification against NSDL” step unless you integrate that yourself — this Zap is extraction, not government verification.

Deduping PAN rows

Before Create Spreadsheet Row, optionally Google Sheets → Lookup Spreadsheet Row where pan_number equals data.pan_number:

  • Found → Update Spreadsheet Row
  • Not found → Create Spreadsheet Row

Paths: “Found” vs “Not found” after Lookup.

Credits and throughput

PAN extraction is 1 credit per PDF page or image (Credits). A single JPEG PAN is one credit. A multi-page PDF of an entire KYC pack still bills per page — crop to the PAN page before upload when possible.

Sample timeline

T0  File lands in pan-inbox
T1  New File in Folder fires
T2  Custom Request → Cryvis (~few seconds)
T3  Sheets row written; file moved to pan-done
T4  Path notifies Slack if holder_type_code = C

CTA

Extract Indian PAN cards to JSON with Cryvis: /apis/pan. Docs: /docs/api/extractPan. From Zapier, POST file via Custom Request to https://api.cryvis.com/v1/documents/pan with Bearer auth and append data.pan_number, data.full_name, and data.holder_type to Sheets.