Webhooks

Integrate with Webhooks

Receive automatic notifications when events occur in your Asaas account.

Asaas sends POST requests to the configured URL, allowing your application to react to changes without repeatedly querying the API.

Find the right content

NeedContent
Understand how Webhooks workIntroduction - Webhooks
Configure through the Asaas applicationCreate new Webhook via the web application
Configure programmaticallyCreate new Webhook via the API
Implement the receiving endpointReceive Asaas events at your Webhook endpoint
Choose the eventsWebhook Events
Handle duplicate eventsHow to implement idempotence in Webhooks
Choose between sequential and non-sequential deliverySend types
Understand when to use Webhooks instead of queriesPolling vs. Webhooks
Investigate delivery failuresWebhook Logs
Solve queue problemsPaused queue

How it works

%%{init: {"flowchart": {"nodeSpacing": 28,"rankSpacing": 32,"diagramPadding": 8,"padding": 10}}}%%
flowchart TD
    A["Select the events"] --> B["Create the Webhook"]
    B --> C["Receive the POST"]
    C --> D["Persist the event"]
    D --> E["Respond HTTP 200"]
    E --> F["Process idempotently"]
    F --> G["Update the application"]
    G --> H["Monitor the logs"]

    classDef inicio fill:#DBEAFE,stroke:#2563EB,color:#1E3A8A,stroke-width:3px,font-size:17px
    classDef validacao fill:#E0F2FE,stroke:#0284C7,color:#0C4A6E,stroke-width:2px,font-size:17px
    classDef sucesso fill:#DCFCE7,stroke:#16A34A,color:#14532D,stroke-width:3px,font-size:17px

    class A inicio
    class B,C,D,E,F,G validacao
    class H sucesso

    linkStyle default stroke:#94A3B8,stroke-width:2px

Essential rules

BehaviorHow to handle it
at least once deliveryThe same event may be received more than once. Use the event id to implement idempotence.
Endpoint responsePersist the event and respond HTTP 200 quickly. Process business rules asynchronously.
Delivery failureAsaas retries the delivery and may apply a penalty to the queue.
Consecutive failuresAfter 15 consecutive failures, the Webhook queue may be interrupted.
RetentionPending events remain available for up to 14 days.
Number of WebhooksEach account can have up to 10 configured Webhooks.
⚠️

Attention

Do not process an event as if each delivery were unique.

Webhooks follow the at least once model, so your integration must support redeliveries without duplicating actions.

Choose the events

Each Webhook can be configured to receive only the events your integration needs.

The Webhook Events page gathers the available categories and points to the specific events for charges, subscriptions, transfers, invoices, Checkout, Automatic Pix and other resources.

Avoid configuring events that your application does not use.

Prepare the endpoint for Production

Before using Webhooks in Production:

  • implement idempotence;
  • persist the event before running time-consuming processing;
  • respond HTTP 200 quickly;
  • monitor the Webhook Logs;
  • protect the endpoint with authentication and appropriate network rules.

If you use an authToken, validate the header:

asaas-access-token

For network restrictions, see Asaas official IPs.

When failures occur

Start with the Webhook Logs to identify the HTTP code, timeout or communication error.

How to proceed depends on the situation:

SituationHow to proceed
The endpoint started failingQueue penalty
The queue was interruptedPaused queue
The problem was fixedHow to reactivate an interrupted queue
Cloudflare returns 403Firewall block on CloudFlare
An allowlist needs to be configuredAsaas official IPs

The specific pages for 400, 403, 404, 408, 500, connection and timeout errors complement the troubleshooting once the cause has been identified.

Next steps


Did this page help you?