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 payment charges ("Cobrança"). Specifically, the "Atualizar" (Update) operation for the "Cobrança" resource allows users to update existing payment charge details such as customer, billing type, amount, due date, description, and external references.

Typical use cases include:

  • Modifying the amount or due date of an existing charge.
  • Changing the payment method or customer associated with a charge.
  • Updating descriptive information or external identifiers for reconciliation purposes.

For example, if a customer requests to extend the due date or change the payment method from boleto bancário (bank slip) to PIX, this node can perform that update seamlessly.

Properties

Name Meaning
Cliente * The ID of the customer associated with the charge. Must be a valid customer identifier (e.g., starting with "cus_").
Tipo De Cobrança * The payment method/type of the charge. Options: Boleto Bancário, Cartão De Crédito, Cartão De Débito, Depósito Em Conta, Indefinido (Cliente Escolhe), PIX, Transferência Bancária.
Valor * The amount of the charge in Brazilian reais (minimum 0.01).
Data De Vencimento * The due date of the charge.
Descrição Optional description text for the charge.
Referência Externa Optional free-text field for identifying the charge in your own system.
Número De Parcelas Number of installments (1 to 12). Only applicable when billing type is Cartão De Crédito (credit card).
Valor Da Parcela Value of each installment. If set to 0, it will be calculated automatically. Applicable only for credit card billing type.
Juros Por Atraso (%) Monthly interest rate for late payments (max 2%). Applicable for boleto, PIX, transfer, and deposit billing types.
Multa Por Atraso (%) Late payment fine percentage (max 10%). Applicable for boleto, PIX, transfer, and deposit billing types.
Desconto Discount settings including value, days before due date to apply discount, and discount type (fixed amount or percentage).
Configurações PIX PIX-specific configuration, e.g., QR code expiration time in minutes (15 to 2880). Only shown if billing type is PIX.
ID Da Cobrança * Unique identifier of the charge to update. This is required to specify which charge record to modify.

Output

The node outputs the updated charge data as JSON. The structure corresponds to the response from the Asaas API after updating a payment charge, typically including fields like:

  • id: Unique charge ID
  • customer: Customer ID linked to the charge
  • billingType: Payment method used
  • value: Charge amount
  • dueDate: Due date of the charge
  • description: Description text
  • externalReference: External reference string
  • Other relevant metadata returned by the API

No binary data output is produced by this node.

Dependencies

  • Requires an active connection to the Asaas API via an API key credential.
  • The node uses the Asaas API base URL, switching between sandbox and production environments based on credential configuration.
  • No additional external dependencies beyond the Asaas API are needed.

Troubleshooting

  • Invalid Customer ID: If the "Cliente" field is empty or does not start with "cus_", the node throws an error indicating the customer ID must be valid (e.g., "cus_000005219613").
  • Missing Required Fields: Omitting mandatory fields like "ID Da Cobrança", "Valor", or "Data De Vencimento" will cause errors.
  • API Request Failures: Network issues or invalid API keys will result in request errors. Verify API credentials and network connectivity.
  • Package Removal Warning: The node checks if its npm package is still available; if removed, it throws an error advising to remove the node from the installation.
  • Incorrect Billing Type Settings: Providing installment counts or PIX configurations when not applicable may lead to ignored or rejected parameters.

To resolve errors:

  • Ensure all required fields are correctly filled.
  • Validate customer and payment IDs format.
  • Confirm API credentials and environment setup.
  • Review billing type-specific options carefully.

Links and References

Discussion