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
| Need | Content |
|---|---|
| Understand how Webhooks work | Introduction - Webhooks |
| Configure through the Asaas application | Create new Webhook via the web application |
| Configure programmatically | Create new Webhook via the API |
| Implement the receiving endpoint | Receive Asaas events at your Webhook endpoint |
| Choose the events | Webhook Events |
| Handle duplicate events | How to implement idempotence in Webhooks |
| Choose between sequential and non-sequential delivery | Send types |
| Understand when to use Webhooks instead of queries | Polling vs. Webhooks |
| Investigate delivery failures | Webhook Logs |
| Solve queue problems | Paused 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
| Behavior | How to handle it |
|---|---|
at least once delivery | The same event may be received more than once. Use the event id to implement idempotence. |
| Endpoint response | Persist the event and respond HTTP 200 quickly. Process business rules asynchronously. |
| Delivery failure | Asaas retries the delivery and may apply a penalty to the queue. |
| Consecutive failures | After 15 consecutive failures, the Webhook queue may be interrupted. |
| Retention | Pending events remain available for up to 14 days. |
| Number of Webhooks | Each account can have up to 10 configured Webhooks. |
AttentionDo not process an event as if each delivery were unique.
Webhooks follow the
at least oncemodel, 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 200quickly; - monitor the Webhook Logs;
- protect the endpoint with authentication and appropriate network rules.
If you use an authToken, validate the header:
asaas-access-tokenFor 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:
| Situation | How to proceed |
|---|---|
| The endpoint started failing | Queue penalty |
| The queue was interrupted | Paused queue |
| The problem was fixed | How to reactivate an interrupted queue |
Cloudflare returns 403 | Firewall block on CloudFlare |
| An allowlist needs to be configured | Asaas 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
Updated 5 days ago
