Register a webhook endpoint
Webhooks
Register Webhook
Register a URL to receive outbound event notifications.
The HMAC signing secret is generated server-side and returned once in
this response — store it securely. You will use it to verify the
Stablepay-Signature header on every delivered event.
Signature verification (Node.js):
const crypto = require('crypto');
function verify(secret, body, sigHeader) {
const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(body).digest('hex');
return crypto.timingSafeEqual(Buffer.from(sigHeader), Buffer.from(expected));
}
Event types:
| Type | Description |
|---|---|
payment.processing | USDC broadcast on-chain |
payment.succeeded | Payout confirmed by provider |
payment.failed | Payout failed (all retries exhausted) |
payment.refunded | Payment manually refunded by ops |
Pass an empty events array to subscribe to all event types.
POST
Register a webhook endpoint
The
secret field is returned only once at registration time. Store it securely — it cannot be retrieved again. Use it to verify incoming Stablepay-Signature headers on your endpoint.Authorizations
Stablepay API key. Include as Authorization: Bearer <key>.
Body
application/json
Response
201 - application/json
Webhook registered. Save the secret — it is not retrievable after this response.

