Perfex CRM

Interagir com o Perfex CRM via WON API

Overview

This node integrates with the Perfex CRM system via the WON API, allowing users to manage various CRM resources such as clients, contacts, leads, projects, tasks, and invoices. Specifically, for the Cliente (Client) resource with the Atualizar (Update) operation, the node updates an existing client record in the Perfex CRM.

Typical use cases include automating client data updates based on external triggers or workflows, such as updating company information, contact details, or status when changes occur in other systems. For example, if a client's phone number or address changes in another database, this node can update the corresponding client record in Perfex CRM automatically.

Properties

Name Meaning
ID do Cliente The unique identifier of the client to update.
Dados do Cliente A collection of fields representing the client data to update. Includes:
- Nome da Empresa: Client's company name
- VAT: Client's VAT number (CPF/CNPJ), must be 11 or 14 digits
- Telefone: Client's phone number
- País: Client's country
- Cidade: Client's city
- CEP: Client's postal code
- Estado: Client's state
- Endereço: Client's address
- Website: Client's website URL
- Ativo: Boolean indicating if the client is active

Output

The node outputs JSON data representing the updated client record as returned by the Perfex CRM API. This typically includes all client fields after the update, reflecting the current state of the client in the CRM.

No binary data output is produced by this operation.

Dependencies

  • Requires an API token credential for authenticating requests to the Perfex CRM WON API.
  • The node uses Axios HTTP client configured with the base URL and API token from credentials.
  • The API endpoint used for updating clients is /won_api/won/api/clients/{clientId} with an HTTP PUT request.

Troubleshooting

  • Invalid VAT Number: If the VAT (CPF/CNPJ) provided is not exactly 11 or 14 digits after removing non-digit characters, the node throws an error:
    "CPF/CNPJ inválido. Deve ter 11 dígitos (CPF) ou 14 dígitos (CNPJ)".
    Resolution: Ensure the VAT number is correctly formatted and contains only digits with the correct length.

  • Authentication Errors: If the API token is missing or invalid, the node throws:
    "Erro de autenticação: Token inválido ou não fornecido".
    Resolution: Verify that the API token credential is correctly set up and valid.

  • Resource Not Found: If the client ID does not exist, the node throws:
    "Recurso não encontrado".
    Resolution: Confirm the client ID is correct and exists in the CRM.

  • Invalid Data: If the API returns validation errors, the node throws messages like:
    "Dados inválidos: <error message>".
    Resolution: Check the data fields for correctness and completeness according to the API requirements.

  • Connection Issues: Network or server issues result in:
    "Erro de conexão com o servidor".
    Resolution: Check network connectivity and API server status.

Links and References


This summary covers the logic and usage of the "Atualizar" operation for the "Cliente" resource in the Perfex CRM node.

Discussion