Nue Knowledge Center

Nue Docs navigation

search
clear
/

Streamlined E-Invoicing with Avalara ELR

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

  • Manage Avalara E-Invoicing

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 FIELDFIELD TYPEDESCRIPTIONNUE OBJECT MAPPING OR CONSTANT VALUEEXAMPLE
Invoice
Invoice/cbc:CustomizationIDstringSpecification 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:ProfileIDstringBusiness 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:IDnumberInvoice number: A unique identification of the Invoice.invoice.name33445566
Invoice/cbc:IssueDatedateInvoice issue dateThe date when the Invoice was issued.invoice.transactionDate2023-10-25
Invoice/cbc:InvoiceTypeCodenumberA code specifying the functional type of the Invoice.

Invoice: 388 (Tax invoice)
Debit Memo: 383 (Debit note)

 

For detailed information, please refer to this page.  

380
Invoice/cbc:DocumentCurrencyCodestringThe 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.currencyIsoCodeEUR
Accounting Supplier: The Seller - A group of business terms providing information about the Seller
Invoice/cac:AccountingSupplierParty/cac:PartyobjectThe supplier party itself.  
Invoice/cac:AccountingSupplierParty/cac:Party/cbc:EndpointIDnumberIdentifies 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/@schemeIDnumberSeller electronic address identification scheme identifier.Endpoint identifier scheme identifier MUST belong to the CEF EAS code listConstant.  This value must be supplied by the company.    0088
Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCodestringA code that identifies the country.Organization Country Code in this form.GB
Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationNamestringThe 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 NameThe Sellercompany Incorporated
Accounting Customer Party: The Buyer - A group of business terms providing information about the Buyer. 
Invoice/cac:AccountingCustomerParty/cac:Party/cbc:EndpointIDnumberIdentifies the Buyer's electronic address to which the invoice is delivered.

customer.einvoicingEndpointId

987654321
Invoice/cac:AccountingCustomerParty/cac:Party/cbc:EndpointID/@schemeIDnumberEndpoint identifier scheme identifier MUST belong to the CEF EAS code listcustomer.einvoicingSchemeId0192
Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCodestringA code that identifies the country.customer.billingCountrySE
Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationNamestringThe full name of the Buyer.customer.legalEntityNameBuyer Full Name AS
Invoice/cac:TaxTotal/cbc:TaxAmountnumberThe total VAT amount for the Invoice.The Invoice total VAT amount is the sum of all VAT category tax amounts.invoice.taxAmount486.25
Invoice/cac:TaxTotal/cbc:TaxAmount/@currencyIDstringCurrency for total VAT amountinvoice.currencyIsoCodeEUR
Invoice/cac:LegalMonetaryTotal/cbc:LineExtensionAmountnumberSum of all Invoice line net amounts in the Invoice without VATinvoice.amountWithoutTax3800.00
Invoice/cac:LegalMonetaryTotal/cbc:LineExtensionAmount/@currencyIDstringCurrency for invoicetotal amountinvoice.currencyIsoCodeEUR
Invoice/cac:LegalMonetaryTotal/cbc:TaxExclusiveAmountnumberThe total amount of the Invoice without VAT.invoice.amountWithoutTax3600.00
Invoice/cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount/@currencyIDstringCurrency for invoice total amount without VATinvoice.currencyIsoCodeEUR
Invoice/cac:LegalMonetaryTotal/cbc:TaxInclusiveAmountnumberThe 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.amount4500.00
Invoice/cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount/@currencyIDstringCurrency for invoice total amount with VATinvoice.currencyIsoCodeEUR
Invoice/cac:LegalMonetaryTotal/cbc:PayableAmountnumberThe 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.balance3500.00
Invoice/cac:LegalMonetaryTotal/cbc:PayableAmount/@currencyIDstringCurrency for amount due for paymentinvoice.currencyIsoCodeEUR
Invoice Item
Invoice/cac:InvoiceLine/cbc:IDnumberA unique identifier for the individual line within the Invoice. This value should be only numeric value between 1 and 999,999invoiceItem.name without 'II-'. This has to be a numeric number only.123456
Invoice/cac:InvoiceLine/cbc:InvoicedQuantitynumberThe quantity of items (goods or services) that is charged in the Invoice line.invoiceItem.transactionQuantity100
Invoice/cac:InvoiceLine/cbc:InvoicedQuantity/@unitCodestringThe unit of measure that applies to the invoiced quantity.invoiceItem.uomNameC62
Invoice/cac:InvoiceLine/cbc:LineExtensionAmountnumberThe 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.transactionAmountWithoutTax2145.00
Invoice/cac:InvoiceLine/cbc:LineExtensionAmount/@currencyIDstringCurrency for invoice line net amountinvoiceItem.currencyIsoCodeEUR
Invoice/cac:InvoiceLine/cac:Item/cbc:NamestringA name for an item.invoiceItem.productNameLaptop Comptuer
Invoice/cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:IDstringThe VAT category code for the invoiced item.product.taxCategoryS
Invoice/cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cac:TaxScheme/cbc:IDstringMandatory element. Use “VAT”VATVAT
Invoice/cac:InvoiceLine/cac:Price/cbc:PriceAmountnumberThe 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 

transactionAmountWithoutTax / transactionQuantity

23.45
Invoice/cac:InvoiceLine/cac:Price/cbc:PriceAmount/@currencyIDstringCurrency for item net priceinvoiceItem.currencyIsoCodeEUR

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.  

  • When the user enters a Constant Value, the Mapped Object and Mapped Field will be disabled.  
  • When the user enters a Mapped Object or Mapped Field, the Constant Value will be disabled.

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:

  • Organization
  • Sales Account
  • Billing Account (i.e., Customer) 
  • Invoice or Credit Memo, depending on the selection of the Document Type
  • Invoice Item or Credit Memo Item, depending on the selection of the Document Type
  • Product

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.    

  • When the user enters a Constant Value, the Mapped Object and Mapped Field will be disabled.  
  • When the user enters a Mapped Object or Mapped Field, the Constant Value will be disabled

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:

  • Accepted: Indicates that the E-Invoicing document has been received by Avalara ELR
  • Pending: Indicates that Avalara ELR is waiting for a response from a Tax Authority or Network. 
  • Submitted: Indicates the E-Invoicing document has been successfully submitted.  A scheduled job is checking for the document processing status.  
  • Error: The document has an error. 
  • Complete: The document has been submitted and approved. 

Invoices reaching Complete E-Invoicing Document Status will be automatically activated: 

  • If “Pending Activation” is enabled at the organizational level, the invoice status will be set to Pending Activation; 
  • Otherwise, the invoice status will be set to Active

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 NAMEDESCRIPTION

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: