Context
External services (shops, bots) want to be notified when a request is paid, instead of polling.
Acceptance criteria
POST /api/v1/webhooks accepts { url, secret }, stores a Webhook row, returns its id.
- When the indexer records a
request_paid, enqueue a BullMQ job that POSTs { requestId, payer, status } (with secret header) to every registered webhook.
- Failed deliveries retry with backoff (BullMQ defaults acceptable).
Technical notes
- Validate
url with Zod (z.string().url()).
- Use the existing
ioredis/bullmq deps; create a webhooks queue.
Testing
- Test that registering a webhook and simulating a paid event results in a POST to the registered URL (local test server / nock).
Context
External services (shops, bots) want to be notified when a request is paid, instead of polling.
Acceptance criteria
POST /api/v1/webhooksaccepts{ url, secret }, stores aWebhookrow, returns itsid.request_paid, enqueue a BullMQ job that POSTs{ requestId, payer, status }(withsecretheader) to every registered webhook.Technical notes
urlwith Zod (z.string().url()).ioredis/bullmqdeps; create awebhooksqueue.Testing