Tesouro delivers webhook events via HTTP POST to your registered endpoint.
Retry behavior
If your endpoint returns a 5xx status or doesn’t respond, Tesouro retries using exponential backoff within a 12-hour window. Once the window closes, the event is permanently marked as failed.
Deliveries that fail with a 4xx status are not retried. This includes errors from an inactive
or deleted subscription. Fix the underlying issue and resubmit if needed.
Retry schedule
Best practices
- Respond quickly: Return
2xx immediately and process the payload asynchronously. Long-running handlers risk timeouts, which trigger unnecessary retries.
- Implement idempotency: Tesouro delivers at least once. Retries may send the same event more than once. Use a stable event identifier from the payload to detect and discard duplicates.
- Log deliveries: Record incoming webhook requests. Logs are essential for diagnosing failed or out-of-order deliveries.
- Order events correctly: Due to network latency and retries, events may arrive out of chronological order. Use the attributes.updatedTimestamp field to correctly sequence events.
- Verify signatures: Where applicable verify webhook signatures before processing events.