Webhooks

Receive real-time notifications when events occur in your ClawPay account.

Overview

Webhooks allow your application to receive HTTP POST requests when specific events happen. This is more efficient than polling the API and enables real-time integrations.

Creating Webhooks

Via API

const webhook = await client.webhooks.create({
  url: 'https://api.yourcompany.com/webhooks/clawpay',
  events: [
    'transaction.created',
    'transaction.completed',
    'authorization.required',
    'card.declined'
  ],
  secret: 'whsec_your_secret_key'
});

Via Dashboard

  1. Click "Add Endpoint"

  2. Enter your URL and select events

  3. Save and note your webhook secret

Event Types

Transaction Events

Event
Description

transaction.created

Transaction initiated

transaction.completed

Transaction successfully settled

transaction.failed

Transaction failed to process

transaction.refunded

Transaction refunded

Card Events

Event
Description

card.created

New card issued

card.activated

Card activated by cardholder

card.declined

Card transaction declined

card.frozen

Card frozen by user or system

card.cancelled

Card permanently cancelled

Authorization Events

Event
Description

authorization.required

Transaction requires manual approval

authorization.approved

Authorization request approved

authorization.denied

Authorization request denied

authorization.timeout

Authorization request timed out

Vault Events

Event
Description

vault.created

New vault created

vault.balance_low

Vault balance below threshold

vault.frozen

Vault frozen

vault.closed

Vault closed

Transfer Events

Event
Description

transfer.created

Transfer initiated

transfer.completed

Transfer completed

transfer.failed

Transfer failed

Webhook Payload

All webhooks follow this structure:

Verifying Signatures

Always verify webhook signatures to ensure requests are from ClawPay.

TypeScript/Node.js

Using SDK

Python

Go

Best Practices

1. Respond Quickly

Respond with 200 OK within 5 seconds. Process events asynchronously:

2. Handle Idempotency

Events may be delivered more than once. Use the event ID to track processed events:

3. Use HTTPS

Webhook URLs must use HTTPS in production. HTTP is only allowed in sandbox mode.

4. Monitor Webhook Health

Check webhook delivery status in your dashboard or via API:

Retry Logic

If your endpoint returns a non-2xx status code, ClawPay will retry delivery:

  • Retry 1: 5 seconds later

  • Retry 2: 1 minute later

  • Retry 3: 10 minutes later

  • Retry 4: 1 hour later

After 4 failed attempts, the webhook is marked as failed and you'll receive an email notification.

Testing Webhooks

Test Events

Send test events to verify your endpoint:

Local Development

Use tools like ngrokarrow-up-right to expose your local server:

Webhook Inspector

View webhook delivery logs in the dashboard:

  • Request payload

  • Response status

  • Response body

  • Timestamp

  • Retry attempts

Example Integrations

Slack Notifications

Database Sync

Email Alerts

Webhook Security

IP Allowlist

Restrict webhook traffic to ClawPay IPs:

Updated list: docs.useclawpay.app/ipsarrow-up-right

Rate Limiting

ClawPay respects rate limits. If your endpoint returns 429 Too Many Requests, we'll back off and retry later.

Timeout

Webhook requests timeout after 10 seconds. Ensure your endpoint responds quickly.

Disabling Webhooks

Disable a webhook without deleting it:

Webhook Limits

Plan
Max Webhooks
Max Retries
Retention

Free

2

4

7 days

Pro

10

6

30 days

Enterprise

Unlimited

Custom

Custom

Next Steps

Last updated