Webhooks

Receive real-time event notifications

Last updated: 2026-01-19

Webhooks notify your application when events happen in Spark!. Receive real-time updates about new orders, affiliate signups, payouts, and more.

Setting Up Webhooks

  1. Navigate to Settings → API → Webhooks
  2. Click "Add Webhook Endpoint"
  3. Enter your endpoint URL (HTTPS required)
  4. Select events to subscribe to
  5. Copy the signing secret for verification

Available Events

  • affiliate.created — New affiliate signed up
  • affiliate.approved — Affiliate was approved
  • affiliate.updated — Affiliate profile changed
  • order.attributed — Order attributed to affiliate
  • commission.created — Commission calculated
  • commission.approved — Commission confirmed
  • commission.paid — Commission paid out
  • payout.created — Payout batch created
  • payout.completed — Payout batch processed
  • click.recorded — Affiliate link clicked

Payload Format

Webhook payloads are JSON objects with:

  • id — Unique event ID
  • type — Event type (e.g., "order.attributed")
  • created_at — ISO 8601 timestamp
  • data — Event-specific data object
Idempotency

Use the id field to deduplicate events. In rare cases, the same event may be delivered multiple times.

Verifying Webhooks

Verify webhook signatures to ensure authenticity:

  1. Extract the X-Spark-Signature header
  2. Compute HMAC-SHA256 of the raw body using your signing secret
  3. Compare computed signature with header value
  4. Reject requests that don't match

Retry Policy

If your endpoint fails (non-2xx response), Spark! retries:

  • Immediate retry
  • After 5 minutes
  • After 30 minutes
  • After 2 hours
  • After 24 hours

After 5 failed attempts, the webhook is marked as failed.

Testing Webhooks

Test your webhook endpoint:

  • Use the "Send Test Event" button in settings
  • View webhook delivery logs
  • Retry failed deliveries manually

Next Steps

Was this page helpful?

Need more help? Contact support