| 开发者 | devxhubio |
|---|---|
| 更新时间 | 2026年6月10日 18:34 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
https://service.invoice-api.xhub.io/api/v1/invoice/{country}/{format}/generate
What is sent: for every order processed (auto on a status transition you configure, or manually via the meta box):
_invoice_api_xhub_. This includes the buyer's billing details that are part of the invoice payload and will appear in the generated XML/PDF.
When a WordPress administrator processes a personal-data export request (Tools → Export Personal Data), the plugin contributes the invoice number, generation timestamp, format, and filename for each order belonging to the requested email address.
When a personal-data erasure request is processed, the plugin deletes the stored invoice payload and all associated metadata for orders belonging to the requested email address.
invoice-api-xhub-for-woocommerce to /wp-content/plugins/, or install through the Plugins screen.No. WooCommerce 8.0 or later is required. The plugin fails closed and shows an admin notice when WooCommerce is missing.
Yes. The plugin declares custom_order_tables compatibility. Order data is read through the WC_Order API, not directly from wp_posts.
In /wp-content/uploads/invoice-api-xhub/<order-id>/<filename>. The plugin writes a .htaccess file with Deny from all to block direct URL access (Apache). On Nginx, add location ~ /uploads/invoice-api-xhub/ { deny all; } to your server config — invoices contain buyer addresses and must not be web-accessible. Order meta stores only the relative path. Older installs of the plugin (≤ v0.x) stored the base64 payload directly on the order; the read path supports both for backward compatibility.
Yes. Open the order, find the Invoice-api.xhub meta box on the right, click "Re-generate invoice".
No. The plugin produces the XRechnung XML and stores it on the order. You upload it to the federal/state platform yourself, or pass it to your accounting software which does.
Order meta _invoice_api_xhub_leitweg_id or _invoice_api_xhub_buyer_reference if set, then the global Leitweg-ID from settings, finally the WooCommerce order number as buyer reference.
The invoice-api.xhub.io API returns the generated XML or PDF file as a base64-encoded string in the JSON response (this is the standard pattern for delivering binary data over JSON). The plugin decodes that string with base64_decode() so it can be served to the merchant as a download or attached to the customer email. The function is not used to evaluate or execute any data — only to decode HTTP-response payload. The decoded content is treated as opaque file bytes and never passed to eval, assert, create_function, or similar.
Out of the box, the default format INV-{order_number} reuses the WooCommerce order number, which is not guaranteed to be gap-free across the entire system (deleted orders, other plugins reserving IDs). For German tax compliance use a format with the {seq} token, e.g. 2026-{seq:0000}. The plugin maintains a separate sequential counter that is uniquely incremented for every generated invoice, with optional yearly or monthly reset.
Yes. By default the plugin uses the standard template provided by invoice-api.xhub.io. To use your own:
550e8400-e29b-41d4-a716-446655440000)_invoice_api_xhub_template_id before the generate fires. Per-order override beats the global default.
INVOICEAPIXHUB_*) to comply with WordPress.org prefix guidelines (avoid WC_ namespace collisions).Contributors to the WordPress.org owner account.