From Indrajeet Sengupta: E-Invoicing with Revenue Cloud

What is E-Invoicing?

Imagine instead of printing an invoice, putting it in an envelope, and mailing it or emailing it, you create it in your accounting software and send it directly to your customer’s accounting software in a structured digital format. That’s e-invoicing in a nutshell.

E-invoicing is the issuance and exchange of invoices in a structured electronic data format, designed for machine-to-machine readability and automated processing. Crucially, a true e-invoice is not simply a PDF or scanned document; it is a structured file, often in XML, UBL, or EDI formats, that can be automatically validated, consumed, and posted directly into a recipient’s accounting or ERP system. The exchange typically occurs through standardized Peppol networks or dedicated government portals. This systematic approach eliminates manual data entry and establishes a transparent, auditable flow of fiscal transaction data between trading partners.

For any multinational enterprise, implementing einvoicing correctly and efficiently is an imperative compliance measure. Governments—particularly those with VAT/GST systems—are imposing mandates to gain real-time or near real-time visibility into business transactions, a strategy designed to combat fraud and close the tax gap. Failure to comply with country-specific standards results in penalties and can prevent a business from legally trading in key jurisdictions. Operationally, this required automation reduces significant administrative costs (paper, postage, labor), eliminates manual data entry errors, and accelerates Accounts Receivable and Accounts Payable cycles, directly improving cash flow.


2. The Benefits of Going Digital

Why are businesses and governments so excited about e-invoicing? The advantages are clear:

  • Cost Savings: Say goodbye to expenses on paper, printing, and postage. More importantly, you save countless hours of manual processing time.
  • Faster Payments: Because e-invoices are received and processed instantly, the approval and payment cycle is significantly shorter. This greatly improves cash flow.
  • Reduced Errors: Manual data entry is prone to human error. E-invoicing eliminates this, ensuring accuracy and reducing the back-and-forth of correcting mistakes.
  • Enhanced Security: E-invoices are exchanged over secure networks, drastically reducing the risk of invoice fraud, phishing scams, and interception compared to paper or PDF invoices sent via email.
  • Improved Compliance: With governments increasingly mandating e-invoicing for tax purposes, adopting it ensures you stay compliant with tax regulations automatically.
  • Environmental Friendliness: Less paper means a smaller carbon footprint. 

3. The Global Trend: E-Invoicing Mandates

Governments worldwide are recognizing the power of e-invoicing to combat tax evasion and digitize their economies. This has led to a wave of mandates requiring businesses to adopt e-invoicing. The trend is moving from a “post-audit” model (where tax authorities check records later) to a “clearance” model (where invoices must be cleared by the government in real-time).

Here’s a snapshot of the global landscape:

Country/RegionMandate StatusKey Go-Live DatesOfficial Source Link
Americas
BrazilMandatory (Fragmented)NFCom: 1 Nov 2025; National NFS-e: 2026http://www.nfe.fazenda.gov.br/portal
MexicoMandatoryLive (CFDI 4.0 since 1 Apr 2023)https://www.sat.gob.mx/portal/public/tramites/factura-electronica
ChileMandatoryLive (since Feb 2018)https://www.sii.cl/servicios_online/
ColombiaMandatoryLive (since Nov 2020)https://micrositios.dian.gov.co/sistema-de-facturacion-electronica/
PeruMandatoryLive (since 2022)https://cpe.sunat.gob.pe/
ArgentinaMandatoryLive (since 2019 for most sectors)https://www.afip.gob.ar/fe/
Costa RicaMandatoryLive (since 2019)https://www.hacienda.go.cr/ATV/login.aspx
Europe
FrancePhased MandateReception: 1 Sep 2026; Issuance (Large/Mid): 1 Sep 2026; Issuance (SME): 1 Sep 2027https://www.impots.gouv.fr/professionnel/je-decouvre-la-facturation-electronique
GermanyPhased MandateReception: 1 Jan 2025; Issuance (Large): 1 Jan 2027; Issuance (All): 1 Jan 2028https://en.e-rechnung-bund.de/
ItalyMandatoryLive (since 1 Jan 2019)https://www.agenziaentrate.gov.it/portale/aree-tematiche/fatturazione-elettronica/fatturazione-elettronica-site-area
PolandPhased MandateIssuance (Large): 1 Feb 2026; Issuance (All): 1 Apr 2026https://www.podatki.gov.pl/ksef/
SpainMandate Pending RegsProjected 2027/2028https://www.facturae.gob.es/factura-electronica/Paginas/factura-electronica.aspx
DenmarkB2G(Mandatory) / B2B (Phased)1 January 2005: B2G , 1 January 2024 – 1 January 2026: Phased Implementation for B2Bhttps://danishbusinessauthority.dk/requirements-digital-bookkeeping-systems
BelgiumMandatory1 Jan 2026https://einvoice.belgium.be/en
RomaniaMandatoryReporting: 1 Jan 2024; E-invoicing: 1 Jul 2024https://www.anaf.ro/anaf/internet/ANAF/despre_anaf/strategii_anaf/proiecte_digitalizare/e.factura
SerbiaMandatoryLive (since 1 Jan 2023)https://www.efaktura.gov.rs/
AustriaB2G MandatoryLive (B2G since 1 Jan 2014)https://www.usp.gv.at/en.html
BulgariaB2G MandatoryLive (B2G since 1 Jul 2017)https://www.e-docs.bgsait.com/
Canary IslandsMandate Pending RegsSame as Spain (Projected 2027/2028)https://www.gobiernodecanarias.org/tributos/
CroatiaB2G MandatoryLive (B2G since 1 Jul 2019)https://www.fina.hr/servis-e-racun
CyprusB2G MandatoryLive (B2G since 1 Apr 2020)https://www.uat.gov.cy/
Czech RepublicB2G MandatoryLive (B2G since 1 Oct 2016)https://www.nakh.cz/cs/
DenmarkMandatoryLive (B2G since 2005, B2B since 2024 for bookkeeping)https://erhvervsstyrelsen.dk/
EstoniaB2G MandatoryLive (B2G since 1 Jul 2019)https://www.rtk.ee/
FinlandB2G MandatoryLive (B2G since 1 Apr 2020)https://www.valtiokonttori.fi/
Great Britain (UK)B2G (NHS) MandatoryLive (NHS since 2019)https://www.gov.uk/government/publications/public-procurement-policy-note-0318
IcelandMandatoryLive (B2G since 2015, B2B since 2016)https://www.fjs.is/
IrelandB2G MandatoryLive (B2G since 18 Apr 2020)https://ogp.gov.ie/e-invoicing-in-ireland/
LuxembourgPhased MandateLive (Large: May 2022; Mid: Oct 2022; Small: Mar 2023)https://gouvernement.lu/en/dossiers/2021/facturation-electronique.html
NetherlandsB2G MandatoryLive (B2G since 18 Apr 2019)https://www.logius.nl/producten/e-factureren
NorwayB2G MandatoryLive (B2G since 1 Jan 2019)https://www.digdir.no/
PortugalPhased MandateLive (B2G since Jan 2021; B2B since Jan 2023)https://www.espap.gov.pt/
SloveniaB2G MandatoryLive (B2G since 1 Jan 2015)https://www.ujp.gov.si/
SwedenB2G MandatoryLive (B2G since 1 Apr 2019)https://www.digg.se/
APAC & Middle East
Saudi ArabiaPhased MandatePhase 2 (Integration) live since 1 Jan 2023 in waveshttps://zatca.gov.sa/en/E-Invoicing/Pages/default.aspx
IndiaPhased MandateLive (Threshold: AATO > Rs. 5 Crore)https://einvoice1.gst.gov.in/
JapanQualified Invoice SystemLive (since 1 Oct 2023)https://www.nta.go.jp/taxes/shiraberu/zeimokubetsu/shohi/keigenzeiritsu/invoice_about.htm
AustraliaPhased MandateB2G Live (since 1 Jul 2022)https://www.ato.gov.au/Business/eInvoicing/
New ZealandPhased MandateB2G Capability: 1 Jan 2026https://www.einvoicing.govt.nz/
MalaysiaPhased MandateIssuance (Large): 1 Aug 2024; Issuance (All): 1 Jul 2025https://www.hasil.gov.my/en/e-invoice/

4. How Does It Work? The E-Invoicing Process

The process involves a few key steps and players for both the seller and the buyer.

For the Seller:

  1. Invoice Creation: The seller creates an invoice in their ERP or accounting system as usual.
  2. Tax Determination: Often, a specialized tax vendor solution is integrated to automatically calculate the correct VAT/GST based on the transaction details, ensuring tax accuracy.
  3. Conversion & Validation: The invoice data is converted into a structured e-invoice format (like XML).
  4. Sending to Partner: The seller sends this e-invoice to their chosen invoicing partner (e.g., Vertex, Sovos, Pagero, Avalara). This partner acts as an access point to the e-invoicing network.
  5. Transmission: The partner validates the invoice against country-specific rules and transmits it securely through the required network (like PEPPOL or a government portal) to the buyer’s access point. In “clearance” models, this step includes sending the invoice to the tax authority for real-time approval before it’s sent to the buyer.

For the Buyer:

  1. Receiving: The buyer’s invoicing partner receives the e-invoice from the network.
  2. Data Ingestion: The partner sends the structured data directly into the buyer’s ERP or accounts payable (AP) system.
  3. Automated Processing: The AP system automatically processes the invoice, matching it against purchase orders and goods receipts without any manual keying.
  4. Approval & Payment: The invoice is routed for digital approval and scheduled for payment, all within the same system.

5. Common Formats for E-Invoices

Because e-invoices are meant for machines to read, they use structured data formats. You’ll often hear these terms:

  • XML (eXtensible Markup Language): The foundation for many e-invoice standards.
  • UBL (Universal Business Language): A popular library of standard XML business documents, widely used in e-invoicing.
  • Factur-X / ZUGFeRD: A hybrid format popular in France and Germany that embeds an XML file within a human-readable PDF.
  • PEPPOL BIS Billing 3.0: The standard format used across the PEPPOL network.

6. Common E-Invoicing Networks

E-invoices don’t just travel over the open internet; they use secure, standardized networks.

  • PEPPOL (Pan-European Public Procurement On-Line): The most widespread international network. It’s not just for Europe; countries like Australia, New Zealand, Singapore, and Japan have adopted it. It works as a “four-corner model” where the seller (corner 1) sends to their Access Point (corner 2), which sends to the buyer’s Access Point (corner 3), which delivers to the buyer (corner 4).
  • Government-Centralized Platforms: Many countries, particularly in Latin America (e.g., Mexico’s CFDI, Brazil’s NF-e) and Europe (e.g., Italy’s SdI), operate a centralized government hub. All invoices must pass through this single platform for validation and clearance.
  • Service Provider Networks: Companies like Sovos, Tungsten, and Tradeshift operate large networks that can connect businesses to each other and to various government platforms, simplifying compliance across multiple countries.

7. How do you do it in Revenue Cloud

Salesforce Revenue Cloud is a powerful engine for managing complex billing, and can be functionality expanded where needed to connect to government portals and standardized networks such as PEPPOL. Additionally, Revenue Cloud can connect to and utilize external service providers to manage e-invoicing requirements across the globe

So, how do you bridge this gap? The answer lies in a well-architected middleware integration. While Salesforce’s recommended IPaaS (Integration Platform as a Service) is MuleSoft, you can also build a custom solution. This guide breaks down the entire process, showing you how to turn Revenue Cloud into a compliant, global e-invoicing machine.

The Foundation in Salesforce

Before you can build any bridges, you need a solid foundation. This involves preparing your Salesforce org to hold all the necessary data and track the e-invoicing lifecycle.

Data Capture

Ensure all required data points for e-invoicing are captured in Salesforce. This data often lives across multiple objects. Key objects include Invoice, Account, Billing Schedule Group, InvoiceLine, InvoiceLineTax, Contact, BillingProfile.

E-Invoicing Status Field

On the Invoice object, create a custom picklist field named “E-Invoicing Status”. This field is crucial for tracking the invoice’s journey and triggering the automation.

Example Statuses:

  • Pending: The invoice has been created but is not yet ready for submission.(Draft Status of Invoice)
  • Canceled: DRAFT invoice not used, so canceled it.
  • Ready for E-Invoicing: The invoice has been finalized and is ready to be sent to the network. This status will be our trigger.
  • Sent to Network: The middleware has successfully sent the invoice data.
  • Acknowledged by Network: The network has received the invoice and confirmed its validity.
  • Approved: The invoice has been approved by the tax authority (for clearance models).
  • Rejected: The invoice was rejected by the network due to errors.
  • Correction Needed: Data needs correction.
  • Correction Addressed: Correction has been made and can be resent for Approval.
  • Error: The integration process failed.
  • Exempt: Invoice is exempted from E-Invoicing Process.
  • Voided invoice – No need to send for E-Invoicing.

This can be made more granular based on the country level specifications

E-Invoicing Fields on Invoice

There can be various details that might need to be captured, creating fields for these. Here are some example fields:

  1. E-Invoicing Status
  2. Idempotency Key
  3. Issue Date
  4. Document Number
  5. Document ID
  6. IRN Number (India)
  7. IdSdi (Italy)
  8. UUID (Mexico)
  9. Chave de Acesso (Brazil)
  10. Transmission DateTime
  11. PDF Document (or use Invoice Files)

Create Custom Salesforce Event for Invoice Posted

Salesforce does not generate an event whenever a custom field like “E-Invoicing Status” field is set to a particular value. To do this, we will create an event that is a lightweight message containing key identifiers, like the InvoiceId and AccountId. Using this the middleware will be able to fetch the invoice details

The Integration Process: A Detailed Breakdown

Here’s how the magic happens, step by step, following an event-driven architecture.

1. Trigger

The process kicks off inside Salesforce. An automation rule (using a Salesforce Flow or Apex Trigger) monitors the Invoice object. When a user updates an invoice’s “E-Invoicing Status” to “Ready for E-Invoicing” or “Correction Addressed”, the trigger fires. This E-Invoicing Status could change automatically once the Invoice is in Posted State or manually depending on business conditions. Customers can write flows to change this based on their business requirements.

2. Event

Upon firing, the trigger doesn’t call the middleware directly. Instead, it publishes a Custom Platform Event within Salesforce which can be read by the middleware or Mulesoft. This decouples Salesforce from the middleware, making the system more robust and scalable.

3. Listen

Your middleware layer is continuously listening for this specific Platform Event from Salesforce. When it catches a new event, it knows it has a new e-invoice to process.

4. Extract

The middleware takes the InvoiceId from the event message and makes a Composite API call back to Salesforce. This is highly efficient, as it allows the middleware to query the Invoice record and all its related parent records (like the Account for the Tax ID and the BSG for the PO number) in a single, consolidated API call.

5. Transform

This is the middleware’s primary job. It takes the JSON data extracted from Salesforce and transforms it into the required e-invoicing format for the target country. This usually means mapping the Salesforce fields to a structured XML format, such as UBL (Universal Business Language) or a country-specific standard like Factur-X.

6. Send

Once the e-invoice file is created, the middleware authenticates with the external E-Invoicing Network’s API and sends the transformed payload. The middleware then updates the “E-Invoicing Status” in Salesforce to Sent to Network.

7. Reconcile

The E-Invoicing Network will respond. This can happen in two ways:

  • Synchronous Response: An immediate reply confirming the file was received and is structurally valid. The middleware can use this to update the status in Salesforce to Acknowledged by Network.
  • Asynchronous Response: The final approval or rejection from a government tax authority may come minutes or hours later. The network typically sends this status back via a webhook, which is a URL pointing to your middleware. The middleware listens for this incoming webhook to receive the final status.

8. Update Back SF

Upon receiving the final reconciliation status (e.g., Approved or Rejected), the middleware makes one last API call to Salesforce. It updates the Invoice record with:

  • The final “E-Invoicing Status” (Approved or Rejected).
  • The unique Reference Number provided by the tax authority.
  • Any error messages in case of rejection.
  • Any other necessary fields that needs to be captured.

9. Accounting

Considering you implement the accounting features on the org, as outlined here https://help.salesforce.com/s/articleView?id=ind.billing_financial_accounting.htm&type=5, you will be able to find the journal entries generated to the transaction journal.

You can look at the following post for an example how this is done.