Welcome to Zuora Product Documentation

Explore our rich library of product information

Query e-invoicing data through the REST API

Understand how to query e-invoicing data through the REST API, retrieve file status, and download e-invoice files for billing documents.

With the E-Invoicing feature, after e-invoice files are generated for billing documents, you can view e-invoicing data through the REST API and Data Query.

To retrieve e-invoice file status and error information through the REST API, use the following operations:

  • Retrieve an invoice

  • Retrieve a credit memo

  • Retrieve a debit memo

You can find related data from the following fields returned in the response of the preceding operations:

  • eInvoiceStatus

  • eInvoiceErrorCode

  • eInvoiceErrorMessage

  • eInvoiceFileId

Download e-invoice files

You can use the Retrieve a file operation to download the e-invoice file generated for a billing document.

Retrieve e-invoice results

You can use the "Retrieve e-invoice results" operation to retrieve e-invoice results according to the ID of a billing document. The document ID can be the ID of an invoice, a credit memo, or a debit memo.

The result fields might be different by country. For example, a QR code and an IRN are returned for the India e-invoicing clearance process.

The result fields on EInvoiceData includes the following fields:

  • QrCode : This field stores the QR code data that has been Base64 decoded. In India, the code is a signed QR code in the format of JSON Web Token (JWT), consisting of three parts: signature parameters, data, and a signature.

  • ReferenceNumber : This field stores a unique number generated by the tax authority. In India, it is known as the Invoice Reference Number (IRN). IRN is a distinct code created by the Invoice Reference Portal (IRP) for every electronic invoice (e-invoice) file issued under the Goods and Services Tax (GST) system. This number is essential for verifying and authenticating e-invoice files within the Indian e-invoicing system.

  • DocumentId : This field stores the ID of the billing document, for which the e-invoice file is generated.

  • DocumentType : This field indicates the type of the billing document, for which the e-invoice file is generated.

For example, you can use /objects/records/com_zuora/EInvoiceData?q=DocumentId:8a90cbb1894e069c01894e14fa8501b9 to retrieve e-invoice data about the billing document with the ID of 8a90cbb1894e069c01894e14fa8501b9.

The following information is a response sample of e-invoice results:

{
   "records":[
      {
         "Id":"65e7d823-241b-4cf9-bad1-155956c05164",
         "type":"EInvoiceData",
         "CreatedById":"2c92c8fe78a9a0740178a9b0b06c007a",
         "UpdatedById":"2c92c8fe78a9a0740178a9b0b06c007a",
         "CreatedDate":"2023-09-06T08:20:56.080Z",
         "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
         "DocumentId":"8a90eff78a68fc31018a69915afe7e19",
         "DocumentType":"Invoice"
      }
   ],
   "count":1
}