Alegra (Unofficial - BETA) icon

Alegra (Unofficial - BETA)

Consume Alegra API - UNOFFICIAL BETA community node. NOT officially supported by Alegra.

Overview

This node integrates with the Alegra API to create a new payment record. It allows users to register payments made either as income (Payment In) or expense (Payment Out), specifying details such as payment date, bank account, payment method, invoices being paid, and additional optional information like client/provider, categories, currency, exchange rate, retentions, and notes.

Common scenarios where this node is beneficial include automating financial workflows such as recording customer payments against invoices, tracking expenses paid through various methods, and managing payment details in accounting systems. For example, a business can automatically log payments received from clients or payments made to suppliers, ensuring accurate and up-to-date financial records without manual entry.

Properties

Name Meaning
Date The date of the payment in YYYY-MM-DD format.
Bank Account Name or ID Select the bank account from a list or specify its ID where the payment is processed.
Payment Method The method used for the payment. Options: Cash, Check, Transfer, Credit Card, Debit Card, Electronic, Other.
Type Specifies if the payment is incoming (income) or outgoing (expense). Options: Payment In (Income), Payment Out (Expense).
Invoices One or more invoices to which this payment applies. Each invoice requires an Invoice ID and the amount paid towards it.
Additional Fields Optional extra fields including:
- Client/Provider Name or ID Select or specify the client or provider associated with the payment.
- Observations Text field for any observations related to the payment.
- Anotation Additional notes about the payment.
- Categories One or more categories linked to the payment, each with category name or ID, amount, description, and applicable taxes.
- Currency Currency code for the payment. Options include COP (Colombian Peso), USD (US Dollar), EUR (Euro), MXN (Mexican Peso), ARS (Argentine Peso), PEN (Peruvian Sol), CLP (Chilean Peso). Default is COP.
- Exchange Rate Exchange rate to convert the payment currency to local currency. Defaults to 1.
- Retentions One or more retention entries, each with retention name or ID and amount withheld.

Output

The node outputs a JSON object representing the created payment as returned by the Alegra API. This typically includes all details of the payment record such as its unique ID, date, bank account, payment method, type, linked invoices, client/provider info, categories, currency, exchange rate, retentions, and any notes or observations.

No binary data output is produced by this node.

Dependencies

  • Requires an active connection to the Alegra API via an API key credential configured in n8n.
  • The node uses several dynamic option loaders to fetch lists of bank accounts, contacts, account categories, taxes, and retentions from Alegra to populate dropdowns.
  • Proper network access to Alegra's API endpoints is necessary.

Troubleshooting

  • Authentication errors: Ensure the API key credential is correctly set up and has sufficient permissions.
  • Invalid IDs: When specifying bank accounts, contacts, invoices, categories, taxes, or retentions by ID, verify that these IDs exist in Alegra.
  • Date format issues: Dates must be provided in ISO format (YYYY-MM-DD). Incorrect formats may cause API rejections.
  • Missing required fields: Required properties such as date, bank account, payment method, type, and invoices must be provided; otherwise, the API will return validation errors.
  • Network or API errors: Temporary network issues or Alegra API downtime can cause request failures. Retry after some time or check API status.
  • Amount precision: Amounts should be numeric with up to two decimal places to avoid formatting errors.

Links and References

Discussion