OCR Tax Invoice API

OCR Upload API - where user can upload the document ans start parsing the data from the doc

MI OCR API Response Form is JSON

Field data is a term that refers to the data collected from a field.

  1. Field name -A field name identifies the type or meaning of the data stored in the field.

  2. Value - can be a string, a number, an object, an array, a boolean, or null.

  3. Accuracy - deonte the confidence of model that particular field is labelled correct as mentioned in invoice

Table data is a term that refers to the data that is organized in a tabular format, such as rows and columns.

Use this API to Extract data from the Invoice/Delivery order & Bill of Entry & E-invoice QR code

Upload API

Name
Description

API

Upload

Method Type

POST

Headers

Key
Values
Mandatory

Authorization

JWT {{token}}

Yes

subid

Will be shared during POC.

Yes

productid

arap

Yes

mode

Buyer

Yes

Body

form_data

file_url

file

Select file -

you can upload are -

PDF/JPEG/PNG

document_type

Action

Hit the Send button.

Note

Sync OCR Service will extract the first 5 pages from the file to ensure faster processing. To fulfill you use case of more than 5-pages file please use our

Async OCR Service. Response may vary as per data available in the Invoice - In key value Pair and Line items

Response

{
    "data": {
        "invoices": [
            {
                "field_data": {
                    "currency": {
                        "value": "INR",
                        "accuracy": 0.0
                    },
                    "buyer_gstin": {
                        "value": "03AAICM5508J1ZI",
                        "accuracy": 71.3
                    },
                    "invoice_type": {
                        "value": "TAX INVOICE",
                        "accuracy": 98.99303615093231
                    },
                    "buyer_pan_number": {
                        "value": "AAICM5508J",
                        "accuracy": 99.88749623298645
                    },
                    "place_of_supply": {
                        "value": "MAHARASHTRA (27)",
                        "accuracy": 99.42076802253723
                    },
                    "ewaybill_number": {
                        "value": "691548424357",
                        "accuracy": 99.96246099472046
                    },
                    "invoice_amount": {
                        "value": 4298376.56,
                        "accuracy": 94.1
                    },
                    "invoice_date": {
                        "value": "08/04/2023",
                        "accuracy": 93.6
                    },
                    "invoice_number": {
                        "value": "24183001003678",
                        "accuracy": 94.1
                    },
                    "po_number": {
                        "value": "24183000",
                        "accuracy": 94.1
                    },
                    "invoice_due_date": {
                        "value": "08/04/2023",
                        "accuracy": 94.1
                    },
                    "payment_term": {
                        "value": "30",
                        "accuracy": 94.1
                    },
                    "irn": {
                        "value": "IRN887292f8b4469c62a933bc56a6a8e131a8ebb88id2059fd93796ce2c2blbe",
                        "accuracy": 99.77746605873108
                    },
                    "ship_to_gstin": {
                        "value": "03AAICM5508J1ZI",
                        "accuracy": 99.84920024871826
                    },
                    "ship_to_name": {
                        "value": "TOPPAN SPECIALITY FILMS PRIVATE LTD",
                        "accuracy": 95.97364783287048
                    },
                    "supplier_gstin": {
                        "value": "24AAACR5055K1ZD",
                        "accuracy": 42.3
                    },
                    "pan_number": {
                        "value": "AAACR5055K",
                        "accuracy": 99.80529546737671
                    },
                    "total_igst": {
                        "value": 655684.56,
                        "accuracy": 99.9909281730651
                    },
                    "total_cgst": {
                        "value": 655684.56,
                        "accuracy": 99.99092817306519
                    },
                    "total_sgst": {
                        "value": 655684.56,
                        "accuracy": 99.99092817306519
                    },
                    "total_taxable": {
                        "value": 3642692.0,
                        "accuracy": 84.7
                    },
                    "total_discount": {
                        "value": 6584.56,
                        "accuracy": 93.8
                    },
                    "rounding_amount": {
                        "value": 0.38,
                        "accuracy": 84.7
                    },
                    "supplier_address": {
                        "value": "PO Motikhavdi\nMeghpar Padana Gagva\nJamnagar, Gujarat (24) , 361140",
                        "accuracy": 88.9
                    },
                    "buyer_address": {
                        "value": "419 BHAI MOHAN SINGH NAGAR VILLAGE RAILMAJRA TEHSIL BALACHAUR SHAHID BHAGAT SINGH NAGAR ",
                        "accuracy": 96.73346143502457
                    },
                    "supplier_name": {
                        "value": "Reliance Industries Limited",
                        "accuracy": 93.6
                    },
                    "buyer_name": {
                        "value": "TOPPAN SPECIALITY FILMS PRIVATE LTD",
                        "accuracy": 93.3
                    },
                    "ship_to_address": {
                        "value": "419 BHAI MOHAN SINGH NAGAR\nVILLAGE RAILMAJRA\nTEHSIL BALACHAUR\nNAWANSHAHR, PUNJAB (03) , 144533",
                        "accuracy": 87.3
                    },
                    "total_tax_amount": {
                        "value": 655684.56,
                        "accuracy": 93.8
                    },
                    "supplier_gstin_status": {
                        "value": true,
                        "accuracy": 100
                    },
                    "supplier_einvoice_status": {
                        "value": true,
                        "accuracy": 100
                    }
                },
                "table_data": [
                    [
                       {
                            "item_total_amount": {
                                "value": 30.00,
                                "accuracy": 85.2
                            },
                            "item_description": {
                                "value": "Item01 :",
                                "accuracy": 71.7
                            },
                            "item_hsn": {
                                "value": "996601",
                                "accuracy": 72.6
                            },
                            "item_unit_price": {
                                "value": 2750.00,
                                "accuracy": 51.8
                            },
                            "item_cgst_rate": {
                                "value": 6.0,
                                "accuracy": 0
                            },
                            "item_cgst_value": {
                                "value": 165.0,
                                "accuracy": 0
                            },
                            "item_sgst_rate": {
                                "value": 6.0,
                                "accuracy": 0
                            },
                            "item_sgst_value": {
                                "value": 165.0,
                                "accuracy": 0
                            },
                            "item_quantity": {
                                "value": 1,
                                "accuracy": 0
                            },
                            "item_taxable_value": {
                                "value": 2750.0,
                                "accuracy": 0
                            },
                            "item_uom": {
                                "value": "Liters",
                                "accuracy": 86.9
                            },
                            "item_igst_rate": {
                                "value": 18.0,
                                "accuracy": 0
                            },
                            "item_igst_value": {
                                "value": 289.08,
                                "accuracy": 0
                            }
                        },
                        {
                            "item_total_amount": {
                                "value": 840.00,
                                "accuracy": 85.2
                            },
                            "item_description": {
                                "value": "Item01",
                                "accuracy": 85.2
                            },
                            "item_hsn": {
                                "value": "996601",
                                "accuracy": 72.7
                            },
                            "item_unit_price": {
                                "value": 750.00,
                                "accuracy": 59.0
                            },
                            "item_cgst_rate": {
                                "value": 6.0,
                                "accuracy": 0
                            },
                            "item_cgst_value": {
                                "value": 45.0,
                                "accuracy": 0
                            },
                            "item_sgst_rate": {
                                "value": 6.0,
                                "accuracy": 0
                            },
                            "item_sgst_value": {
                                "value": 45.0,
                                "accuracy": 0
                            },
                            "item_quantity": {
                                "value": 1,
                                "accuracy": 0
                            },
                            "item_taxable_value": {
                                "value": 750.0,
                                "accuracy": 0
                            },
                            "item_uom": {
                                "value": "Liters",
                                "accuracy": 86.9
                            },
                            "item_igst_rate": {
                                "value": 18.0,
                                "accuracy": 0
                            },
                            "item_igst_value": {
                                "value": 289.08,
                                "accuracy": 0
                            }
                        },
                    ]
                ],
                "file_url": [
                    "https://qa-arapback.mastersindia-einv.com/api/v2/get-presigned-file/?file=invoiceannotation/img_387_0003e18343ce8bef187bd767ac68_page0.jpg",
                    "https://qa-arapback.mastersindia-einv.com/api/v2/get-presigned-file/?file=invoiceannotation/img_387_01cd90e073acfe6e4a6b00ac09_page1.jpg"
                ],
                "file_status": "duplicate for 594720341085781510",
                "file_name": "Invoice-3.pdf",
                "qr_status": "QR Success"
                "doc_type": "tax_invoice"
            }
        ],
        "request_status": "completed"
    },
    "message": "Data Extracted Successfully",
    "status_code": 200,
    "success": true
}

You can use this JSON Response in your ERP or Software as per your requirement

OCR API Errors

HTTP Status CODE
HTTP CODE MSG
Request Message
Description

400

Bad Request

Invalid Params format type!

When user requested to extract BOE file details by mentioning Document type as BOE but forgot to mention the format of boe i.e form13, form14, boe, export, boe_v2

Invalid Params Business Unit

When Subid is missing from the request header

Invalid Params file url!

File Url missing from request body

File content type not supported

The file upload is not of one following content type ["image/jpeg", "image/jpg", "image/png", "application/pdf"]

File uploaded is not a valid file name

The file name is not valid like contain "%00" or "\x00"

Multiple files not allowed!

Trying to upload more than one file at a time

Invalid File Format!

File upload is having a valid extension i.e ['.jpg', '.jpeg', '.png', '.pdf']:

403

Forbidden

Unauthorized Product

Product ID provided is other than arap

No Organization found

When the user credential used is not part of any organization

No Organization found for this User!

When User is part of some other organization

Invalid User!

No User found based on credentials

Unauthorized for this Business Unit

No user assigned with the particular Bussines unit

206

Partial Content

You consumed your allotted units for ocr organization <org_id>

Subscription expire

Error in creation of ocr as <ex>,

Error in ocr extraction

Data Extraction Failed

Error in ocr extraction

408

Request Timeout

Timeout for 120 sec

Timeout for 120 sec

200

Success

Data Extracted Successfully

Fields OCR Extract

The table will explain the Field Name with Descriptions, Type, and example

Type
Field Name
Filed key
Data Type

Key Value pair

Currency

currency

String

Invoice No.

invoice_number

String

Invoice Date

invoice_date

String

Invoice Due Date

invoice_due_date

String

PO No

po_number

String

Payment Terms

payment_term

String

IRN

irn

String

Invoice Type

invoice_type

String

E Way Bill Number

ewaybill_number

String

Supplier Name

supplier_name

String

Supplier Pan

pan_number

String

Supplier GSTIN

supplier_gstin

String

Supplier Address

supplier_address

String

Buyer Address

buyer_address

String

Buyer Name

buyer_name

String

Buyer Pan

buyer_pan_number

String

Buyer GSTIN

buyer_gstin

String

Ship to GSTIN

ship_to_gstin

String

Shipping Address

ship_to_address

String

Ship to name

ship_to_name

String

Ship to Place

place_of_supply

String

Total Discount

total_discount

Integer

Total Taxable Value

total_taxable

Integer

CGST Amount

total_cgst_amount

Integer

SGST Amount

total_sgst_amount

Integer

IGST Amount

total_igst_amount

Integer

Total Tax Amount

total_tax_amount

Integer

Invoice Amount

invoice_amount

Integer

Round Off

rounding_amount

Integer

Supplier GSTIN Status

supplier_gstin_status

boolean

Supplier einvoice Status

supplier_einvoice_status

boolean

Table

Line Item Description

item_description

String

Line Item UOM

item_uom

String

Line Item HSN

item_hsn

String

Line Item Unit Price

item_unit_price

Integer

Line Item Quantity

item_quantity

Integer

Line Item Discount

item_discount

Integer

Line Item Taxable Value

item_taxable_value

Integer

Line Item IGST value

item_igst_value

Integer

Line Item IGST rate

item_igst_rate

Integer

Line Item CGST rate

item_cgst_rate

Integer

Line Item CGST value

item_cgst_value

Integer

Line Item SGST rate

item_sgst_rate

Integer

Line Item SGST value

item_sgst_value

Integer

Line Item Total Amount

item_total_amount

Integer

QR Data

Qr Supplier Gstin

qr_supplier_gstin

String

Qr Buyer Gstin

qr_buyer_gstin

String

Qr Invoice Number

qr_invoice_number

String

Qr Invoice Date

qr_invoice_date

String

Qr Invoice Value

qr_invoice_value

String

Qr Total Item

qr_total_item

String

Qr Hsn Code

qr_hsn_code

String

Qr Hash Code

qr_hash_code

String

Need Help in Getting Started Request a Demo or try our Invoice OCR Software or API

Last updated

Was this helpful?