GST invoice to JSON for custom software and automation
By Dynamite Docs. Published . Updated .
Turn GST invoices into clean, reviewed data for Excel and Tally.
GST invoice to JSON conversion is a mapping job, not a text dump. Dynamite Docs proposes document fields and repeating line items from digital PDFs, scans or photos, then lets a reviewer check GSTIN roles, references, tax values and totals before export. The product JSON preserves columns, rows and document metadata so developers can map the reviewed result into their own contract. Use the workspace for manual review, or connect paid-plan API and webhook features when an application needs a repeatable handoff.
Try a GST invoice or compare its storage, processing, and export limits.
Software needs structured JSON, not PDF documents
- Accounting platforms and custom software require structured JSON objects with consistent key names across all suppliers.
- Different suppliers format invoices differently, making traditional custom scrapers fragile and hard to maintain.
- Invoices arrive as a mix of clean digital PDFs and scanned images, requiring intelligent routing between text extraction and vision OCR.
- Automated workflows need webhooks that trigger actions as soon as a document is processed without manual exporting.
Document types this workflow handles
- Digital GST invoice PDFs: e-invoices and billing software exports
- Scanned invoices & photos: visual character recognition for images
- Bulk billing exports: batch processing of text-layer invoices
- Credit & debit notes: structured adjustment records
What comes out as JSON keys
Consistent key names across all vendors so your software integration remains stable:
- GSTIN (supplier): 29AABCC3456C1ZD
- Invoice number: KT-5512
- Invoice date: 2026-08-07
- Vendor / customer: Ganesh Industries
- Place of supply: Karnataka (29)
- HSN / SAC code: 8467
- Item & quantity: Rotary hammer x 6
- Taxable value: ₹1,86,000.00
- IGST (rate · amount): 18% · ₹33,480.00
- Invoice total (incl. tax): ₹2,19,480.00
A realistic example
Sample data. Not a real invoice or filing record.
The workspace provides structured JSON matching these reviewed table rows:
| Invoice # | Date | Vendor | GSTIN | HSN/SAC | Item | Taxable value | CGST | SGST | IGST | Total |
|---|---|---|---|---|---|---|---|---|---|---|
| KT-5512 | 2026-08-07 | Ganesh Industries | 29AABCC3456C1ZD | 8467 | Rotary hammer | ₹1,86,000 | Not applicable | Not applicable | ₹33,480 | ₹2,19,480 |
| INV/2026-27/0188 | 2026-08-11 | Mehta Steel Supplies | 27AABCT1429P1ZM | 7210 | GI sheets | ₹5,40,000 | ₹48,600 | ₹48,600 | Not applicable | ₹6,37,200 |
What to validate before export
Validation issue
Validate keys, numeric types, nulls, and tax totals against the source.
Limitation
The JSON is a product export, not a GST Portal return payload.
Reviewed by Dynamite Docs content team. Last verified 2026-09-11.
Reliable API integration and predictable data structures
Keep document fields and line items separate. Supplier GSTIN, recipient GSTIN, invoice number, invoice date, place of supply, currency and invoice total describe the document. HSN or SAC, description, quantity, unit, rate, taxable value and tax components repeat by line. Flattening both levels without a stable invoice key can duplicate totals and corrupt later aggregation.
Treat identifiers as strings. GSTINs, invoice numbers, IRNs, HSN or SAC codes and purchase-order references may contain letters, slashes or leading zeros. Dates need a declared format, and decimal money values need an agreed representation. Your application should validate those types after extraction rather than relying on JavaScript coercion.
Define null and absence deliberately. A missing IGST value is different from a printed zero, and a field that is not applicable is different from one OCR could not read. Map these states into the application contract so reviewers and downstream rules can tell them apart.
Validate arithmetic before delivery. Compare line taxable values with the document subtotal, then account for discounts, freight, tax, cess and rounding. Keep the source amount when the calculation differs and record an exception. Do not silently replace a printed value with a computed one.
API and webhook consumers also need operational controls. Authenticate requests, verify the webhook signature, reject stale or duplicated deliveries, and store the extraction or file identifier used for idempotency. A completion event should start validation or review, not create an accounting voucher without checks.
Use confidence as a review signal, not an approval rule. GSTIN roles, tax treatment and totals deserve explicit checks even when OCR is confident. Route unresolved fields to a person and preserve their corrections before the application maps the JSON into its own schema.
Test the integration with a normal invoice, a credit or debit note, a multi-rate document and a scan. Version your mapper when required keys or nesting changes. Dynamite Docs supplies reviewed extraction data; your software remains responsible for schema validation, posting rules, duplicate control and GST compliance.
Developer-friendly APIs with complete data control
The export uses a consistent product result shape for document metadata, columns and rows. Downstream code should map and validate that result against its own versioned schema.
A digital PDF may provide machine-readable text, while scans need visual OCR. Source quality can still change the proposed values, so both formats need review.
All data and webhook configurations remain under your control, with full support for CSV and Excel exports whenever needed.
Questions, answered
Is there a REST API for uploading invoices and retrieving JSON?
Yes. Our REST API allows you to upload documents securely using API tokens and receive structured JSON responses with confidence scores for each field.
Do webhooks fire when invoice extraction is complete?
Yes. You can configure signed webhooks that post extraction completion events directly to your server endpoints, enabling fully automated workflows.
Are JSON key names consistent across all suppliers?
The product export uses a consistent result structure for fields, columns and rows. Your application should map those labels into its own schema and validate required keys, types, nulls and version changes.
Does the API support both digital PDFs and scanned images?
Yes. Digital PDFs parse directly from text, while scans and photos are routed through visual OCR, with both paths returning the same structured JSON format.
Related document workflows
Related extraction articles
Open the document extraction workspace, no credit card required.