=== Invoicing Integration for easybill and WooCommerce ===
Contributors: devikit
Tags: woocommerce, easybill, invoice, germany, accounting
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.20
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Connect WooCommerce to easybill - native invoices, customer sync, USt-IdNr, and PDF downloads.

== Description ==

**Invoicing Integration for easybill and WooCommerce** is a dedicated [easybill](https://www.easybill.de/) bridge for WooCommerce. When you create an invoice from an order, your store sends customer and line-item data to easybill with your API key. Documents are real easybill **Rechnungen** (invoices), not copies stored only in WordPress.

This plugin is built only for easybill, offered **free on WordPress.org**, with an optional **annual PRO** add-on for automation, credit notes, and advanced EU tax options. Neither the free nor the PRO plugin adds its own monthly invoice cap on top of your shop — billing and API limits follow your **easybill account** and plan.

= Key Features (FREE) =

* **Manual invoice per order** — create a native easybill invoice (Rechnung) from the WooCommerce order screen.
* **Customer sync** — find or create easybill customers with billing address, email, and USt-IdNr / VAT ID.
* **USt-IdNr checkout field** — VAT ID on classic checkout and WooCommerce Blocks, with detection of common EU VAT plugins to avoid duplicate fields.
* **Tax mapping** — net / gross / auto, Kleinunternehmer (§19 UStG), third-country delivery; domestic DE line rates 0 % / 7 % / 19 % where applicable.
* **Draft or finalized documents** — keep new invoices as drafts or finalize them in easybill (with an assigned invoice number).
* **PDF download** — fetch easybill PDFs in wp-admin and in **My Account → Orders → View order**.
* **Connection test** — checks that your API key works with easybill.
* **Logging** — optional WooCommerce logger output with API key redaction.
* **HPOS compatible** — works with WooCommerce High-Performance Order Storage.
* **Blocks checkout** — USt-IdNr field supports block and classic checkout.

Automation, credit notes (Gutschrift), email PDF delivery, mark as paid, introduction & closing text, EU reverse charge (IG), EU OSS, ZUGFeRD e-invoices, and bulk tools are shown as **PRO teasers** in the free settings UI and require [Invoicing Integration for easybill and WooCommerce PRO](https://devikit.de/produkt/easybill-woocommerce-pro/).

= PRO Features =

Upgrade when you need hands-off invoicing and richer tax handling:

* **Automatic invoice creation** — create invoices when selected order statuses are reached, with retries on temporary failures.
* **Credit notes (Gutschrift)** — manual and automatic on refunds; customer PDF download in My Account.
* **Send Invoice PDF / Send Credit Note PDF** — WooCommerce emails with easybill PDF attachments.
* **Mark as paid** — record payment in easybill when orders reach processing or completed (per your settings).
* **Bulk create** — invoices or credit notes for many orders with progress tracking; bulk PDF download as ZIP.
* **Introduction & closing text** — custom text above and below line items on easybill documents, with order placeholders.
* **EU B2B reverse charge** — intra-community supply for EU business buyers with VAT ID.
* **EU OSS (B2C)** — OSS handling with destination VAT rates taken from WooCommerce.
* **E-invoice (ZUGFeRD)** — optional ZUGFeRD 2.5 / EN 16931 format on documents where enabled.
* **License management and automatic updates** via Devikit.
* **Priority email support**.

[**Get PRO Version**](https://devikit.de/produkt/easybill-woocommerce-pro/)

Documentation: [https://devikit.de/docs/easybill-woocommerce-pro/](https://devikit.de/docs/easybill-woocommerce-pro/)

= Requirements =

* WordPress 5.8 or higher
* WooCommerce 5.0 or higher
* PHP 7.4 or higher
* Active easybill account with API access (API key from **Profile & settings → API Key**; renew the key at least once per year as recommended by easybill)

= Helpful links =

* easybill API overview: [https://www.easybill.de/api/](https://www.easybill.de/api/)
* API key help: [https://support.easybill.de/hc/de/articles/115003808529-API-Key-REST-Schnittstelle](https://support.easybill.de/hc/de/articles/115003808529-API-Key-REST-Schnittstelle)

== Installation ==

1. Upload the `invoicing-integration-for-easybill-and-woocommerce` folder to `/wp-content/plugins/`, or install from the WordPress Plugins screen.
2. Activate the plugin.
3. Open **WooCommerce → easybill**.
4. Paste your easybill API key and click **Test Connection**.
5. Set document mode (draft / finalized), tax options, and checkout USt-IdNr behavior.
6. Create invoices from the order edit screen (order metabox).

== Frequently Asked Questions ==

= Where do I get my easybill API key? =

In easybill, open your username menu → **Profile & settings** → **API Key**, create or copy the key, and paste it into **WooCommerce → easybill**. easybill recommends renewing API keys at least yearly. See [API Key / REST interface](https://support.easybill.de/hc/de/articles/115003808529-API-Key-REST-Schnittstelle).

= Does the free plugin create invoices automatically? =

No. The free version creates invoices when you click **Create Invoice** on an order. Automatic creation, credit notes, emails, mark as paid, and bulk actions need [PRO](https://devikit.de/produkt/easybill-woocommerce-pro/).

= Does this plugin limit how many invoices I can create? =

The plugin does not enforce its own invoice quota or monthly document allowance. Usage is subject to your easybill subscription and API rate limits (the plugin retries on temporary limits).

= How is this different from connecting easybill via WooCommerce REST keys? =

This integration sends data from your shop to easybill when you create an invoice. It does not rely on easybill Connect pulling orders with WooCommerce REST API credentials stored in easybill.

= Does the plugin support Kleinunternehmer (§19 UStG)? =

Yes. Enable Kleinunternehmer in settings to map documents to the small-business VAT rules configured for your easybill account, including §19 UStG wording where applicable.

= Can customers download their invoice PDF? =

Yes, after an easybill invoice exists for the order, from **My Account → View order**.

= Is HPOS supported? =

Yes. The plugin declares compatibility with WooCommerce custom order tables.

= Does USt-IdNr work with WooCommerce Blocks? =

Yes. Classic and block checkout are supported. Optional “business invoice” checkbox mode is classic-checkout only; on Blocks the field stays visible when not hidden.

== External services ==

This plugin communicates with the **easybill REST API**, operated by easybill GmbH, to sync customers and create or retrieve documents.

= What is the easybill REST API? =

easybill is a German cloud invoicing and accounting service. This plugin uses the public REST API at `https://api.easybill.de/rest/v1/` to:

* Authenticate with your API key
* Test the connection
* Search, create, and update customers
* Create invoices, finalize drafts, and download PDFs
* (With PRO installed and licensed) create credit notes, set document text and tax options, apply ZUGFeRD settings, and record payments

Official documentation: [https://www.easybill.de/api/](https://www.easybill.de/api/).

= What data is sent and when? =

**When you create an invoice manually (FREE):**

* Customer: name, company, email, phone, billing address, USt-IdNr / VAT ID
* Order: line items (title, quantity, net/gross amounts, tax rates), shipping, fees, order date/reference

**When you test the connection or load settings:**

* Your API key for authentication
* Read-only connection and customer lookups

**When you or a customer downloads a PDF:**

* The related document identifier to fetch the PDF from easybill

**FREE plugin:** no easybill traffic runs on its own without your action (manual invoice, connection test, or PDF download), except optional background tasks you explicitly enable in WooCommerce.

**With PRO** (automation, refunds, mark as paid, bulk): additional order/refund data and payment records may be sent according to PRO settings when order statuses change or you run bulk actions.

= Service provider information =

* **Service name:** easybill REST API
* **Website:** [https://www.easybill.de/](https://www.easybill.de/)
* **API base URL:** `https://api.easybill.de/rest/v1/`
* **API documentation:** [https://www.easybill.de/api/](https://www.easybill.de/api/)
* **API key help:** [https://support.easybill.de/hc/de/articles/115003808529-API-Key-REST-Schnittstelle](https://support.easybill.de/hc/de/articles/115003808529-API-Key-REST-Schnittstelle)
* **Plugin documentation:** [https://devikit.de/docs/easybill-woocommerce-pro/](https://devikit.de/docs/easybill-woocommerce-pro/)
* **Privacy policy:** [https://www.easybill.de/datenschutz](https://www.easybill.de/datenschutz)

By using this plugin, customer and order data needed for invoicing is transmitted to easybill. You are responsible for GDPR compliance and for informing customers about this processing.

== Screenshots ==

1. Plugin settings
2. Plugin settings
3. Plugin settings
4. Plugin settings
5. Plugin settings
6. Plugin settings
7. Plugin settings
8. Plugin settings

== Changelog ==

= 1.0.20 =
* Fix: Align easybill invoice totals to the WooCommerce paid amount when per-line rounding differs by 1-2 cents.

= 1.0.19 =
* Fix: After coupon expiry, restore usage and generic PRO banners.

= 1.0.18 =
* Fix: Prefer bundled plugin translations over stale WP_LANG_DIR language packs.

= 1.0.17 =
* Fix: Rebuild language files so coupon upsell strings compile correctly.

= 1.0.16 =
* Add: Personalized first-year PRO coupon upsell for eligible FREE installs (30 days + 5 documents).
* Improve: Banner priority so coupon and usage notices do not stack with the generic PRO banner.

= 1.0.13 =
* Fix: Plugin URI points to Devikit PRO product page.
= 1.0.12 =
* Add: Devikit self-update checker (public manifest)

= 1.0.9 =
* Compliance: move credit-note/cancel/mark-paid API methods to PRO Client (Guideline 5).

= 1.0.8 =
* Move WordPress.org listing assets (icons/screenshots) to `.wordpress-org` so they deploy to SVN `/assets` and are excluded from the plugin ZIP.

= 1.0.7 =
* Align total mismatch alert threshold to 1 cent (0.01)

= 1.0.6 =
* Prevent duplicate USt-IdNr display in the admin order billing section

= 1.0.5 =
* Avoid duplicate USt-IdNr on Blocks/Store API order addresses

= 1.0.4 =
* Show USt-IdNr on formatted billing addresses (emails, My Account, thank-you)

= 1.0.3 =
* Show the mark-as-paid PRO teaser as a disabled unchecked checkbox

= 1.0.2 =
* Clarify the PRO mark-as-paid teaser as an optional setting

= 1.0.1 =
* Refresh WordPress.org readme and plugin branding icons
* Remove Open in easybill deeplink from the order metabox
* Prefer invoice numbers for PDF download filenames
* Use introduction and closing text wording in settings

= 1.0.0 =
* Initial release
* easybill REST client (Bearer auth, `/logins`, customers, documents, PDF)
* Manual Rechnung creation from WooCommerce orders with customer sync
* Tax modes including Kleinunternehmer and common DE/EU scenarios
* Draft or finalized (`/done`) document mode
* Invoice PDF in admin, orders list, and My Account
* USt-IdNr field for classic and Blocks checkout
* Connection test, debug logging with secret redaction, HPOS compatibility
* PRO teasers for automation, credit notes, emails, mark as paid, document texts, IG, OSS, ZUGFeRD, and bulk actions
* German (de_DE) translation

== Upgrade Notice ==

= 1.0.7 =
Uses a 1 cent (0.01) threshold for the order vs invoice total mismatch alert.

= 1.0.6 =
Removes duplicate USt-IdNr under the admin order billing address.

= 1.0.5 =
Prevents duplicate USt-IdNr on Blocks checkout order emails and My Account.

= 1.0.4 =
Shows USt-IdNr in order emails and My Account billing address.

= 1.0.3 =
Shows the mark-as-paid PRO teaser as a checkbox.

= 1.0.2 =
Updates the PRO mark-as-paid teaser wording.

= 1.0.1 =
Readme/branding refresh, clearer PDF filenames, and metabox cleanup.

= 1.0.0 =
First public release of the easybill WooCommerce integration.
