Verify E-Invoice PDF#
Verify E-Invoice PDF API supports verification of E-Invoice PDF. Data fields that can be verified are irn, irnDate, sellerGstin, buyerGstin, docType, docNo, docDate, totInvValue, itemCnt, and mainHsnCode. These fields are validated based on the values provided along with E-Invoice generation. This verification is optional and will be triggered only if the respective field value is provided in request payload.
Verify E-invoice PDF is an asynchronous API, hence task id will be returned as a response.
Using given task ID, fetch the task status using Status API.
In order to download the result, you would need to use Download API.
Note
- Supported MIME Type : PDF
- Maximum allowed file size 5GB.
- Only one file is allowed in one API call.
Route
“/enriched/einv/{flynn-version}/invoices/verify-pdf”
- active: ‘flynn-version’ : v1.0
- method: Post
URL Parameters#
Name | Description | Type |
---|---|---|
flynn-version | version of the API, for example (v1.0) | string |
Headers#
All headers as mentioned in the Trade Verification E-Invoice APIs introduction.
Tip
The only valid values for the header keys Content-Type
and accept
must have to be multipart/form-data
and application/json
.
Request#
- Body consists of three form-data, with key “file”, “detailsForVerification” and “meta”.
file
key contains allowable E-Invoice PDF for verification.detailsForVerification
key contains Data field for verification. This Verification is optional and will be triggered only if the respective field value is provided.meta
key contains JSON as string. which consists of meta information for call i.e,-
- Tolerance : While validating amount fields this value will be considered. This will be the allowable amount of variation(±) in Rupees, during comparison. This is an optional input and the default value is 0.
-
- ToleranceInPercentage : If this flag is set true then while validating amount fields tolerance value mentioned above will be considered as percentage.This is an optional input and the default value is false.
-
- JSON : If this flag is set to true and if verification is successful, decrypted value of signed QR code will get added in response. This is an optional input and the default value is false.
-
- validatePdfFields : If this flag is set to true then API will verify the E-Invoice fields available in the PDF file. This is an optional input and the default value is false.
Sample Json For detailsForVerification
{
"irp": "nic",
"irn": "d06a8d2c192cc2d77255c54d50c4ddd72515dd14402172c44a99d179f8e4a61e",
"irnDt": "11/10/2023",
"sellerGstin": "27AAAPI3182M002",
"buyerGstin": "19AAAPI3182M007",
"docType": "INV",
"docNo": "AF03B5DB650474E8",
"docDt": "11/10/2023",
"totInvVal": 100,
"itemCnt": 1,
"mainHsnCode": 33052000
}
Sample Json For meta
{
"json": true,
"tolerance": 1,
"isToleranceInPercentage": false,
"validatePdfFields": false
}
All fields are optional in
meta
anddetailsForVerification
. The fields are involved in both verifications are independant from each other. Even if only two fields are passed in the input ofdetailForVerification
, all the fields present on the PDF file will get verified, ifvalidatePdfFields
flag is set to true.
Response#
200
:#
Successful response will have an async task-id
.
Using this task-id
you will be able to fetch the status of the request
Sample Response Body
{
"status": "1",
"data": {
"task-id": "5ffde48d-abe9-4d66-97dd-79937855b287"
},
"error": null,
"info": null,
"additionalInfo": null,
"alert": null
}
Download API Response:#
Download API response is unique for each API.
Content of result.json
file in case in meta json is true and verification is successful
Example
{
"status": "1",
"data": [
{
"status": "1",
"data": {
"details": null,
"json": "d06a8d2c192cc2d77255c54d50c4ddd72515dd14402172c44a99d179f8e4a61e.json"
},
"error": null,
"info": null,
"additionalInfo": {
"key": {
"irn": "d06a8d2c192cc2d77255c54d50c4ddd72515dd14402172c44a99d179f8e4a61e"
},
"details": {
"irp": "nic"
}
},
"alert": null
}
],
"error": null,
"info": null,
"additionalInfo": null,
"alert": null
}
Contents of result.json
file if json flag in meta is false and verification is successful
Example
{
"status": "1",
"data": [
{
"status": "1",
"data": {
"details": null,
"json": null
},
"error": null,
"info": null,
"additionalInfo": {
"key": {
"irn": "d06a8d2c192cc2d77255c54d50c4ddd72515dd14402172c44a99d179f8e4a61e"
},
"details": {
"irp": "nic"
}
},
"alert": null
}
],
"error": null,
"info": null,
"additionalInfo": null,
"alert": null
}
Contents of result.json
file in case of verification failed
Example
{
"status": "1",
"data": [
{
"status": "0",
"data": null,
"error": {
"type": "ClientRequest",
"message": "err-signed-qrcode-verification-failed",
"args": {}
},
"info": null,
"additionalInfo": {
"key": {
"irn": "d06a8d2c192cc2d77255c54d50c4ddd72515dd14402172c44a99d179f8e4a61e"
},
"details": {
"irp": null
}
},
"alert": null
}
],
"error": null,
"info": null,
"additionalInfo": null,
"alert": null
}
Content of result.json
file in case of verification failed for given IRP
Example
{
"status": "1",
"data": [
{
"status": "0",
"data": null,
"error": {
"type": "ClientRequest",
"message": "err-signed-qrcode-verification-failed-for-given-irp",
"args": {
"irp": "nic"
}
},
"info": null,
"additionalInfo": {
"key": {
"irn": "d06a8d2c192cc2d77255c54d50c4ddd72515dd14402172c44a99d179f8e4a61e"
},
"details": {
"irp": null
}
},
"alert": null
}
],
"error": null,
"info": null,
"additionalInfo": null,
"alert": null
}
Content of result.json
file in case of field comparison failure
Example
{
"status": "1",
"data": [
{
"status": "0",
"data": null,
"error": {
"type": "ClientRequest",
"message": "err-signed-qr-code-validation-failed",
"args": {
"invalid irnDate": "28/03/2023",
"invalid buyerGstin": "29AAAPI3182M000",
"invalid docNo": "MG0015",
"invalid docDt": "21/07/2021",
"invalid totInvVal": "32342.32",
"invalid mainHsnCode": "34013090"
}
},
"info": null,
"additionalInfo": {
"key": {
"irn": "d06a8d2c192cc2d77255c54d50c4ddd72515dd14402172c44a99d179f8e4a61e"
},
"details": {
"irp": null
}
},
"alert": null
}
],
"error": null,
"info": null,
"additionalInfo": null,
"alert": null
}
Irn.json
file if json flag in meta is set to true
Example
{
"invoiceQRCodeDetails": {
"SellerGstin": "27AAAPI3182M002",
"BuyerGstin": "19AAAPI3182M007",
"DocTyp": "INV",
"DocNo": "AF03B5DB650474E8",
"DocDt": "11/10/2023",
"TotInvVal": 100,
"ItemCnt": 1,
"MainHsnCode": "33052000",
"Irn": "d06a8d2c192cc2d77255c54d50c4ddd72515dd14402172c44a99d179f8e4a61e",
"IrnDt": "2023-10-11 11:54:55"
}
}