Asaas icon

Asaas

Integração com a API do Asaas

Actions4

Overview

The Asaas n8n node, when configured with the resource Cliente (Customer) and operation Atualizar (Update), allows you to update an existing customer in your Asaas account via their API. This is useful for keeping customer records up-to-date, such as when a customer's contact information or address changes.

Common scenarios:

  • Automatically updating customer details from another system (e.g., CRM, ERP).
  • Synchronizing user profile changes from web forms or support tickets.
  • Bulk-updating customer data as part of a migration or integration workflow.

Example:
If a customer updates their email or address on your website, this node can be used in an n8n workflow to push those changes directly to your Asaas customer database.


Properties

Name Type Meaning
ID do Cliente string The unique identifier of the customer to update in Asaas. Required.
Nome string The full name of the customer. Required.
CPF/CNPJ string The Brazilian tax identification number (CPF for individuals, CNPJ for companies). Required.
Email string The customer's email address. Can accept multiple values.
Telefone string The customer's landline phone number.
Celular string The customer's mobile phone number.
Endereço string The street address of the customer.
Número string The street number of the customer's address.
Complemento string Additional address information (e.g., apartment, suite).
Estado string The state/province of the customer's address.
CEP string The postal code (CEP) of the customer's address.

Output

The node returns the updated customer object as received from the Asaas API. The structure typically includes fields such as:

{
  "id": "cus_1234567890",
  "name": "Nome do Cliente",
  "cpfCnpj": "123.456.789-00",
  "email": "cliente@email.com",
  "phone": "1122334455",
  "mobilePhone": "11987654321",
  "address": "Rua Exemplo",
  "addressNumber": "123",
  "complement": "Apto 45",
  "province": "SP",
  "postalCode": "01234-567",
  // ...other fields returned by Asaas
}

If an error occurs and "Continue On Fail" is enabled, the output will include an error field with the error message.


Dependencies

  • External Service: Requires access to the Asaas API.
  • API Key: You must configure valid Asaas API credentials in n8n under the credential type asaasApi.
  • n8n Configuration: No special environment variables are required beyond the API key setup.

Troubleshooting

Common Issues:

  • Invalid Customer ID: If the provided "ID do Cliente" does not exist, the API will return an error.
  • Missing Required Fields: Omitting required fields like "Nome" or "CPF/CNPJ" will result in validation errors.
  • Authentication Errors: Incorrect or missing API credentials will cause authentication failures.

Error Messages:

  • "error": "Customer not found" – Check that the "ID do Cliente" is correct and exists in your Asaas account.
  • "error": "Invalid CPF/CNPJ" – Ensure the CPF or CNPJ is correctly formatted and valid.
  • "error": "Unauthorized" – Verify your Asaas API credentials in n8n.

How to resolve:

  • Double-check all required property values.
  • Ensure your Asaas API credentials are active and have sufficient permissions.
  • Use the "Continue On Fail" option to handle errors gracefully in bulk operations.

Links and References


Discussion