API ReferenceWebhook Events

API Reference: Webhook Events

This document provides a detailed reference for all supported webhook types and their corresponding payloads in Reward plugin.

Overview

Each webhook event represents a specific type of data change or action in Reward. When triggered, the webhook sends a POST request to your configured URL with a JSON payload containing event-specific details.

Webhook Event Fields

All webhook payloads share these common fields:

FieldTypeDescription
idstringUnique identifier for the webhook event.
typestringType of event that occurred (e.g., event.name).
timestringISO 8601 timestamp of when the event occurred.
dataobjectEvent-specific data payload (details below).

Supported Webhook Events

trigger_event.created

Description

Triggered when a new trigger event is created in Reward. Use this event to track or react to specific user actions, like successful payments or completed tasks.

Payload Fields

FieldTypeDescription
data.user.idstringThe unique ID of the user associated with the event.
data.valuenumberThe event value sent with the trigger event.
data.trigger.idstringThe ID of the trigger (e.g., successful_payment).

Payload Structure

{
  "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"
    }
  }
}

balance.credit_points_issued

Description

Triggered when credit pointss are issued to a user. Use this event to update user balances or sync credit points in your application.

Payload Fields

FieldTypeDescription
data.user.idstringThe unique ID of the user receiving the credits.
data.transaction.idstringThe unique ID of the credit transaction.
data.transaction.amountnumberThe amount of credits issued to the user.

Payload Structure

{
  "id": "we_01jf2z4wrwfnw9mhhn2qa80syb",
  "type": "balance.credit_points_issued",
  "time": "2024-12-14T16:13:41.187Z",
  "data": {
    "user": {
      "id": "ca9bb5c2-25a6-43e9-972e-862d28241a47"
    },
    "transaction": {
      "id": "trx_01jf2z4wpgeq0v1zk7ye6zg5aw",
      "amount": 10
    }
  }
}

Changelog

DateChange
2024-12-16Initial version of the webhook events reference.