# Transactions

ReferralHero supports ongoing transaction tracking, allowing you to reward advocates for transactions completed by their referrals. This is ideal for affiliate programs where commissions are based on recurring or one-time purchases.

{% hint style="info" %}
This feature is only available when your campaign **Goal** is set to **Conversion Event**.
{% endhint %}

### Sending Transaction Data

When a referred subscriber completes a transaction, ReferralHero can automatically reward the advocate based on that transaction. Transaction data can be sent to ReferralHero using any of the following methods:

* **Stripe** (native integration)
* **JavaScript API**
* **REST API**
* **Manual entry** via the dashboard

Each transaction is logged with detailed information, enabling accurate tracking and reward issuance.

### Transaction Log

All successful transactions are recorded in the **Transactions** tab under **Reward Logs**.

Each entry includes:

* **Time**: When the transaction was logged
* **Subscriber**: The person who completed the transaction
* **Type**: Organic or referred
* **Transaction ID**: Stripe Payment ID or one provided via API
* **Transaction Amount**: The total amount of the transaction
* **Product ID** *(optional)*: The ID of the product
* **Reward ID** *(if applicable)*: The ID of the reward that was triggered
* **Reward Value** *(if applicable)*: The value of the reward issued

{% hint style="info" %}
If our Stripe integration is being used, we save the `payment_intent` and  `amount` from the `charge.succeeded` event, which represents the Payment ID and Payment Amount for a Stripe transaction.
{% endhint %}

<div><figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FvnMvzToGseQXczmmgHvc%2FScreenshot%202025-07-25%20at%208.22.23%E2%80%AFPM.png?alt=media&#x26;token=7d5f00f4-f4bb-48a9-a59a-5cfba9575bcc" alt=""><figcaption></figcaption></figure> <figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FJstBXZTqSnAr7TRgXiAV%2FScreenshot%202025-07-25%20at%208.22.46%E2%80%AFPM.png?alt=media&#x26;token=9a1f0dda-94a7-42ab-8308-de3df6867188" alt=""><figcaption></figcaption></figure></div>

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2Fy5prSKSbnqTxOGbomhSZ%2Fimage.png?alt=media&#x26;token=99ae36f0-ba38-4141-9e82-80d4ff32cb4f" alt=""><figcaption></figcaption></figure>

### Setting Up Affiliate Rewards

To configure how and when advocates are rewarded for referred transactions:

**1. Enable Transaction-Based Rewards**

Toggle ON the setting:&#x20;

> Unlock reward on referral transactions\
> Reward the advocate for each transaction by a \[conversion event 1 / 2 / 3] referral.

This determines which referral status qualifies for rewards (e.g., confirmed referrals only).

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FpTiHkakIfH48FN5eEpZt%2Fimage.png?alt=media&#x26;token=9b3daaa9-aae7-4a95-a3d2-ffc0d936734b" alt="" width="563"><figcaption></figcaption></figure>

**2. Define Reward Value**

Choose how the reward is calculated:

* **Fixed amount**: e.g., $10 per transaction
* **Percent of transaction**: e.g., 10% of each transaction
* **Defined in transaction**: Provide a `reward_value` directly via the API

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2Fd92CyP3TfgIIbFesJ7BB%2Fimage.png?alt=media&#x26;token=53483c3b-60a8-4c4e-a677-d79e457de95c" alt="" width="563"><figcaption></figcaption></figure>

**3. Set Reward Duration**

Determine how long rewards should be issued:

* **By number of transactions**: e.g., reward the first 3 purchases
* **By time period**: e.g., reward all transactions within 6 months
* **Maximum total reward value**: Set a cap on the total rewards given per referral

<figure><img src="https://363135598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsuqexOLPOWiUrWg_Ko%2Fuploads%2FcRfpjGjudywZf7UdoN8b%2Fimage.png?alt=media&#x26;token=3e6817ec-a477-4b94-9be9-a3f9a2717dc3" alt="" width="563"><figcaption></figcaption></figure>
