View e-invoicing data
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.
Query e-invoicing data through the REST API
You can query e-invoicing data through the REST API.
Retrieve e-invoice file status and error information
To retrieve e-invoice file status and error information through the REST API, use the following operations:
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", "UpdatedDate":"2023-09-07T06:21:40.249Z", "QrCode":"eyJhbGciOiJSUzI1NiIsImtpZCI6IjE1MTNCODIxRUU0NkM3NDlBNjNCODZFMzE4QkY3MTEwOTkyODdEMUYiLCJ4NXQiOiJGUk80SWU1R3gwbW1PNGJqR0w5eEVKa29mUjgiLCJ0eXAiOiJKV1QifQ.eyJkYXRhIjoie1wiU2VsbGVyR3N0aW5cIjpcIjA4QUFBQ0k5MjYwUjAwMlwiLFwiQnV5ZXJHc3RpblwiOlwiMjlBV0dQVjcxMDdCMVoxXCIsXCJEb2NOb1wiOlwiRUlOVjAwMDAwMDMzXCIsXCJEb2NUeXBcIjpcIklOVlwiLFwiRG9jRHRcIjpcIjA2LzA5LzIwMjNcIixcIlRvdEludlZhbFwiOjE4NzI5MTcuMDUsXCJJdGVtQ250XCI6MyxcIk1haW5Ic25Db2RlXCI6XCIxMDAxMTFcIixcIklyblwiOlwiOGU4ZDI1NjEwNmM3MDc2MGNkMjQ4NmFjYTIxZjk2ZmU5ZDhlMTA3YWJkNTMwMWRiOWJhNTMxYTBjNzhiNThiM1wiLFwiSXJuRHRcIjpcIjIwMjMtMDktMDYgMTM6NDc6MzhcIn0iLCJpc3MiOiJOSUMgU2FuZGJveCJ9.LhRPNpNMS4JKWcyz1i_XigclmjysOxEWR9csO9YegxBT7LLwUSqjG_6D3Q1LNHiqT835kq8Zss2GI9W1e11XF47JPTwIPl_9bMKOF05jXL6_KkDO2w0HZUIXxnVpljamTb_W1pPOX75bhfCvCpNQ_z7IdhCz7u9MKvh7Avyjuz4CRoe3tseQNCxwxIMMgadpLivgEZDEFAK-P6a0O2RmBhIf_Qq0tUK4yV0Yf9X9kw3MXwVSO93EOc1p4nr-o-OqwYcgJ99MBwDoHWl57TxYT9y40B9_K3z9M8ONw6VORkrVsrOxCmZhvwwfJjJveovZhBtOBoTVe7RNqSJK1sq9wA", "ReferenceNumber":"8e8d256106c70760cd2486aca21f96fe9d8e107abd5301db9ba531a0c78b58b3", "DocumentId":"8a90eff78a68fc31018a69915afe7e19", "DocumentType":"Invoice" } ], "count":1 }
Query e-invoicing data through Data Query
You can perform queries on the objects and fields related to this feature through Data Query, including the E-Invoice Business Region, E-Invoice Profile, E-Invoice Data, Account, Invoice, Credit Memo, and Debit Memo objects. For information about the basic usage of Data Query, see Constructing SQL Queries in Data Query.
E-Invoicing specific objects
The E-Invoicing feature introduces the following objects and the fields that are defined on these objects:
- E-Invoice Business Region
- E-Invoice Data
- E-Invoice Profile
You can access these objects and all their fields through Data Query and the E-Invoicing API operations.
E-Invoicing specific fields on existing objects
The following table lists the E-Invoicing specific fields that are defined on existing objects. You can access these objects and all their fields through Data Query and related API operations.
Object | Field | Type |
---|---|---|
Account | EInvoiceProfileId | string |
|
EInvoiceStatus | string |
EInvoiceFileId | string | |
EInvoiceErrorCode | string | |
EInvoiceErrorMessage | string |
Construct SQL queries about E-Invoicing objects and fields
To query the objects and fields related to the E-Invoicing feature, you can construct SQL queries by referring to the following SQL examples:
- Query the e-invoicing status based on the invoice number:
SELECT inv.EInvoiceStatus,inv.EInvoiceFileId,inv.EInvoiceErrorCode,inv.EInvoiceErrorMessage FROM invoice as inv WHERE inv.InvoiceNumber='INVCA00000096'
The sample request queries the invoice schedule associated with the specified order. The sample query result is as follows:EInvoiceStatus EInvoiceFileId EInvoiceErrorCode EInvoiceErrorMessage Failed RE-400-BR-CO-15 Invoice total amount with VAT (BT-112)