Perfex CRM

Interagir com o Perfex CRM via WON API

Overview

This node integrates with the Perfex CRM system via the WON API, specifically allowing you to update an existing invoice ("Fatura"). It enables modifying various invoice details such as client association, invoice number, dates, currency, amounts, status, project linkage, and invoice items.

Common scenarios for this node include:

  • Updating invoice information after corrections or changes in billing.
  • Adjusting invoice due dates or totals based on new agreements.
  • Adding or modifying invoice line items programmatically.
  • Synchronizing invoice data from other systems into Perfex CRM.

For example, you might use this node to update the due date of an invoice when a customer requests an extension or to add additional items to an invoice before sending it out.

Properties

Name Meaning
ID da Fatura The unique identifier of the invoice to update.
Dados da Fatura Collection of fields representing the invoice data to update. Includes:
- ID do Cliente: ID of the client associated with the invoice.
- Número: Invoice number.
- Data: Invoice date (format YYYY-MM-DD).
- Data de Vencimento: Invoice due date (format YYYY-MM-DD).
- Moeda: Currency ID used in the invoice.
- Subtotal: Invoice subtotal amount.
- Total: Total amount of the invoice.
- Status: Status ID of the invoice.
- ID do Projeto: Project ID linked to the invoice.
- Itens: JSON array representing the invoice items.

Output

The node outputs a JSON object representing the updated invoice as returned by the Perfex CRM API. This includes all invoice fields after the update operation.

No binary data output is produced by this node.

Example output structure (simplified):

{
  "id": "string",
  "clientid": "string",
  "number": "string",
  "date": "YYYY-MM-DD",
  "duedate": "YYYY-MM-DD",
  "currency": 0,
  "subtotal": 0,
  "total": 0,
  "status": 0,
  "project_id": "string",
  "items": []
}

Dependencies

  • Requires an API token credential for authenticating with the Perfex CRM WON API.
  • The node uses Axios HTTP client internally to communicate with the API endpoint.
  • The base URL and API token must be configured in the node credentials.

Troubleshooting

  • Invalid JSON in Items: If the "Itens" field contains invalid JSON, the node will throw an error stating "Items deve ser um JSON válido". Ensure the JSON syntax is correct.
  • Date Format Errors: Dates must be in YYYY-MM-DD format. Otherwise, errors like "Data deve estar no formato YYYY-MM-DD" or "Data de vencimento deve estar no formato YYYY-MM-DD" will occur.
  • Authentication Errors: If the API token is missing or invalid, the node throws "Erro de autenticação: Token inválido ou não fornecido".
  • Resource Not Found: If the invoice ID does not exist, expect "Recurso não encontrado".
  • Invalid Data: Validation errors return messages like "Dados inválidos" with details from the API.
  • Connection Issues: Network problems result in "Erro de conexão com o servidor".

To resolve these issues:

  • Validate JSON inputs carefully.
  • Use correct date formats.
  • Verify API token and permissions.
  • Confirm invoice IDs exist before updating.
  • Check network connectivity.

Links and References


This summary covers the update operation for invoices in the Perfex CRM node, focusing on input properties, expected output, dependencies, and common troubleshooting tips.

Discussion