Automatic sending and XML testing with the Fatture in Cloud addon

Integrationswordpressfatture-in-cloud2026-07-01

Goal

Enable automatic sending of invoices to Fatture in Cloud after an order is completed, and verify the flow with a test order before relying on the automation.

Prerequisites

Steps

Configure automatic sending

In the Fatture in Cloud tab:

  1. Order status that triggers sending (“Enable auto-send for status:”) — defaults to “Completed”, but can be set to another WooCommerce order status.
  2. Enable automatic sending of invoices (“Enable automatic sending”) — once an order reaches the configured status, an event is scheduled that runs after a configurable delay in hours (default 12 hours).
  3. When the delay elapses: the invoice is uploaded to Fatture in Cloud, then its formal validity is checked; only if valid is it forwarded to the SDI. If an invoice is invalid, sending stops and must be completed manually once the errors have been fixed.
  4. Disable automatic sending of invoices to the SDI (“Disables the automatic sending of invoices to the SDI”) — if enabled, stops the process after the upload/check on Fatture in Cloud and does not perform the automatic forwarding to the SDI (useful if you want Fatture in Cloud, not the plugin, to always decide when to send to the SDI).
  5. Email notification on failed creation — there is a dedicated option (“Send an email to the WordPress installation administrator … to report the failure to create the document on Fatture in Cloud”) to receive an email if automatic invoice creation fails.

WP-Cron reliability

Automatic-sending events are handled by WP-Cron, which only fires when someone visits a page on the site. On low-traffic sites, sending can be delayed or not start at all. To make it reliable, add a real system-level Cron job (via hosting, VPS, or a dedicated server) that calls it periodically (e.g. every 30 minutes):

cd <document_root>/public_html; wp cron event run --due-now >/dev/null 2>&1

where <document_root> is the domain’s root directory.

Diagnostic log

To trace the scheduling and execution of sends (including the order statuses passed through and the reason an automatic send was skipped), add this to wp-config.php:

define("WP_FATT_CLOUD_LOG", true);

Generating a test XML

Before relying on the automation, verify the flow with a test order:

  1. Make sure the addon is connected (see fatture-in-cloud-connect).
  2. Temporarily disable both “Enable automatic sending of invoices” and “Disable automatic sending of invoices to the SDI”, so no send happens on its own.
  3. Make a test purchase and move the order to the status configured as the trigger (default “Completed”). Go to the plugin’s Invoices section: you’ll find the generated XML, downloadable so you can check its structure.
  4. Once you’ve checked the XML, use the “Upload” button on the invoice to send it manually to Fatture in Cloud: after sending you’ll see it appear among the documents in your account.

Verify

Common errors

For the invoice data contract (payload, field mapping), see api/sdi. To understand an SDI rejection after forwarding, see sdi-invoice-rejected.