Engineering
4 min read
Reconciling from webhooks, not from statements
Events tell you what happened the moment it happens. How to verify, store and replay them so your books match the chain every day.

Most finance teams reconcile from statements. At the end of the day or the week, a file arrives from each bank, and someone matches it against the company’s own records. The method works, but it is always late, and every discrepancy is found hours or days after it happened.
When money moves through an API, there is a better source of truth available: the events the platform sends as each operation changes state. This post explains how to build reconciliation on Nostro webhooks, so your ledger is up to date within seconds and a daily check only confirms what you already know.
Events as the record of what happened
Every mint, burn, conversion and payout on Nostro moves through a small set of states, from created to completed or failed. Each change emits an event. Subscribe an endpoint with POST /v1/webhooks, choose the event types you need, and we send each one as a signed HTTP request.
Batches have their own event. A call to POST /v1/payouts/batches can carry up to 5,000 payouts, and when it finishes you receive a single batch.completed event with the status of every payout inside it, rather than thousands of separate messages.
Verify before you trust
An endpoint that moves money in your books must accept events only from us. Every request carries a Nostro-Signature header with a timestamp and an HMAC-SHA256 signature of the payload, computed with your endpoint secret.
Recompute the signature from the raw request body, before any parsing, and compare it in constant time.
Reject events whose timestamp is more than a few minutes old. This stops an attacker from replaying a captured request later.
Keep the secret out of your code and rotate it if it is ever exposed.
Version 1 signatures, without a timestamp, keep working until March 31, 2027. New integrations should verify version 2 from the start.
Store first, process second
The most reliable webhook handlers do very little while the request is open. They verify the signature, write the raw event to a table, and return a success code. A separate worker then reads from that table and updates the ledger.
This split has three benefits. Your endpoint responds quickly, so deliveries do not time out. A bug in your processing code never loses an event, because the raw copy is already saved. And you keep a complete history you can reprocess if your logic changes.
Duplicates and ordering
Webhooks are delivered at least once. A network failure on your side can cause us to send the same event again, so store each event ID with a unique constraint and skip any you have already processed. This is the mirror image of the idempotency keys you send on your own requests.
Events can also arrive out of order. A completed event may reach you before the created event for the same payout. Rather than relying on arrival order, update each record to the state in the event only if that state is later in the lifecycle than the one you already hold. A completed payout never goes back to pending because an old event arrived late.
Replays when something goes wrong
If your endpoint is down for an hour, events are not lost. We retry failed deliveries with increasing delays, and you can replay any event, or every event in a time range. Because your handler already ignores duplicates, replaying a wide range is safe: anything you have seen is skipped, and anything you missed is filled in.
The daily check
With events feeding your ledger, the end-of-day reconciliation becomes a confirmation rather than an investigation. Compare three numbers per token:
Your ledger. The balance computed from the events you processed.
The Nostro balance. The sum of the settled events for that token at the same cut-off time, in UTC.
The chain. For tokens held in your own wallets, the on-chain balance at that block.
When all three match, the day is closed. When they do not, the difference points you to a specific event, usually one still pending at the cut-off, rather than to a whole statement to comb through. Bank statements still matter for the accounts that fund your mints and receive your burns, but they now confirm a handful of transfers instead of carrying the whole reconciliation.
Try it in the sandbox
The sandbox sends the same events, with the same signatures and the same retry behavior, as production. Create an endpoint, run npx nostro mint --token EURN --amount 100 --chain base with an sk_test_ key, and watch the events arrive. Then switch your endpoint off for a few minutes, mint again, and practice a replay before you ever need one.
Examples in this post are illustrative. Nostro is a demo company, not a real issuer.
More from the blog




