You can use this API to fetch the IRN details from Clear Database either by providing IRN or a combination of Document Number, Type, Date and Seller GSTIN.
Request Method
GET
Request URL
{{host}}/v1/einvoices/detail
Request Headers
Parameter
Data Type
Field Validations
Description
x-cleartax-auth-token
String
Cannot be empty
Mandatory. User auth token.
gstin
String
Cannot be empty
Mandatory. This is the GSTIN of the business, as registered on ClearTax.
Request Path Params
This API does not require any path parameters. All required inputs are sent via query parameters or headers.
Request Query Params
Parameter
Data Type
Field Validations
Description
irn
String
Optional
The Invoice Reference Number (IRN) of the e-invoice. Either irn OR the below document details are mandatory.
documentNumber
String
Mandatory if irn is not supplied
Invoice/Document number of the transaction.
documentType
String
Mandatory if irn is not supplied
Type of the document (INV, CRN, DBN, etc.).
documentDate
String
Mandatory if irn is not supplied
Invoice/Document date in dd/mm/yyyy format.
sellerGstin
String
Mandatory if irn is not supplied
Seller's GSTIN associated with the transaction.
Request Body
No request body is required for this API; all required parameters are passed as query parameters or headers.
Response Status Codes
HTTP Status Code
Description
200
For a successfully processed request (may be a success or validation error).
401
If the user is not authenticated for the operation.
403
If the user is not authorized for the operation.
500
If there are any unhandled exceptions on the Clear side.
Response Schema
Parameter
Data Type
Field Validations
Description
success
Boolean
-
True. when there is success.
False. When there is some error.
errorDetails
Error Detail
-
When there is some failure. This will contain error details.
Error Detail Object
Parameter
Data Type
Field Validations
Description
error_code
String
-
-
error_message
String
-
Description, stating the reason due to which request failed.
{
"EinvoiceDetails": null,
"CustomFields": null,
"GovtResponse": null,
"B2CQRCodeResponse": null,
"ErrorDetails": [
{
"ErrorCode": "300102",
"ErrorMessage": "You don't have any data present for the selected Document Details",
"ErrorSource": "CLEARTAX"
}
],
"InvoiceStatus": null,
"UpiId": null,
"Gstin": null,
"CancelIrnDate": null,
"Id": null,
"EwbStatus": null
}
API Validations
If irn is provided, other document-based parameters (documentNumber, documnetType, documentDate, and sellerGstin) are not necessary.
If irn is not provided, all document-based parameters are required (documentNumber, documnetType, documentDate, and sellerGstin).
Missing or invalid query parameters and headers will result in a 400 Bad Request error.
API Constraints
Either the irn OR full document details (documentNumber, documnetType, documentDate, and sellerGstin)) should be provided, but not both at the same time.
Only one e-invoice detail retrieval is allowed per API call.
Correct header parameters (gstin and x-cleartax-auth-token) are mandatory.