Streamlined E-Invoicing with Avalara ELR
E-invoicing is the process of creating and providing an e-invoice to exchange data between a supplier and a buyer. When provided as structured data, an e-invoice allows the recipient to automatically insert the invoice data into their accounting or ERP system. Governments around the world are requesting the use of e-invoicing for business activities. Increasingly, e-invoicing includes live tax reporting to tax authorities.
This document provides comprehensive instructions on configuring e-Invoicing through Avalara, as well as submitting and downloading e-invoices. Let's get started!
PERMISSIONS REQUIRED
To manage Avalara integrations, users need the following permissions:
Integrations
|
Before You Start
Setup Avalara ELR Connection
To setup Avalara ELR Connection, users can follow the steps below:
- Login to Nue App
- Navigate to System Settings → Search for Avalara E-Invoicing
- In the "Connect to Avalara ELR" panel, follow the instruction below to get the Client ID and Client Secret and enter the values in the form. Check 'Avalara Sandbox' if the Avalara ELR Sandbox is used.
- Click 'Test' to test the connection.
- Click 'Activate' to activate the connection.
Avalara ELR Client ID and Client Secret
To get the Avalara ELR Client ID and Client Secret, please follow the steps below:
1. Sign Up or Log In to Avalara
- If you don't already have an Avalara account, you'll need to sign up for one. Visit the Avalara website and follow the registration process.
- If you already have an account, log in using your credentials.
2. Login to the Avalara ELR, and navigate to Settings → Integrations.
-
Create a New Application:
- Look for an option to create a new application or generate new API credentials.
- Provide the necessary details for your application, such as the name and description.
-
Generate Client ID and Client Secret:
- After creating the application, Avalara will generate a client ID and client secret for you. These credentials are essential for authenticating your API requests.
- Make sure to store these credentials securely, as they are sensitive information.
Deactivate Avalara ELR Connection
You can deactivate the Avalara ELR Connection by clicking on 'Deactivate'. After deactivating the connection, the Client Secret will be cleared.
Switching Between Sandbox and Production
You can toggle the "Avalara Sandbox" option to switch between Sandbox and Production environments. Please note that switching between these environments will clear the client credentials.
Configure Country Mandates
Once the ELR connection is activated, users can set up country mandates. For each company registered in the ELR instance, users can configure the country mandates for the document types Invoice and Credit Memo.
All supported country mandates for the selected Company and Document Type are listed. For each country mandate, users must set the filtering condition that specifies when the country mandate will be used for a specific company/entity for the given document type. The user must also configure a default or custom field mapping to be used for the country mandate.
Country Mandate Filter
For each country mandate, users can establish a filtering condition. Invoices or credit memos that meet this filtering condition will be applied to the selected country mandate.
When creating the filtering condition, users can utilize fields from the Invoice or Credit Memo, as well as fields from related objects like Customer, Sales Account, Entity, etc. Additionally, complex filtering logic such as (A and B) or (C and D)
is supported.
Country Mandate Field Mapping
The Country Mandate Field Mapping feature allows users to configure specific fields within the e-invoicing template associated with a country mandate. Users can view a list of data input fields for the selected country mandate. Nue provides default field mappings for each country mandate, which users can customize using standard or custom field values from invoices and credit memos.
Edit Document Field Mapping
Users can access the list of data input fields and their default mappings by selecting the ‘Edit Mappings’ link. Clicking on this link for a specific country mandate opens a full-screen modal popup, displaying all available mappings between UBL fields (in the XPATH format) and Nue fields.
At the top of the mapping fields, there is a Mapping Fields Filter with the options: All, Required, Conditional, and Optional. By default, only the required mapping fields are displayed. These represent the UBL document fields that must be mapped to either a constant value or an object field value to ensure the successful submission of the e-invoicing document.
Default field mappings are provided for most required document fields. Users must input values for fields specific to their business requirements. Additionally, users can click the ‘Edit’ action to modify constant values or adjust field mappings to align with their unique needs. If a field needs to be mapped to an object field, both standard and custom fields are supported.
Required Fields Mapping
The table below outlines the default field mappings provided by Nue for required invoice fields, using the GB-B2B-PEPPOL country mandate as an example. The default field mappings for credit memos are largely similar.
UBL DOCUMENT FIELD | FIELD TYPE | DESCRIPTION | NUE OBJECT MAPPING OR CONSTANT VALUE | EXAMPLE |
Invoice | ||||
Invoice/cbc:CustomizationID | string | Specification identifierAn identification of the specification containing the total set of rules regarding semantic content, cardinalities and business rules to which the data contained in the instance document conforms. | urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 | |
Invoice/cbc:ProfileID | string | Business process typeIdentifies the business process context in which the transaction appears, to enable the Buyer to process the Invoice in an appropriate way. | urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 | |
Invoice/cbc:ID | number | Invoice number: A unique identification of the Invoice. | invoice.name | 33445566 |
Invoice/cbc:IssueDate | date | Invoice issue dateThe date when the Invoice was issued. | invoice.transactionDate | 2023-10-25 |
Invoice/cbc:InvoiceTypeCode | number | A code specifying the functional type of the Invoice. |
Invoice: 388 (Tax invoice)
For detailed information, please refer to this page. | 380 |
Invoice/cbc:DocumentCurrencyCode | string | The currency in which all Invoice amounts are given, except for the Total VAT amount in accounting currency. Only one currency shall be used in the Invoice, except for the VAT accounting currency code (BT-6) and the invoice total VAT amount in accounting currency (BT-111). | invoice.currencyIsoCode | EUR |
Accounting Supplier: The Seller - A group of business terms providing information about the Seller | ||||
Invoice/cac:AccountingSupplierParty/cac:Party | object | The supplier party itself. | ||
Invoice/cac:AccountingSupplierParty/cac:Party/cbc:EndpointID | number | Identifies the Seller's electronic address to which the application level response to the invoice may be delivered. | Constant value. This value must be supplied by the company. | 7300010000001 |
Invoice/cac:AccountingSupplierParty/cac:Party/cbc:EndpointID/@schemeID | number | Seller electronic address identification scheme identifier.Endpoint identifier scheme identifier MUST belong to the CEF EAS code list | Constant. This value must be supplied by the company. | 0088 |
Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode | string | A code that identifies the country. | Organization Country Code in this form. | GB |
Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName | string | The full formal name by which the Seller is registered in the national registry of legal entities or as a Taxable person or otherwise trades as a person or persons. | Organization's Legal Entity Name | The Sellercompany Incorporated |
Accounting Customer Party: The Buyer - A group of business terms providing information about the Buyer. | ||||
Invoice/cac:AccountingCustomerParty/cac:Party/cbc:EndpointID | number | Identifies the Buyer's electronic address to which the invoice is delivered. |
customer.einvoicingEndpointId | 987654321 |
Invoice/cac:AccountingCustomerParty/cac:Party/cbc:EndpointID/@schemeID | number | Endpoint identifier scheme identifier MUST belong to the CEF EAS code list | customer.einvoicingSchemeId | 0192 |
Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode | string | A code that identifies the country. | customer.billingCountry | SE |
Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName | string | The full name of the Buyer. | customer.legalEntityName | Buyer Full Name AS |
Invoice/cac:TaxTotal/cbc:TaxAmount | number | The total VAT amount for the Invoice.The Invoice total VAT amount is the sum of all VAT category tax amounts. | invoice.taxAmount | 486.25 |
Invoice/cac:TaxTotal/cbc:TaxAmount/@currencyID | string | Currency for total VAT amount | invoice.currencyIsoCode | EUR |
Invoice/cac:LegalMonetaryTotal/cbc:LineExtensionAmount | number | Sum of all Invoice line net amounts in the Invoice without VAT | invoice.amountWithoutTax | 3800.00 |
Invoice/cac:LegalMonetaryTotal/cbc:LineExtensionAmount/@currencyID | string | Currency for invoicetotal amount | invoice.currencyIsoCode | EUR |
Invoice/cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount | number | The total amount of the Invoice without VAT. | invoice.amountWithoutTax | 3600.00 |
Invoice/cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount/@currencyID | string | Currency for invoice total amount without VAT | invoice.currencyIsoCode | EUR |
Invoice/cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount | number | The total amount of the Invoice with VAT.The Invoice total amount with VAT is the Invoice total amount without VAT plus the Invoice total VAT amount. | invoice.amount | 4500.00 |
Invoice/cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount/@currencyID | string | Currency for invoice total amount with VAT | invoice.currencyIsoCode | EUR |
Invoice/cac:LegalMonetaryTotal/cbc:PayableAmount | number | The outstanding amount that is requested to be paid.This amount is the Invoice total amount with VAT minus the pre-paid amount that has been paid in advance plus Rounding Amount. The amount is zero in case of a fully paid Invoice. | invoice.balance | 3500.00 |
Invoice/cac:LegalMonetaryTotal/cbc:PayableAmount/@currencyID | string | Currency for amount due for payment | invoice.currencyIsoCode | EUR |
Invoice Item | ||||
Invoice/cac:InvoiceLine/cbc:ID | number | A unique identifier for the individual line within the Invoice. This value should be only numeric value between 1 and 999,999 | invoiceItem.name without 'II-'. This has to be a numeric number only. | 123456 |
Invoice/cac:InvoiceLine/cbc:InvoicedQuantity | number | The quantity of items (goods or services) that is charged in the Invoice line. | invoiceItem.transactionQuantity | 100 |
Invoice/cac:InvoiceLine/cbc:InvoicedQuantity/@unitCode | string | The unit of measure that applies to the invoiced quantity. | invoiceItem.uomName | C62 |
Invoice/cac:InvoiceLine/cbc:LineExtensionAmount | number | The total amount of the Invoice line. The amount is “net” without VAT, i.e. inclusive of line level allowances and charges as well as other relevant taxes. | invoiceItem.transactionAmountWithoutTax | 2145.00 |
Invoice/cac:InvoiceLine/cbc:LineExtensionAmount/@currencyID | string | Currency for invoice line net amount | invoiceItem.currencyIsoCode | EUR |
Invoice/cac:InvoiceLine/cac:Item/cbc:Name | string | A name for an item. | invoiceItem.productName | Laptop Comptuer |
Invoice/cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID | string | The VAT category code for the invoiced item. | product.taxCategory | S |
Invoice/cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cac:TaxScheme/cbc:ID | string | Mandatory element. Use “VAT” | VAT | VAT |
Invoice/cac:InvoiceLine/cac:Price/cbc:PriceAmount | number | The price of an item, exclusive of VAT, after subtracting item price discount. The Item net price has to be equal with the Item gross price less the Item price discount, if they are both provided. Item price can not be negative. |
PriceAmount is calculated from
| 23.45 |
Invoice/cac:InvoiceLine/cac:Price/cbc:PriceAmount/@currencyID | string | Currency for item net price | invoiceItem.currencyIsoCode | EUR |
Field Mapping Column Specification
The following table shows the details of each column in the Field Mappings.
COLUMN |
DESCRIPTION |
Document Field Name |
The template field name of the document field, in the form of XPATH.
|
Field Type |
The field type of the document field. |
Constant Value |
The constant value supplied for the Document Field For each document field, users can either enter a Constant Value (e.g., SchemaID requires a constant value), or a mapped Nue field.
|
Mapped Object |
The mapped Nue object for the Document Field. For each document field, the default mapped object will be displayed. Users can change the mapped object and select from the following list of objects:
When the Mapped Object is selected or changed, the Mapped Field column will be refreshed to show the fields available for the selected object. For example, the Mapped Field column shows a picklist of all fields of Invoice, when the Mapped Object is set to Invoice. |
Mapped Field |
The mapped Nue field for the Document Field. The available picklist values are determined by the selected Mapped Object. For each document field, users can either enter a Constant Value (e.g., SchemaID requires a constant value), or a mapped Nue field with the matching data type.
|
Restore to System Defaults
For each country mandate, when a user customizes the mapping, a new mapping record is generated by duplicating the default template. All modifications made by the user are saved to this custom mapping record. Users have the option to revert to the system defaults by deleting the custom mapping. This can be done by clicking the ‘Restore to Defaults’ button on the Edit Mappings page, which discards all customizations and restores the original default mappings.
Activate Country Mandates
Once the filter and field mappings are configured, users can activate the selected country mandate by toggling the “Active” switch. Upon activation, the following are validate:
- Check if the mandate filter is defined;
- Check if all of the required fields have field mappings or constant values.
Schedule E-Invoicing Document Job
Admin users can schedule to run the E-Invoicing Document Job by following the steps below:
- Nue App → Settings → Avalara E-Invoicing
-
Once Avalara E-Invoicing is activated, configure the schedule for the document status retrieval job in the “Retrieve Document Status” section by selecting one of the following options:
• Every hour
• Every 10 minutes
• Every 30 minutes
Submit E-Invoicing Document
When an invoice is activated, whether manually or automatically, the activation process first verifies if E-Invoicing is enabled. If enabled, it checks whether the invoice satisfies any of the country mandate filters. If a match is found, the invoice status is updated to E-Invoicing, and the E-Invoicing document is then composed and submitted to Avalara.
Once the invoice status is set to E-Invoicing, Nue generates the E-Invoicing document using the mapping file associated with the relevant country mandate and submits it to Avalara ELR for processing.
Once the document is successfully submitted, the E-Invoicing Document Status is updated to Submitted. If the submission fails, the status is set to Error.
The document ID from the response payload is saved to the E-Invoicing Document ID field on the invoice or credit memo. The system then checks the E-Invoicing Status up to three times to retrieve the updated E-Invoicing Document Status.
Upon getting the E-Invoicing Document Status, the status will be stored in the E-Invoicing Document Status field of the invoice or credit memo.
📗 E-invoicing invoice status vs. E-Invoicing Document Status
Invoices in E-Invoicing status may have the following E-Invoicing Document Status:
Invoices reaching Complete E-Invoicing Document Status will be automatically activated:
Invoices with Error E-invoicing Document Status can be activated again, provided that the E-Invoicing error has been resolved.
Invoices with Submitted, Accepted and Pending E-Invoicing Document Status may not be activated until the E-Invoicing Document Status is changed to either Complete or Error. |
The E-Invoicing flow as part of the invoice activation process is illustrated in the following diagram.
View and Download E-Invoicing Document
Users can view and monitor the E-Invoicing statuses for all invoices and credit memos subject to E-Invoicing on both the list and detail pages of invoices and credit memos.
Users can add the following fields to the Invoice or Credit Memo list configuration. These fields are also available in the detail page of invoices and credit memos.
FIELD NAME | DESCRIPTION |
E-Invoicing Document Status |
Indicates the E-Invoicing document status. Available values include: - Submitted - Accepted - Pending - Error - Complete |
E-invoicing Document ID |
The E-Invoicing Document ID.
When the E-Invoicing Document ID is available, users can click 'Download' action icon to download the E-Invoicing Document in a selected format.
All available document formats will be presented for the user to choose from. Once a format is selected, the document in the chosen format will be downloaded. |
E-invoicing Message |
The message received from E-Invoicing.
Users can click on 'View Details' action link to view the message details. For example:
|
E-invoicing Mandate ID |
The E-Invoicing country mandate assigned to this invoice. |
Synchronize E-Invoicing Fields to Salesforce
E-Invoicing-related fields on invoices and credit memos are synchronized with Salesforce whenever their values are updated. Additionally, the following new status picklist value has been added to the status fields for both invoices and credit memos:
- Name: E-Invoicing
- API Name: einvoicing
NUE API NAME |
FIELD NAME |
SALESFORCE FIELD NAME |
DATA TYPE |
einvoicingDocStatus |
E-Invoicing Document Status |
ruby__EInvoicingDocStatus__c |
Picklist |
einvoicingDocId |
E-invoicing Document ID |
ruby__EInvoicingDocID__c |
Text(80) |
einvoicingMessage |
E-invoicing Message |
ruby__EInvoicingMessage__c |
LongText(131072) |
einvoicingMandateId |
E-invoicing Mandate ID |
ruby__EInvoicingMandateId__c |
Text(80) |
Avalara ELR Resources
The following Avalara ELR resources can help to further understand the configurations and oeprations of Avalara ELR:
- ELR Integration Guide
- ELR Postman Collection - by Avalara
- ELR Use Cases
- UBL Invoice Definition - Peppol BIS Billing 30 - May 2024 Release