Actions37
- Contact Actions
- Invoice Actions
- Item Actions
- Payment Actions
- Estimate Actions
- Tax Actions
- Bank Account Actions
Overview
This node integrates with the Alegra API to manage invoices, specifically allowing you to create new sales invoices. It is useful for automating invoice generation in business workflows, such as after a sale or service completion, ensuring accurate and timely billing.
Typical use cases include:
- Automatically creating invoices from order data in an e-commerce system.
- Generating invoices for services rendered tracked in a CRM.
- Creating electronic invoices compliant with Colombian regulations (including payment form and method).
When creating an invoice, the node supports detailed configuration of invoice metadata, client association, payment details, itemized billing, taxes, discounts, and additional optional fields like currency, exchange rate, and terms.
Properties
| Name | Meaning |
|---|---|
| Date | Invoice date in YYYY-MM-DD format. |
| Due Date | Invoice due date in YYYY-MM-DD format. |
| Client Name or ID | Select the client from a list or specify their ID via expression. |
| Payment Form | Payment form required for Colombia; options: Cash, Credit. |
| Payment Method | Payment method required for Colombia; options: Cash, Bank Transfer, Credit Card, Debit Card, Check, Other. |
| Generate Electronic Invoice | Boolean flag to indicate whether to generate an electronic invoice (stamp). |
| Items | Collection of one or more invoice items, each including: - Item Name or ID (select or specify) - Price (unit price) - Quantity - Description (required for Colombia) - Discount percentage (0-100) - Tax(es) (select multiple) |
| Additional Fields | Optional extra invoice fields: - Seller Name or ID - Observations (internal notes) - Anotation (notes printed on invoice) - Terms and Conditions - Number Template Name or ID - Cost Center Name or ID - Currency (COP, USD, EUR, MXN, ARS, PEN, CLP) - Exchange Rate (to local currency) - Invoice Type (National, Export, Contingency) - Retentions (tax retentions) |
Output
The node outputs JSON data representing the created invoice as returned by the Alegra API. This includes all invoice details such as IDs, dates, client info, items, totals, taxes, and status.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to the Alegra API using an API key credential configured in n8n.
- The node uses various Alegra API endpoints to fetch options dynamically (e.g., clients, items, taxes).
- Proper API credentials and network access to Alegra's environment URL are necessary.
Troubleshooting
Common issues:
- Missing required fields such as date, due date, client, items, payment form/method may cause errors.
- Invalid date formats can lead to request failures.
- Incorrect client/item/tax IDs will result in API errors.
- Network or authentication problems with the Alegra API will prevent invoice creation.
Error messages:
- Errors from the API are surfaced as node operation errors with descriptive messages.
- "Unknown error occurred" indicates unexpected failures, often network or credential related.
Resolutions:
- Ensure all required properties are set correctly.
- Validate date formats as YYYY-MM-DD.
- Confirm that referenced entities (clients, items, taxes) exist in Alegra.
- Verify API credentials and connectivity.
- Use "Continue On Fail" option in n8n to handle individual record errors gracefully.