Connecting Aruba to WooCommerce and enabling automatic sending
Goal
Link WooCommerce to the Aruba electronic invoicing service and enable automatic invoice sending after an order is completed.
Prerequisites
- The Aruba addon installed and active.
- An Aruba Premium invoicing account, or a basic account linked to a Premium account via delegation — this is a requirement of the Aruba account itself, not something the plugin checks.
- Only one invoice-sending integration can be active at a time: if Fatture in Cloud or SDI via PEC is already active, deactivate it before connecting Aruba.
Steps
1. Connect the account
In the plugin’s Aruba tab, enter the username and password of your Aruba invoicing account in the dedicated login panel. Nothing else is needed: the plugin authenticates directly with those credentials.
2. Configure automatic sending
- Order status that triggers sending (“Enable auto-send for status:”) — defaults to “Completed”, but can be set to another WooCommerce order status.
- 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): the invoice is sent to Aruba, which forwards it to the SDI after its own checks.
- If an invoice is invalid, sending stops and must be completed manually once the errors have been fixed.
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. Add a system-level Cron job 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 scheduling and execution of sends, add this to wp-config.php:
define("WP_FATT_ARUBA_LOG", true);
Verify
With the log enabled, generate a test order and check in the log file that sending was scheduled and executed; then check that the document appears on the Aruba portal.
Common errors
- Login doesn’t work even with correct credentials — verify that the account is actually Premium or properly delegated: a non-delegated basic account is not enabled for sending via API.
- Automatic sending doesn’t start — almost always WP-Cron isn’t firing due to lack of traffic: add the system Cron job described above.
- The invoice stays stuck after being sent to Aruba — Aruba flagged it as invalid during its validation check: fix the data and resend manually once the errors are resolved.
Related configuration
For the SDI delivery cycle and notification email logic, see aruba-invoice-flow. For the invoice data contract, see api/sdi.