ribirewards logo
Request Demo
For Developers

Webhooks

Receive real-time notifications when gifts are delivered, redeemed, or expire. Keep your systems in sync automatically.

Setup GuideFull API Docs

Why use webhooks?

Webhooks push real-time updates to your application instead of polling our API

Instant notifications

Get notified within seconds when a gift status changes. No need to poll our API repeatedly.

Reduce API calls

Save API quota and reduce latency. We push updates to you instead of you checking for them.

Reliable delivery

Automatic retries with exponential backoff. We'll keep trying until your endpoint acknowledges receipt.

Available webhook events

Subscribe to the events that matter for your integration

gift.deliveredReal-time

Fired when a gift is successfully delivered to the recipient

gift.redeemedReal-time

Fired when recipient redeems their gift

gift.failedReal-time

Fired when gift delivery fails

gift.expiredDaily batch

Fired when an unredeemed gift expires

address.collectedReal-time

Fired when recipient provides shipping address for gift box

Setup guide

Get webhooks running in 5 minutes

1

Create an endpoint

Set up a POST endpoint on your server to receive webhook events:

// Example: Node.js / Express
app.post('/webhooks/ribirewards', (req, res) => {
  const event = req.body;
  
  // Verify webhook signature
  const signature = req.headers['x-ribi-signature'];
  if (!verifySignature(event, signature)) {
    return res.status(401).send('Invalid signature');
  }
  
  // Handle the event
  switch(event.type) {
    case 'gift.delivered':
      handleGiftDelivered(event.data);
      break;
    case 'gift.redeemed':
      handleGiftRedeemed(event.data);
      break;
    // ... other events
  }
  
  // Return 200 to acknowledge receipt
  res.status(200).send('Received');
});
2

Register your webhook

Add your endpoint URL in the RibiRewards dashboard or via API:

POST https://api.ribirewards.com/v1/webhooks
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "url": "https://your-domain.com/webhooks/ribirewards",
  "events": [
    "gift.delivered",
    "gift.redeemed",
    "gift.failed"
  ],
  "description": "Production webhook"
}
3

Verify signatures

Always verify that webhooks came from RibiRewards:

const crypto = require('crypto');

function verifySignature(payload, signature) {
  const expectedSignature = crypto
    .createHmac('sha256', WEBHOOK_SECRET)
    .update(JSON.stringify(payload))
    .digest('hex');
  
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expectedSignature)
  );
}

Example webhook payload

Here's what you'll receive when a gift is delivered

{
  "id": "evt_1234567890",
  "type": "gift.delivered",
  "created_at": "2026-02-04T15:30:00Z",
  "data": {
    "gift_id": "gift_abc123",
    "recipient": {
      "email": "john@example.com",
      "name": "John Doe"
    },
    "gift_type": "choice_card",
    "amount": 100,
    "currency": "USD",
    "category": "coffee",
    "delivered_at": "2026-02-04T15:30:00Z",
    "redemption_url": "https://redeem.ribirewards.com/abc123",
    "expires_at": "2026-05-04T15:30:00Z"
  }
}

Best practices

Return 200 quickly

Process webhooks asynchronously. Return 200 within 5 seconds, then handle the event in a background job.

Handle duplicates

Due to retries, you may receive the same event twice. Use the event ID to prevent duplicate processing.

Monitor failures

Set up alerts for failed webhooks. Check the dashboard for delivery status and retry history.

Use HTTPS

Webhook URLs must use HTTPS. We won't send webhooks to unencrypted endpoints.

Need help setting up webhooks?

Our developer support team can help you integrate webhooks and troubleshoot any issues.

View Full API DocsContact Developer Support
ribirewards logo

Gifting infrastructure for Africa and the Middle East.

For Developers

  • API Documentation
  • Integration Guide
  • Webhooks
  • Sandbox

Reward Types

  • Gift Boxes
  • Choice Cards
  • Experiences
  • Sports Tickets

Resources

  • Blog
  • FAQs
  • Contact Us

Contact

  • hello@ribirewards.com
  • 10+ African Countries

© 2026 RibiRewards. All rights reserved.