# Electronic invoicing (e-invoicing)

Send electronic invoices from Stripe using apps from the Stripe App Marketplace or a custom webhook integration.

E-invoicing (electronic invoicing) is the structured, machine-readable exchange of invoice data between businesses and, in some countries, government tax authorities. Unlike a PDF sent by email, a legally compliant e-invoice is in XML format (typically UBL or CII), transmitted through a certified network or government-operated exchange, and processed automatically by the recipient’s systems.

Many countries require businesses to send e-invoices for B2B and B2G (business-to-government) transactions. Requirements vary by country, including which format to use, which transmission network to use, and whether invoice data must be reported to tax authorities in real time.

Stripe Invoicing creates invoice records and exposes invoice data through our API and webhooks, but doesn’t generate or transmit legally compliant e-invoice files on its own. To comply with e-invoicing mandates, you can use third-party providers from the Stripe App Marketplace or build a custom integration using Stripe webhooks.

## How Stripe supports e-invoicing

Because e-invoice formats, transmission networks, and compliance rules differ by country and change frequently, Stripe relies on specialized third-party providers to handle generation, validation, and delivery. You can connect Stripe to these providers in two ways:

- **Use an App from the Stripe App Marketplace**: Stripe’s preferred e-invoicing partner is [Billit](https://marketplace.stripe.com/apps/billit-e-invoicing), but there are multiple providers available in the [Stripe App Marketplace](https://marketplace.stripe.com/). Using a Stripe App provides a no-code setup—the app reads your Stripe invoice data and handles format conversion and transmission on your behalf.
- **Build a webhook integration**: More flexible for custom workflows, existing e-invoicing provider relationships, or countries not covered by Billit.

## Option 1: Use Billit 

Billit is Stripe’s preferred e-invoicing partner, available from the Stripe App Marketplace and supports e-invoicing across multiple countries.

**To install Billit**:

1. Open the [Billit listing on the Stripe App Marketplace](https://marketplace.stripe.com/apps/billit-e-invoicing) and click **Install**.
2. Follow the onboarding steps to connect your Stripe account and configure your business details and tax registration information.
3. Test with a sample invoice before processing live transactions.

For other e-invoicing apps, browse the [invoicing and billing category on the Stripe App Marketplace](https://marketplace.stripe.com/search?q=e-invoicing).

## Option 2: Build a webhook integration 

If you have an existing e-invoicing provider or need support for a country not covered by one of our app partners, you can build an integration that listens for Stripe invoice events and forwards invoice data to your provider.

**Integration flow**:

1. Set up a [webhook endpoint](https://docs.stripe.com/webhooks.md) that listens for the `invoice.created` event. You can also use `invoice.finalized` but because finalized invoices can’t be edited, you won’t be able to edit the invoice directly if the government authority rejects your submission for any reason.
2. When Stripe sends the event, retrieve the full `Invoice` object using the `invoice.id` from the event payload.
3. Extract the fields your e-invoicing provider requires—typically invoice date, line items, tax amounts, and customer identifiers such as the VAT registration number.
4. Transform the invoice data into the format your provider expects (for example, Peppol BIS Billing 3.0 XML or a country-specific XML format), and submit it to your provider’s API.
5. Store the provider’s confirmation, document ID, and transmission status for your records.

### Customer data to collect

Most e-invoicing formats require your customer’s tax registration number or a network identifier such as a PEPPOL participant ID. Store these on the [Customer](https://docs.stripe.com/api/customers.md) object before sending invoices:

- **Tax or VAT registration number**: Use the `tax_ids` field on the `Customer` object. Stripe supports country-specific types such as `gb_vat`. See [Customer tax IDs](https://docs.stripe.com/invoicing/customer/tax-ids.md) for the full list of supported types.
- **PEPPOL participant identifiers and other network identifiers**: Stripe doesn’t have a native field for these. Store them as [metadata](https://docs.stripe.com/metadata.md) on the `Customer` object using a consistent key convention (for example `peppol_participant_id`).

### Handle rejections and status updates

E-invoice networks often return acceptance or rejection notifications asynchronously. Your integration should handle these responses, retry on transient failures, and store the final delivery status for audit and compliance purposes.

## See also

- [Customer tax IDs](https://docs.stripe.com/invoicing/customer/tax-ids.md)
- [Best practices for global invoicing](https://docs.stripe.com/invoicing/global-invoices.md)
- [Integrate with the Invoicing API](https://docs.stripe.com/invoicing/integration.md)
