🧾 Purchase Invoice Data Extraction API

Upload purchase invoices (PDF or Image) to automatically extract structured data including:

  • Supplier details (Name, PIN, GSTIN, Contact)
  • Invoice information (Number, Date)
  • Line items (Name, HSN, Qty, Rate, Discounts, GST%)
  • Calculated totals (Gross, Taxable, Tax, Grand Total)

Supported Formats:

  • PDF documents
  • PNG, JPG, JPEG images
  • English and Hindi text

Output Structure:

{
  "header": {
    "supplier_name": "...",
    "supplier_pincode": "...",
    "gstin": "...",
    "contact_no": "...",
    "invoice_no": "...",
    "invoice_date": "..."
  },
  "details": [
    {
      "item_name": "...",
      "hsn": "...",
      "qty": 0,
      "unit": "...",
      "rate": 0,
      "discount": 0,
      "gst_percent": 0,
      "gross_amount": 0,
      "taxable_amount": 0,
      "gst_amount": 0,
      "total_amount": 0
    }
  ],
  "footer": {
    "total_gross": 0,
    "total_taxable": 0,
    "total_gst": 0,
    "grand_total": 0
  }
}

API Usage:

Python Client:

from gradio_client import Client

client = Client("http://localhost:7860")
result = client.predict(
    file="path/to/invoice.pdf",
    api_name="/predict"
)
print(result)

cURL:

curl -X POST http://localhost:7860/api/predict \
  -F "file=@invoice.pdf"
Examples