> ## Documentation Index
> Fetch the complete documentation index at: https://doc.trackrev.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Credit rewards & fulfilment

> Reward partners and referred customers with product credit delivered straight into your own backend — no cash payout.

Instead of paying cash, a **non-cash** programme rewards partners (and optionally the customers
they refer) with **product credit** — free days, AI credits, account balance — delivered
automatically into your own database. This is the model for product-led SaaS referral programmes.

## How credit programmes work

<Steps>
  <Step title="Create a non-cash programme">
    In the programme form, choose **Non-cash rewards** and describe the reward (e.g. *"50 credits
    per referred customer"*).
  </Step>

  <Step title="Define the delivery amounts">
    * **Credit label** — the unit, e.g. `ai_credits` or `free_days`.
    * **Referee bonus** — credit the new signup receives (0 = none).
    * **Free user reward** / **Paid user reward** — what the inviter earns depending on the
      referred user's tier.
  </Step>

  <Step title="Connect a fulfilment backend">
    Credit can only be delivered once you connect a backend (see below). Until then, grants are
    recorded as *earned* but not delivered.
  </Step>
</Steps>

When a referral qualifies, TrackRev writes a **credit grant** (status `earned` → `delivered`, or
`revoked` if refunded or blocked for [self-referral](/affiliate/fraud-detection)). Grants are
idempotent, and refunds revoke them just like cash commissions.

## Fulfilment connectors

Set up delivery under **Configuration → Integrations → "5 · Credit fulfilment"**. Choose a driver
and map where credit lands:

| Connector                 | Notes                                            |
| ------------------------- | ------------------------------------------------ |
| **Supabase**              | Point at a users table + a credit column         |
| **Postgres**              | Direct SQL delivery                              |
| **MongoDB**               | Specify database + collection                    |
| **Airtable**              | Base + table                                     |
| **Webhook**               | Receive a signed event and apply credit yourself |
| **MySQL** / **Firestore** | Coming soon                                      |

Config fields include the users table, the match column (how to find the user), the credit column,
and driver-specific values (database, base ID, webhook). Credentials are encrypted. Use **Test
connection** to confirm it's healthy before going live.

<Info>
  Most non-technical setups use **Supabase** or **Airtable** directly; teams that want full control
  use the **Webhook** driver and apply the credit in their own code.
</Info>

## The Credits dashboard

Open **Affiliate program → Credits** to monitor delivery:

* Stat cards: **Awaiting delivery**, **Delivered**, **Delivery issues**, **Blocked
  (self-referral)**.
* A table of Inviter, Kind, Amount, Status and Earned-at.

## API & webhooks

Credit grants are also available programmatically:

* List grants and balances: [`GET /api/v1/credits`](/developers/endpoints/credits).
* Mark a grant delivered: [`POST /api/v1/credits/{id}/mark-delivered`](/developers/endpoints/credits#mark-a-grant-delivered).
* Subscribe to `credit.earned` and `credit.delivered` [webhooks](/developers/webhooks).

<Card title="Drive referrals from inside your product" icon="code" href="/affiliate/referral-widget">
  The referral widget and API turn every signed-in user into a referrer automatically.
</Card>
