Skip to content

Invoice OCR API

New

Read a GST invoice and get the supplier and buyer, their GSTINs, the taxable value, CGST, SGST, IGST, the total and every line item back as structured fields.

Overview

Invoice OCR reads a supplier invoice, photographed, scanned or sent as a PDF, and returns what is printed on it as structured fields your payables or lending system can use. It is built around the Indian tax invoice. The response carries the invoice number and date, the supplier and buyer names with their GSTINs, the place of supply, the taxable value, the CGST, SGST and IGST amounts, the invoice total, and each line item with its description, HSN or SAC code, quantity, rate and amount. OCR reports what the document says. It does not establish that the invoice was issued or reported. Pair it with a GST or e-invoice check where the decision needs that assurance.

Coverage
Tax invoices and bills of supply issued by Indian businesses, as images or PDFs
Input
An invoice image or PDF uploaded by your application
Output
Invoice number and date, supplier and buyer names and GSTINs, place of supply, taxable value, CGST, SGST, IGST, total and line items
Typical users
Accounts payable, expense, procurement, invoice financing and accounting teams
Coverage note
Reads the printed invoice; confirming the supplier or a reported e-invoice is a separate check

The overview and the sections after the reference are the FinSour API catalog’s own record for this service, rendered unaltered.

Endpoint URL and method

POSThttps://gateway.staging.finsour.io/v1/documents/invoice

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Authentication

Scheme API key travels in the X-Api-Key header

Send your API key in this header on every call, from your own server: a key sent from a browser is refused. A key starting fs_test_ calls the sandbox and one starting fs_live_ calls production, at the same address. Create keys in the FinSour console.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Request parameters

Content type multipart/form-data

Headers

NameTypeRequiredDescriptionConstraints
Idempotency-KeystringRequiredA key you generate for each attempt. Sending the same key again returns the first answer instead of running the check twice; the same key with a different body is refused.8 to 255 characters. Matches ^[A-Za-z0-9._:-]+$
FinSour-VersionstringRequiredSend 2026-11-01 on this call and on every poll to get the receipt and the result described on this page. A call without it is served under 2026-09-01, whose job has a different shape.—

Body

NameTypeRequiredDescriptionConstraints
filefileRequiredThe document to read.—
payloadstring (JSON)OptionalA JSON string carrying the call's options.—
payload.optionsobjectOptionalSettings for this call.—
payload.options.referencestringOptionalYour own reference for this call. It comes back unchanged as meta.reference.1 to 128 characters
payload.options.consentobjectOptionalThe person's consent to this check.—
payload.options.consent.obtainedbooleanRequiredSend true once the person has agreed to the check.Always true
payload.options.consent.atstring (date-time)RequiredWhen the person gave consent.—
payload.options.consent.purposestringRequiredWhat the check is for, for example kyc.1 to 64 characters

Request samples

cURL

curl -X POST https://gateway.staging.finsour.io/v1/documents/invoice \
  -H "X-Api-Key: $FINSOUR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "FinSour-Version: 2026-11-01" \
  -F "file=@<path-to-document>"

Node.js

import { openAsBlob } from "node:fs";

const form = new FormData();
form.append("file", await openAsBlob("<path-to-document>"));

const response = await fetch("https://gateway.staging.finsour.io/v1/documents/invoice", {
  method: "POST",
  headers: {
    "X-Api-Key": process.env.FINSOUR_API_KEY,
    "Idempotency-Key": crypto.randomUUID(),
    "FinSour-Version": "2026-11-01",
  },
  body: form,
});

console.log(response.status, await response.json());

Python

import os
import uuid

import requests

response = requests.post(
    "https://gateway.staging.finsour.io/v1/documents/invoice",
    headers={
        "X-Api-Key": os.environ["FINSOUR_API_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
        "FinSour-Version": "2026-11-01",
    },
    files={"file": open("<path-to-document>", "rb")},
    timeout=30,
)

print(response.status_code, response.json())

Generated from the fields above. Replace each value in angle brackets with your own; the key is read from FINSOUR_API_KEY.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Response schema

Status 202 · content type application/json

NameTypePresentDescriptionConstraints
dataobjectAlwaysThe job that will read the document.—
data.jobIdstringAlwaysThe job's id. Poll GET /v1/jobs/{jobId} with it.Matches ^[0-9A-HJKMNP-TV-Z]{26}$
data.statusstringAlwaysAlways queued: the job is accepted and has not started.Always "queued"

The result

Poll GET /v1/jobs/{jobId}. Once the job has finished, data holds these fields:

NameTypePresentDescriptionConstraints
jobIdstringAlways——
statusstringAlways—One of queued, processing, completed, needs_review, unreadable, failed, expired, cancelled
documentTypestring or nullAlwaysThe kind of document found, once it has been read; null before that.—
confidencenumber or nullAlwaysThe document's confidence, 0 to 1, to two places; null until it has been read.Minimum 0. Maximum 1
fieldsobjectAlwaysWhat was read. Every key is always present: null means the document does not carry it, or it could not be read with enough confidence.—
fields.invoiceNumberstring or nullAlways——
fields.invoiceDatestring or nullAlwaysISO date, YYYY-MM-DD; a year or month alone is YYYY or YYYY-MM.—
fields.supplierNamestring or nullAlways——
fields.supplierGstinstring or nullAlways——
fields.buyerNamestring or nullAlways——
fields.buyerGstinstring or nullAlways——
fields.placeOfSupplystring or nullAlways——
fields.taxableValuestring or nullAlwaysDecimal rupees as text, for example "12345.50".—
fields.cgststring or nullAlwaysDecimal rupees as text, for example "12345.50".—
fields.sgststring or nullAlwaysDecimal rupees as text, for example "12345.50".—
fields.igststring or nullAlwaysDecimal rupees as text, for example "12345.50".—
fields.totalAmountstring or nullAlwaysDecimal rupees as text, for example "12345.50".—
fields.lineItemsarray of objectsAlways——
fields.lineItems[].descriptionstring or nullAlways——
fields.lineItems[].hsnSacstring or nullAlways——
fields.lineItems[].quantitystring or nullAlways——
fields.lineItems[].ratestring or nullAlwaysDecimal rupees as text, for example "12345.50".—
fields.lineItems[].amountstring or nullAlwaysDecimal rupees as text, for example "12345.50".—
fieldsToReviewarray of stringsAlwaysWhen status is needs_review, the fields a person should confirm; empty otherwise.—
failureReasonstringSometimesPresent only when status is unreadable or failed.One of UNREADABLE_IMAGE, LOW_CONFIDENCE, DOCUMENT_TYPE_MISMATCH, UNSUPPORTED_MEDIA_TYPE, FILE_TOO_LARGE, INPUT_CORRUPT, PAGE_LIMIT_EXCEEDED, TIMEOUT, PROCESSING_ERROR

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Error codes

CodeStatusMeaningRetrying
API_VERSION_UNSUPPORTED400That API version is no longer supported.Do not retry automatically
IDEMPOTENCY_KEY_INVALID400That Idempotency-Key does not meet the required format.Do not retry automatically
IDEMPOTENCY_KEY_REQUIRED400An Idempotency-Key header is required for this request.Do not retry automatically
REQUEST_MALFORMED400The request could not be parsed.Do not retry automatically
AUTH_KEY_EXPIRED401The API key is not valid.Do not retry automatically
AUTH_KEY_INVALID401The API key is not valid.Do not retry automatically
AUTH_KEY_MISSING401No API key was presented.Do not retry automatically
AUTH_KEY_REVOKED401The API key is not valid.Do not retry automatically
INSUFFICIENT_BALANCE402The available balance is not enough for this request.Do not retry automatically
AUTH_IP_NOT_ALLOWED403This API key may not be used from this address.Do not retry automatically
ENTITLEMENT_MISSING403This organization is not entitled to that product in this environment.Do not retry automatically
ORGANIZATION_SUSPENDED403This organization is not active.Do not retry automatically
PRODUCT_NOT_AVAILABLE403That product is not available.Do not retry automatically
PRODUCT_RETIRED403That product has been withdrawn.Do not retry automatically
SCOPE_INSUFFICIENT403This API key does not carry the scope this product requires.Do not retry automatically
PRODUCT_NOT_FOUND404No such product.Do not retry automatically
IDEMPOTENCY_KEY_REUSED409That idempotency key was already used for a different request.Do not retry automatically
PRICE_UNAVAILABLE409No active price covers this product right now.Safe to retry
REQUEST_IN_PROGRESS409An earlier attempt with this key is still running.Safe to retry
SETTLEMENT_PENDING409This request is awaiting reconciliation by an operator.Do not retry automatically
API_VERSION_SUNSET410That API version passed its announced sunset date.Do not retry automatically
REQUEST_TOO_LARGE413The request body is too large.Do not retry automatically
OCR_UNSUPPORTED_MEDIA_TYPE415That document format is not accepted.Do not retry automatically
UNSUPPORTED_MEDIA_TYPE415That content type is not accepted on this route.Do not retry automatically
SANDBOX_FIXTURE_MISSING422No sandbox fixture exists for this input. Use a different test value.Do not retry automatically
UPSTREAM_REJECTED422The upstream source rejected the input.Do not retry automatically
VALIDATION_FAILED422The request payload is invalid.Do not retry automatically
CONCURRENCY_LIMIT429Too many simultaneous requests.Safe to retry
OCR_QUEUE_SATURATED429The document queue is full. Retry shortly.Safe to retry
QUOTA_EXCEEDED429The allowance for this window is spent.Do not retry automatically
RATE_LIMITED429Too many requests.Safe to retry
INTERNAL_ERROR500An unexpected error occurred.Safe to retry
OUTCOME_UNCERTAIN502The outcome of this request is not yet known. Retry with the same Idempotency-Key.Do not retry automatically
UPSTREAM_UNAVAILABLE502The upstream source is unavailable. Retry shortly.Safe to retry
MAINTENANCE_MODE503The service is in a maintenance window.Safe to retry
NO_PROVIDER_AVAILABLE503No provider can serve this product right now.Safe to retry
OCR_UNAVAILABLE503Document reading is unavailable right now. Retry later.Safe to retry
SERVICE_OVERLOADED503The service is shedding load. Retry shortly.Safe to retry
UPSTREAM_TIMEOUT504The upstream source did not respond in time.Safe to retry

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Rate limits

ScopeLimitWindowAt the limit
Your API key, within your organisation's limitThe figure in X-RateLimit-LimitPer minute429 RATE_LIMITED, with Retry-After in seconds. Every answer past authentication carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Use cases

  • Accounts payable: capturing supplier invoices without manual keying
  • Invoice discounting: reading the invoices a borrower submits for financing
  • Expense management: reading invoices attached to employee claims
  • Procurement: matching invoice totals against purchase orders
  • Accounting software: turning uploaded purchase invoices into draft entries

What this service does

  • The GST fields, not just the text

    Supplier and buyer GSTINs, the place of supply, the taxable value and the CGST, SGST and IGST amounts come back as labelled fields, ready for a tax or matching rule.

  • Every line item

    Each line comes back with its description, HSN or SAC code, quantity, rate and amount, so a total can be checked against the lines that make it up.

  • Amounts kept exact

    Money is returned as decimal rupees in text and dates in ISO form, so nothing is rounded or reformatted between the invoice and your ledger.

  • A review list, not a guess

    When a reading needs a person, the response names the fields to confirm. A value the reader could not resolve is returned as empty rather than invented.

How a check runs

  1. Arrange access

    Tell us where Invoice OCR fits in your process. We arrange access for your organization under the applicable service contract, which also sets the file formats and sizes you can send.

  2. Upload the invoice

    Your application uploads the invoice image or PDF and sends a request that names it, with your own reference if you want one.

  3. Let the reading run

    The request is accepted with a job reference, and the invoice is read in the background so your application is not held waiting.

  4. Collect the fields

    Your application collects the result by its job reference: the invoice fields, the line items, a confidence for the document and any fields to review.

  5. Match, confirm and post

    Compare the GSTINs and totals with your vendor master and purchase order, send flagged fields to a reviewer, then post the confirmed values.

Questions

What is an Invoice OCR API?
An interface that accepts an invoice image or PDF and returns what is printed on it, such as the invoice number, GSTINs, tax amounts, total and line items, as structured fields.
Does Invoice OCR read CGST, SGST and IGST separately?
Yes. The taxable value, CGST, SGST, IGST and the total are separate fields, each returned as decimal rupees in text where the invoice shows them.
Does it read line items and HSN codes?
Yes. Each line item comes back with its description, HSN or SAC code, quantity, rate and amount, where the invoice prints them.
Does Invoice OCR confirm that the invoice is genuine?
No. OCR reports what the document says. To check the supplier, run a GST verification on its GSTIN; to check a reported e-invoice, validate its IRN with the e-Invoicing API.
What happens when part of the invoice cannot be read?
The field is returned as empty rather than guessed. When the reading needs a person, the response lists the fields they should confirm, so a reviewer looks only at those.
Is Invoice OCR the same as e-Invoice OCR?
No. Invoice OCR reads the commercial fields of any tax invoice. e-Invoice OCR reads the IRN, acknowledgement and QR details printed on an invoice that was reported for e-invoicing.

Catalog entry last updated .