Asaas icon

Asaas

Integração com a API do Asaas para pagamentos e cobranças

Overview

This node integrates with the Asaas API to manage webhooks, specifically allowing you to update existing webhook configurations. The "Webhook - Atualizar" operation updates properties of a webhook such as its name, URL, notification email, events that trigger it, sending type, API version, activation status, failure behavior, and optional authentication token.

Common scenarios for this node include:

  • Modifying the URL where webhook notifications are sent after initial creation.
  • Changing which events trigger the webhook notifications (e.g., subscription updates, payment received).
  • Enabling or disabling the webhook without deleting it.
  • Updating the authentication token used by the webhook for security purposes.
  • Adjusting how webhook notifications are sent (sequentially or not).

Practical example: You have a webhook set up to notify your system when payments are received. Later, you want to add more event triggers like subscription cancellations and update the webhook URL to a new endpoint. This node operation allows you to perform these updates programmatically within an n8n workflow.

Properties

Name Meaning
Nome * Identifier name of the webhook.
URL * The URL that will receive the webhook notifications. Example: https://your-site.com/webhook.
Email * Email address to receive failure notifications related to the webhook. Example: your-email@example.com.
Eventos * Events that will trigger the webhook. Options include:
- Assinatura Atualizada (Subscription Updated)
- Assinatura Cancelada (Subscription Cancelled)
- Assinatura Criada (Subscription Created)
- Cliente Atualizado (Customer Updated)
- Cliente Criado (Customer Created)
- Cliente Removido (Customer Removed)
- Cliente Restaurado (Customer Restored)
- Cobrança Aguardando Risco (Payment Awaiting Risk Analysis)
- Cobrança Aprovada Na Análise De Risco (Payment Approved by Risk Analysis)
- Cobrança Atualizada (Payment Updated)
- Cobrança Criada (Payment Created)
- Cobrança Recebida (Payment Received)
- Cobrança Removida (Payment Deleted)
- Cobrança Reprovada Na Análise De Risco (Payment Reproved by Risk Analysis)
- Cobrança Restaurada (Payment Restored)
- Cobrança Vencida (Payment Overdue)
- Transferência Cancelada (Transfer Cancelled)
- Transferência Criada (Transfer Created)
- Transferência Em Processamento (Transfer In Progress)
- Transferência Falhada (Transfer Failed)
- Transferência Pendente (Transfer Pending)
- Transferência Realizada (Transfer Done)
Enviar Tipo Type of webhook sending:
- Sequencial (SEQUENTIALLY): Sends webhooks in sequence.
- Não Sequencial (NON_SEQUENTIALLY): Sends webhooks without specific order.
Versão Da API API version of Asaas for the webhook:
- Versão 2 (version 2, older)
- Versão 3 (version 3, current default)
Ativo Whether the webhook is active (true) or inactive (false).
Interromper Em Falha Whether to interrupt the webhook on failure (true) or continue (false).
Token De Autenticação Optional authentication token for securing the webhook.
ID Do Webhook * Unique identifier of the webhook to update. Required to specify which webhook to modify.

Output

The node outputs the JSON response from the Asaas API representing the updated webhook object. This typically includes all webhook properties such as:

  • id: Unique webhook ID.
  • name: Webhook name.
  • url: Notification URL.
  • email: Failure notification email.
  • events: Array of event types triggering the webhook.
  • sendType: Sending type (sequential or not).
  • apiVersion: API version used.
  • enabled: Activation status.
  • interrupted: Failure interruption flag.
  • authToken: Authentication token if set.
  • Other metadata fields returned by the API.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the Asaas API.
  • The node uses the Asaas API base URL, switching between sandbox and production environments based on credentials.
  • No additional external services beyond Asaas API are required.

Troubleshooting

  • Common issues:

    • Invalid or missing webhook ID will cause the update to fail.
    • Incorrect API key or expired credentials will result in authentication errors.
    • Providing invalid event names or empty required fields will cause validation errors.
    • Network connectivity issues can prevent API calls.
  • Error messages and resolutions:

    • "Este pacote foi removido do npm e não está mais disponível." — This indicates the node package is no longer available; remove the node from your workflow.
    • API errors related to authorization usually mean the API key is incorrect or lacks permissions.
    • Validation errors about missing required fields (e.g., name, url, email) require ensuring those inputs are correctly set.
    • Timeout or network errors suggest checking your internet connection or Asaas API availability.

Links and References

Discussion