# Take webhooks, and reconcile each window on a schedule

[Choose a reporting strategy](https://devportal-simpay-sbx.winkpg.io/docs/decide/reporting-strategy.md): Whether to ask this platform for payment data on a schedule, or to have it sent to you as it happens, and what each one costs you to run.

The stream carries the payments, and a scheduled query proves the window is complete instead of assuming it.

**Your answers so far**

- What does your reporting need from each payment? Every payment on its own, with its own detail.
- How soon after a payment do you need it? A scheduled run is soon enough. Minutes or hours later is fine.
- How many payments a day are you reporting on? Thousands a day or more.

**What to build**

Subscribe to the transaction events and load each one as it arrives, then run a filtered query over the closed window on your reporting cadence and insert anything the stream didn't deliver. At this volume the stream is what makes the load affordable, and the sweep is what makes it trustworthy: a receiver that was down for an hour loses that hour, and only a query notices.

**Worth knowing**

- Delivery is at least once. Record the event id you have already handled and ignore a repeat, because a retry after a slow acknowledgement is an ordinary event rather than a fault.
- Acknowledge within five seconds. Put the raw body on a queue and process it after you have answered, because slow handling is retried and a retry is a duplicate you then have to discard.
- Sweep a window that has already closed, and overlap it slightly with the one before. A sweep that reaches into the current window keeps finding payments that were about to arrive anyway.
- Make the load idempotent on the payment id. The sweep and the stream will hand you the same payment, which is the design working rather than failing.

**Where to go next**

- [Quickstart: webhooks](https://devportal-simpay-sbx.winkpg.io/docs/guides/quickstart-webhooks.md)
- [Blueprint: receive and verify webhooks](https://devportal-simpay-sbx.winkpg.io/docs/blueprints/receive-and-verify-webhooks.md)
- [List transactions, for the reconciliation sweep](https://devportal-simpay-sbx.winkpg.io/docs/api/transactionsGetList.md)
- [Webhook integration](https://devportal-simpay-sbx.winkpg.io/docs/guides/webhook-integration.md)

- [Start over](https://devportal-simpay-sbx.winkpg.io/docs/decide/reporting-strategy.md): go back to the first question.

## See also

- [All documentation](https://devportal-simpay-sbx.winkpg.io/llms.txt): the machine-readable index of every public page on this site.
