Skip to content

Webhook registration and dispatch on payment #9

Description

@iexwr

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveStellar Wave for StackPayenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions