PO PDF Extraction (Cost Price Report)
Automated extraction of parts pricing data from PartsCheck Cost Price Report PDFs using Claude AI.
System: Invoice Extraction Server (Node.js + Claude API) Integration: Zoho Creator → Extraction Server → Zoho Creator Processing time: ~30-60 seconds per PDF
Overview
PartsCheck is a parts ordering system used in the Australian automotive industry. The extraction workflow processes Cost Price Report PDFs generated by PartsCheck, extracting quote details, vehicle information, supplier pricing, and line-item parts data.
What It Extracts
Header Fields:
| Field | Description | Example |
|---|---|---|
quote_no | Quote/order number | "16568" |
claim_no | Insurance claim number | "CLM-2024-001" |
vehicle | Make, Model, Year | "Honda, HR-V, 2019" |
estimator | Name of estimator | "Izac" |
vin | Vehicle Identification Number (17 chars) | "MRHRU5890LP060773" |
date | Report date (dd/MM/yyyy) | "03/07/2026" |
registration_no | Vehicle registration/plate | "EGC94K" |
requested_time | Time requested | "9:30am" |
Summary/Totals:
| Field | Description |
|---|---|
subtotal | Subtotal ex GST & freight |
freight | Freight/shipping charge |
gst | GST amount |
total | Total including everything |
Line Items (Parts Selected for Purchase):
| Field | Description | Example |
|---|---|---|
part_description | Part description (without part number) | "HINGE ASY FRT DR RH BG A" |
part_number | Extracted part number | "F22800" |
supplier | Supplier name | "Australian Automotive Group (City Ford)" |
part_type | OEM, AFT, USED, etc. | "OEM" |
expiry | Quote expiry date (dd/MM/yyyy) | "10/07/2026" |
comment | Additional comments | "EXTRA" |
qty | Quantity ordered | 1 |
cost_price | Cost price ex GST | 56.25 |
sell_price | Sell price ex GST | 75.00 |
Process Flow
graph TD
A[User uploads PartsCheck PDF] --> B[Zoho Creator webhook triggers]
B --> C[Server: Download PDF]
C --> D[Extract data with Claude AI]
D --> E[Parse and validate JSON]
E --> F[Clean registration number]
F --> G[Send to Zoho API]
G --> H[Zoho creates/updates record]
H --> I[Complete]
Step-by-Step Process
1. File Upload & Trigger
Who: Parts team, Estimators Where: Zoho Creator → PartsCheck upload form What happens:
- User uploads PartsCheck Cost Price Report PDF
- Zoho Creator webhook fires with:
- Record ID (upload_id)
- File URL
- Environment (dev/production)
2. PDF Download
System: Invoice Extraction Server What happens:
- Downloads PDF from Zoho Creator using OAuth token
- Saves to temporary directory:
temp/partscheck-{timestamp}/ - Retry mechanism: 3 attempts with 3-second intervals
:::info Download Retry File downloads retry automatically up to 3 times with 3-second delays. Claude API and Zoho API calls do NOT retry automatically. :::
3. PDF Direct Extraction (No Image Conversion)
Model: Claude Opus 4 (Anthropic) Input: PDF file sent directly as base64-encoded document What happens:
- PDF encoded to base64
- Sent to Claude API using
documenttype (not images) - Claude processes entire PDF as a single document
- Returns structured JSON with all extracted fields
Advantages of direct PDF processing:
- Faster than image conversion
- Better text recognition
- Preserves document structure
- Handles multi-page PDFs seamlessly
4. Registration Number Cleaning
Special handling for registration field:
PartsCheck PDFs often include the file/claim number appended to the registration:
Registration No: EGC94K - 220265
^^^^^^ ^^^^^^
Rego File#
Cleaning logic:
- If registration contains a dash followed by numbers, extract ONLY the part before the dash
- Remove all trailing spaces and special characters
- Example:
"EGC94K - 220265"→"EGC94K"
:::caution Registration Number Format The extraction prompt specifically instructs Claude to extract only the vehicle registration, excluding any file/claim numbers. This was added after discovering registration numbers were being extracted with file numbers appended. :::
5. Part Number Extraction
Challenge: Part numbers are embedded in descriptions
PartsCheck descriptions include part numbers inline:
"HINGE ASY FRT DR RH BG F22800 A"
└─ Description ──────┘ └─ Part# ─┘
Solution:
- Claude extracts part number into separate
part_numberfield part_descriptioncontains ONLY the description text- Part numbers typically alphanumeric:
F22800,BG72910-ABC
Examples:
| Original | part_description | part_number |
|---|---|---|
| "HINGE ASY FRT DR RH BG F22800 A" | "HINGE ASY FRT DR RH BG A" | "F22800" |
| "BUMPER BAR REAR BG72910-ABC" | "BUMPER BAR REAR" | "BG72910-ABC" |
6. Data Validation
Checks performed:
- VIN exactly 17 characters
- Date format: dd/MM/yyyy
- Numeric values parsed correctly
- Registration cleaned of file numbers
- All line items extracted
7. Send to Zoho API
Endpoint: Custom Zoho Creator API Environment-aware:
- Development:
poc_extract_parts_details - Production:
po_pdf_extract_details_prod
Payload:
{
"upload_id": "1234567890",
"status": "success",
"extracted_data": "{...JSON string of all extracted fields...}"
}
No retry mechanism - single attempt
8. Response & Cleanup
What happens:
- Zoho processes extracted data
- Updates PartsCheck upload record
- Server cleans up temporary PDF file
- Returns success/failure status
Prompt Engineering
The PartsCheck extraction uses a specialized prompt that includes:
Date Handling
- Always convert to
dd/MM/yyyyformat - Handle various date formats from PDF
Numeric Values
- Remove currency symbols (
$,AUD) - Parse as decimal numbers
- Use
0for missing numeric values
Registration Cleaning Rules
If registration includes dash + numbers:
"EGC94K - 220265" → extract "EGC94K"
Remove trailing spaces and special characters
Part Number Extraction Rules
Part numbers are embedded in descriptions:
"HINGE ASY FRT DR RH BG F22800 A"
Extract part number separately:
part_description: "HINGE ASY FRT DR RH BG A"
part_number: "F22800"
VIN Validation
- Must be exactly 17 alphanumeric characters
- Flag if incorrect length
Error Handling
| Error Type | Handling |
|---|---|
| File download failure | Retry 3 times with 3s delay, then fail |
| Claude API error | Fail immediately, log error, no retry |
| JSON parsing error | Fail with parse error message |
| Zoho API error | Log error, no retry |
Environment Configuration
| Environment | Zoho API | API Key |
|---|---|---|
| Development | poc_extract_parts_details | DK6ThON2OyGvTxFkg24phyQ8a |
| Production | po_pdf_extract_details_prod | 1FCKNxWAhzN7yPB7gUnYZTe9O |
Common Data Issues
Issue: Registration with File Numbers
Problem:
Registration No: EGC94K - 220265
Solution: Prompt updated July 2026 to extract only EGC94K
Issue: Part Numbers in Description
Problem:
Description: "HINGE ASY FRT DR RH BG F22800 A"
Solution: Extraction splits into:
part_description: "HINGE ASY FRT DR RH BG A"part_number: "F22800"
Issue: Missing Freight
Problem: Not all PartsCheck reports include freight charges
Solution: Use null for freight field if not present
Technical Details
Processing method: Direct PDF extraction (not image-based) Model: Claude Opus 4 (Anthropic) Max tokens: 16,000 Timeout: 30 seconds per PDF
Dependencies:
@anthropic-ai/sdk- Claude AI APIfs- File system operationsaxios- HTTP client for Zoho API
Best Practices
For Parts Team
- Use latest PartsCheck format - Extraction optimized for current format
- Ensure registration visible - Check PDF preview before upload
- Multi-page OK - System handles multi-page reports
- Verify extractions - Review extracted data in Zoho
For IT/Developers
- Monitor Claude API usage - Track token consumption
- Check registration cleaning - Verify file numbers removed
- Validate part number extraction - Ensure descriptions split correctly
- Test both environments - Dev and production have different endpoints
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Registration includes file number | Prompt not followed | Prompt updated July 2026, should be fixed |
| Part numbers in description | No splitting logic | Part number extraction implemented |
| VIN wrong length | OCR error, typo in PDF | Manual correction needed |
| Missing line items | Poor PDF quality | Request clearer export from PartsCheck |
| Freight always null | Not in PDF | Expected if PartsCheck doesn't show freight |
Related Documentation
- Invoice Extraction - Bulk invoice processing
- Parts Assessment Extraction - Parts & Sublet List
- Reference: Order Parts Form - Where extracted parts go
For technical support or issues, contact the development team.