Skip to main content
Dubu uses webhooks to push real-time notifications to your server whenever something meaningful happens in your account. When an event fires, Dubu sends an HTTP POST request to every active endpoint subscribed to that event type. Your server should respond with a 2xx status code within 5 seconds to acknowledge receipt.

How delivery works

Each webhook request contains:
  • A JSON body with the event type, data payload, and a timestamp.
  • An X-Dubu-Signature header containing an HMAC-SHA256 signature you can use to confirm the request came from Dubu.
  • An X-Dubu-Timestamp header with the ISO 8601 time the event was dispatched.
Test deliveries also include X-Dubu-Test-Mode: true so you can distinguish test events from live ones.

Payload shape

Every event payload follows this structure:
event
string
The event type string, e.g. deposit.settled.
data
object
Event-specific data. The shape varies by event type; see the event catalogue below.
timestamp
string
ISO 8601 timestamp of when the event was dispatched.

Verifying signatures

Every request from Dubu includes an X-Dubu-Signature header in the format sha256=<hex_digest>. You should always verify this signature before processing an event to ensure it was not tampered with in transit. To verify, compute an HMAC-SHA256 of the raw request body using your endpoint’s signing secret, then compare it to the value in the header. Use a constant-time comparison to prevent timing attacks.

Node.js example

Important: Parse the request body as a raw Buffer before reading it as JSON. If your framework parses JSON first, the raw body is no longer available and signature verification will fail.

Retry policy

If your endpoint returns a non-2xx response, times out, or is unreachable, Dubu retries delivery with exponential back-off. Check your delivery logs to see failed attempts and their error details. To avoid duplicate processing, make your event handlers idempotent — use the event type and the id in the data payload as a deduplication key.

Event catalogue

Deposit events

These events fire as a deposit progresses through its lifecycle. deposit.settled payload
deposit.failed payload

Withdrawal events

withdrawal.completed payload

Customer events

customer.balance.credited payload

Checkout events

checkout.payment.completed payload

Onramp and transfer events


Best practices

Respond quickly. Your endpoint must return a response within 5 seconds. If you need to do heavy processing, return 200 OK immediately and handle the event asynchronously (e.g. push to a queue). Use idempotency keys. The same event can be delivered more than once due to retries. Use the id field inside data (or the combination of event + id) as a deduplication key in your database. Verify every signature. Always check the X-Dubu-Signature header before trusting an incoming payload. Reject requests that fail verification with a 401 status. Use HTTPS. Dubu only delivers events to HTTPS endpoints. Plain HTTP URLs are rejected at registration time. Monitor your logs. Check the delivery logs endpoint regularly to catch failed deliveries early.