This project is not covered by Drupal’s security advisory policy.
Anuen integrates Drupal with Anuen, a service that issues Brazilian electronic invoices: NF-e (products) and NFS-e (services). Drupal sends the invoice, Anuen talks to the tax authority, and Drupal keeps a local record of each invoice, updated by webhook.
The Anuen Commerce submodule issues the NF-e of Drupal Commerce orders, automatically when the order is paid or by hand from the order.
Features
- API client for Anuen customers, products, services, NF-e and NFS-e.
- Local invoice records, with PDF (DANFE/DANFSe) and XML download.
- Signed webhooks (HMAC-SHA256). Repeated and out-of-order events are ignored.
- Idempotent issuing: retrying after a network failure never creates a duplicate invoice.
- Cron checks the invoices still being processed, in case a webhook is lost.
- The API token and webhook secret are read from
settings.php, never from exported configuration.
Anuen Commerce
- Queues the NF-e when an order is fully paid; cron issues it.
- Invoices tab on the order: issue, resend a rejected invoice, cancel, send a correction letter, download PDF and XML.
- Tax data field on product variations (NCM, CEST, CFOP, origin, CSOSN, unit, GTIN), with site-wide defaults.
- Picks the in-state or interstate CFOP from the customer's state.
- Maps each payment gateway to an NF-e payment method.
- Records status changes in the order activity (with commerce_log).
hook_anuen_commerce_nfe_alter()to change the NF-e before it is sent.
Post-Installation
- In the Anuen panel, under Integrations, create an API token. A testing token never issues real invoices.
- Add the token and the webhook secret to
settings.php:
$settings['anuen']['token'] = getenv('ANUEN_TOKEN'); $settings['anuen']['webhook_secret'] = getenv('ANUEN_WEBHOOK_SECRET'); - Go to Configuration › Web services › Anuen and click Test connection.
- Register the webhook URL shown there (
https://example.com/anuen/webhook) in Anuen. - With Anuen Commerce: set the series, tax codes and payment methods under Anuen › Commerce, and fill in the NCM of your products.
Additional Requirements
- An Anuen account with a digital certificate (A1) registered.
- Drupal 10.3, 11 or 12, on PHP 8.1 or later.
- Anuen Commerce: Commerce and a CPF/CNPJ field on the customer profile.
Recommended modules/libraries
- Brazilian IDs: validates the CPF/CNPJ field.
- Commerce Shipping: sets the freight modality of shipped orders.
Known limitations
- Shipping and fees are not included in the NF-e: the Anuen API has no fields for them.
- The default tax codes fit a Simples Nacional retailer. Check yours with an accountant.
Documentation
Supporting organizations:
Development and support
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: E-commerce
- Ecosystem: Commerce Core
- Created by thalles on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
1.0.0-alpha3
released 5 December 2026
Works with Drupal: ^10.3 || ^11 || ^12
Third alpha: the drupal.org CI passes
Install:
