IntegrationsWebhooks

Webhooks

Overview

Reward webhooks enable you to receive real-time notifications when data changes in Reward. By using webhooks, you can automate processes such as syncing user credits, updating profiles, or triggering workflows in your application.

Getting Started

Creating a Webhook

Follow these steps to set up a webhook in your Reward account:

  1. Go to the Webhooks page under Account Settings.
  2. Click the Create Webhook button.
  3. Enter a name for your webhook.
  4. Specify the URL where you want to receive webhook notifications (supports POST requests only).
  5. Select the events you wish to subscribe to.
  6. Click Create Webhook to save your webhook configuration.

Webhook Events

Reward supports the following webhook events:

Check the API Reference for detailed information on each event.

Webhook Payload

Webhook events send a POST request to your specified URL, containing a JSON payload with the following structure:

Payload Format

FieldTypeDescription
idstringUnique identifier for the webhook event.
typestringEvent type (e.g., trigger_event.created).
timestringISO 8601 timestamp when the event occurred.
dataobjectEvent-specific payload with additional details.

Example Payload

{
  "id": "we_01jf2wkmvcfw6ts1qmgzya291c",
  "type": "trigger_event.created",
  "time": "2024-12-14T15:29:18.821Z",
  "data": {
    "user": {
      "id": "ca9bb5c2-25a6-43e9-972e-862d28241a47"
    },
    "value": 2.99,
    "trigger": {
      "id": "successful_payment"
    }
  }
}

Error Handling

Reward expects your webhook endpoint to return a 2xx HTTP status code to acknowledge successful receipt of the event. If a non-2xx status is returned, Reward will retry the delivery up to 5 times with exponential backoff.

Security Best Practices

To ensure secure and reliable webhook integration:

  • Keep your webhook URL confidential: Avoid sharing your URL to prevent unauthorized access.
  • Use HTTPS: Always use a secure connection (HTTPS) for your webhook endpoint to protect the data in transit.