# Welcome

## What is GrowSurf?

[**GrowSurf**](https://growsurf.com) **is referral and affiliate program software** for product and marketing teams that want to embed a referral program into their product without a big engineering lift.

![With GrowSurf, you get a powerful referral engine, out of the box](/files/-LgVY4qX4vsn6iBQ4N7e)

[Click here to download the diagram PDF above](https://hubs.ly/H0mb2xD0).

{% hint style="info" %}
Not a GrowSurf user yet? [Sign up](https://growsurf.com/?ref=docs)
{% endhint %}

## How long does integration take?

GrowSurf can be fully implemented in a few days or less. Many GrowSurf customers get up and running within a day. This includes program setup, referral tracking installation, setting up a referral portal, and automating reward fulfillment.

![](https://d33v4339jhl8k0.cloudfront.net/docs/assets/524448053e3e9bd67a3dc68a/images/52b3179ce4b0a3b4e5ec6393/file-kPc7JvfiR4.png)

{% embed url="<https://youtu.be/RDAKa-fqnLc>" %}

Once you set up your GrowSurf program, you'll be provided with your program-specific integration instructions. You can invite your development team at this step to complete the final steps (see image below).

![You will be provided with step-by-step instructions specific to the program you set up](/files/-MhpKvqXbjzUHUm7tJat)

GrowSurf provides a complete development toolkit ([JS SDK](https://docs.growsurf.com/developer-tools/javascript-sdk), [iOS SDK](https://docs.growsurf.com/developer-tools/ios-sdk), [Android SDK](https://docs.growsurf.com/developer-tools/android-sdk), [REST API](https://docs.growsurf.com/developer-tools/rest-api), [Webhooks](https://docs.growsurf.com/developer-tools/webhooks), [Embeddable Elements](https://docs.growsurf.com/developer-tools/embeddable-elements), [Zapier](https://docs.growsurf.com/automate-rewards/zapier), and third-party integrations).

{% hint style="info" %}
If you're using an AI tool such as Cursor, Claude Code, Antigravity, or Codex to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

On this developer docs site, you'll find helpful guides on how to integrate your referral/affiliate program and automate reward fulfillment -- tutorials and code examples included.

Visit our [Help Center](https://support.growsurf.com/) for additional FAQs and support.

## Next up:

{% content-ref url="/pages/-LfNjtoydjMwcMmMsZD-" %}
[Getting Started for Web](/getting-started)
{% endcontent-ref %}

{% content-ref url="/pages/exdoU1ymhoG3SfIjmIsO" %}
[Getting Started for Native Mobile](/getting-started-for-native-mobile)
{% endcontent-ref %}


# Getting Started for Web

For web integration, start here once you've created your GrowSurf program.

{% hint style="info" %}
**Sandbox/testing environment**

To start building your referral or affiliate program in a "sandbox" environment, we recommend creating two GrowSurf separate programs (one for development and one for production).

A program, also known as campaign, is simply a referral or affiliate program. Every GrowSurf program has a unique ID that you can find in the URL or from the program's GrowSurf Universal Code. [Learn more here](https://support.growsurf.com/article/262-how-can-i-test-in-a-sandbox-or-development-environment).
{% endhint %}

## Step 1: Install the GrowSurf Universal Code onto your site

#### Get the GrowSurf Universal Code.

The *GrowSurf Universal Code* is what allows referrals to be tracked and credited properly.

It's also what powers the GrowSurf window and embeddable elements to be displayed to your participants so that they can get their unique share link, click social share buttons, and check their referral stats and/or the leaderboard.

The GrowSurf Universal Code is a snippet of JavaScript that you paste into the \<HEAD> of your website.

To get your program-specific GrowSurf Universal Code, follow the *Installation* steps in the *Program Editor* until you get to the instructions page (see image below).

![Find your program-specific GrowSurf Universal Code in the Installation step of the Program Editor](/files/-LfJyLczHVfm3nA0KajL)

{% hint style="info" %}
**Note:**

* Your program-specific GrowSurf Universal Code will work on any URL that shares the same origin ([what's same-origin?](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy)) as the *Share URL* or *Signup URL* that you entered in the *Installation* step of the *Program Editor*. [Click here for image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LfUACx31pyQJHxsgdvN%2F-LfUAF1aWVBnBJ5YshXz%2FScreen%20Shot%20on%202019-05-22%20at%2018%3A53%3A26.png?alt=media\&token=0ae62744-aa53-44d8-ab40-2a1d2bae4132)
* If you have *Participant authentication/login* enabled, you may want to set up [*Participant Auto Authentication*](/getting-started/participant-auto-authentication)*.*
* To set up a development process that supports multiple environments (e.g, development, production), [view this article](https://support.growsurf.com/article/262-how-can-i-test-in-a-sandbox-or-development-environment).
  {% endhint %}

## Step 2: Connect integrations or use the GrowSurf API

GrowSurf provides no-code [integrations](https://growsurf.com/integrations/) (such as Stripe, HubSpot, Salesforce) to track when referred leads successfully convert. You can also use our web/mobile SDKs or REST API to integrate with GrowSurf.

| Development Tool                                      | Type        | Description                                                                                                       |
| ----------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
| [**JavaScript SDK**](/developer-tools/javascript-sdk) | Client-side | Open/close the GrowSurf window, generate referral links, track referral attribution.                              |
| [**iOS SDK**](/developer-tools/ios-sdk)               | Client-side | Open/close the GrowSurf window, generate referral links, track referral attribution.                              |
| [**Android SDK**](/developer-tools/android-sdk)       | Client-side | Open/close the GrowSurf window, generate referral links, track referral attribution.                              |
| [**REST API**](/developer-tools/rest-api)             | Server-side | Create new participants, trigger referrals, get program data, and get participant data from a secure environment. |

## Step 3: Automate reward fulfillment

Set up automatic reward fulfillment and data syncing by using an [integration](https://growsurf.com/integrations) or by using [Webhooks](/developer-tools/webhooks).

## Step 4: Open the GrowSurf window

The GrowSurf window is a widget that opens from within your product. It is the central command center for your program participants to share their unique link, send invites, and track the status of their referrals. It is branded, customizable, and available via web and mobile SDKs.

![](https://d33v4339jhl8k0.cloudfront.net/docs/assets/524448053e3e9bd67a3dc68a/images/52b3179ce4b0a3b4e5ec6393/file-kPc7JvfiR4.png)

{% embed url="<https://youtu.be/ESlkP4k0ksc>" %}

***

## Troubleshooting

To troubleshoot common issues during installation, check out [Help Center - Installation](https://support.growsurf.com/category/232-troubleshooting) articles or [contact GrowSurf support](https://app.growsurf.com/settings#contact_support).


# Google Tag Manager

These instructions will show you step-by-step how to install GrowSurf onto Google Tag Manager.

{% hint style="danger" %}
**Important Note:**

A very common issue with using Google Tag Manager is that common adblockers will prevent it from loading in the browser. Please be aware that referrals will not work properly if Google Tag Manager is blocked.
{% endhint %}

**Step 1:** In your Tag Manager console, click 'Add a new tag' (located in the *New Tag* card).

![Add new tag](/files/-LojPTSf-1sRd-BmPWUF)

**Step 2:** In the top input field, rename the tag to 'GrowSurf Universal Code'

![Rename the tag to 'GrowSurf Universal Code'](/files/-LojPZnOvlk4SnpZ8UQk)

**Step 3:** Click the *Tag Configuration* card and a 'Choose tag type' options menu will slide in from the right side. Scroll down and select 'Custom HTML'

![Choose 'Custom HTML' as the tag type](/files/-LojPdsH3fE2IcWg6k7_)

**Step 4:** In the *HTML* section, paste your program-specific [GrowSurf Universal Code](https://docs.growsurf.com/getting-started#get-the-growsurf-universal-code)

![Add your program-specific GrowSurf Universal Code](/files/-LojPlAfaHbnuA2w-Cqc)

**Step 5:** Click the *Triggering* card and then click on 'All Pages' in the *Choose a trigger* menu that slides in from the right (this will load the GrowSurf Universal Code on all pages of your site, which we recommend)

![Select 'All Pages' as the trigger](/files/-LojPstxUtvJsuQdPdcv)

**Step 6:** Click the top-right blue 'Save' button to save the tag

![Click the top-right blue 'Save' button](/files/-LojPy3P8ioct4bmXd8j)

**Step 7:** Click the top-right blue 'Submit' button to save your workspace

![Click the top-right blue 'Submit' button](/files/-LojQ1_4-o5JUtYrlWqN)

## Need help?

Here are some helpful resources:

* [Google Tag Manager Help](https://support.google.com/tagmanager/?hl=en#topic=3441530)
* [GrowSurf Docs - JavaScript Web API](https://docs.growsurf.com/developer-tools/javascript-sdk)


# Participant Auto Authentication

If your program is configured to have participants login/authenticate, you can set up Participant Auto Authentication to automatically log participants into their browser.

## **Set up the client**

**Step 1:** Require participants to login/authenticate within the Program Editor

![](/files/-LzeGapQc_6sLaaE6Y5y)

**Step 2:** Generate a new *Participant Auth Secret*

![](/files/-LzeGw_R8zE4F-YNjnl7)

**Step 3:** Copy your unique *Participant Auth Secret* (to use for later in the [Setting up the server](#set-up-the-server) instructions).

![](/files/-LzeH37ZyvFdqSs4xbLO)

{% hint style="info" %}
Your *Participant Auth Secret* holds privileges, so be sure to keep it secure! Do not share your *Participant Auth Secret* in publicly accessible areas such as GitHub, Bitbucket, client code, etc.
{% endhint %}

**Step 4:** Go to the final instructions page within the Program Editor to copy the new GrowSurf Universal Code.

Once your program has a *Participant Auth Secret,* the installation instructions will be updated and you will need to re-install a newly generated [GrowSurf Universal Code](/getting-started#step-1-install-the-growsurf-universal-code-onto-your-site) snippet.

![](/files/-LzjP_6Io515016gWklX)

This new GrowSurf Universal Code snippet contains a new `window.grsfConfig` Object. Remember to replace two values: (1) set `email` as the participant's email address, and (2) set `hash` as the value you receive from [setting up the server](#set-up-the-server). See the example code block below:

```markup
<script type="text/javascript">
  window.grsfConfig = {
    email: "participant@email.com", // Replace this with the participant's email address
    hash: "HASH_VALUE" // Replace this with the SHA-256 HMAC value
  };

  (function(g,r,s,f){g.growsurf={};g.grsfSettings={campaignId:"k1o87e",version:"2.0.0"};s=r.getElementsByTagName("head")[0];f=r.createElement("script");f.async=1;f.src="http://localhost:3000/static/growsurf.js"+"?v="+g.grsfSettings.version;f.setAttribute("grsf-campaign", g.grsfSettings.campaignId);!g.grsfInit?s.appendChild(f):"";})(window,document);
</script>
```

## Set up the server

On your server, you will need to create a *Hash-based message authentication code* (HMAC).

**Step 1:** Implement SHA-256 HMAC, passing in the following values:

* The *Participant Auth Secret (*&#x66;rom Step 3 of the [Setting up the client](#set-up-the-client) section)
* The participant's email address

Below is an example of the HMAC implementation in Node.js:

{% tabs %}
{% tab title="Node.js" %}

```javascript
require("crypto")
  .createHmac("sha256", "<YOUR_SECRET>")
  .update("participant@email.com")
  .digest("hex");
```

{% endtab %}
{% endtabs %}

## **Testing**

Test your Participant Auto Authentication implementation by going to the URL in which you have installed GrowSurf.

Then load or refresh the page. If successful, you should be authenticated as a participant.

**Below are additional references that may be helpful:**

* JavaScript Web API method [**growsurf.init()**](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#initialize-reinitialize-growsurf)
* [Single Page Applications](https://docs.growsurf.com/developer-tools/javascript-sdk/single-page-applications)


# Getting Started for Native Mobile

For native iOS and Android app integration, start here once you've created your GrowSurf program.

<div align="left"><figure><img src="/files/vGVp8AZN5tbayyFVkxks" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/ZZTs4QzmyOgwxxQvysUo" alt="" width="188"><figcaption></figcaption></figure></div>

## Use cases <a href="#use-cases" id="use-cases"></a>

The GrowSurf mobile SDKs (iOS and Android) cover two primary use-cases:

1. Track referrals to ensure that attribution persists in referral links through app installation so that the referrer receives credit when their referral signs up.
2. Generate referral links for your logged-in users to give them a way to share their referral link and track the status of their referrals and rewards.

***

## How the mobile flow works

1. Enable Mobile SDK access for your GrowSurf program.
2. Install the native SDK.
3. Create a participant token for your logged-in app user by calling the backend [create a mobile participant token](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-mobile-participant-token), pass it to the app, then store it in the SDK. This creates a new participant or returns an existing one.
4. The user clicks a "Refer and Earn" button in the UI, which opens the GrowSurf window via `presentGrowSurfWindow()`. The user's referral link is displayed to them, along with other stats.
5. The user shares their referral link with a friend, who opens the link on their phone. The GrowSurf SDK will preserve referral attribution so that it survives during the journey where the referred friend opens or installs the app. On iOS, surviving a **cold install** (the friend installs the app from the link, then opens it) is *deferred* deep linking and depends on your attribution provider's deferred setup — see [iOS SDK Attribution Providers](/developer-tools/ios-sdk/attribution-providers).
6. When the referred user signs up, they will be added as a new referred participant record when you call `addReferredParticipant()`.

***

## Next steps

Look at the iOS SDK or Android SDK docs for next steps:

{% content-ref url="/pages/UD9v0rnKjJzEapAEkEY8" %}
[iOS SDK (Beta)](/developer-tools/ios-sdk)
{% endcontent-ref %}

{% content-ref url="/pages/upxU6CKkGvjfZGvvKtGW" %}
[Android SDK (Beta)](/developer-tools/android-sdk)
{% endcontent-ref %}


# Build with AI

Use AI agents to create, configure, and verify GrowSurf referral and affiliate programs.

## MCP

[GrowSurf's MCP server](https://github.com/growsurf/growsurf-mcp) lets an AI agent work directly with your GrowSurf programs. It can create a referral or affiliate program, tune the design, inspect email/options defaults, configure rewards, wire webhooks, manage participants, and read analytics.

### What an agent can do

Create entire referral/affiliate programs with a one-shot prompt:

```
Create a GrowSurf referral program for Acme, keep rewards disabled until I approve them, then summarize the Design, Emails, Options, Installation, and Rewards settings.
```

{% hint style="info" %}
New to GrowSurf? OAuth connector clients (ChatGPT, Claude, and other sign-in flows) connect to an existing team, so sign up first if you do not have a GrowSurf account. An agent can also sign up for you: connect it to the onboarding endpoint `https://mcp.growsurf.com/onboard` with no credentials (or use the local server or API-key setup) and have it call `growsurf_create_account`. The returned API key is locked until the team owner's email address is verified. After the owner clicks the verification link, the agent continues with the same API key.
{% endhint %}

***

### Connect the MCP server

You need one of these:

* A GrowSurf account (sign up [here](https://app.growsurf.com/signup) or programmatically via [`/POST Create Account`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-accounts)).
* A GrowSurf API key for local setup or remote clients that do not support GrowSurf sign-in.
* Optional: a default campaign `id`. You can skip this if your agent will create a new campaign first, then pass the returned `id` as `campaignId`.

{% tabs %}
{% tab title="ChatGPT" %}
Add GrowSurf as a developer-mode app (custom connector) in ChatGPT on the web.

1. Open *Settings > Connectors > Advanced* and turn on **Developer mode**. Enterprise workspaces need an admin to allow it.
2. In the *Connectors* tab, select **Create**, name the app **GrowSurf**, and set authentication to OAuth.
3. Use this MCP server URL:

   ```
   https://mcp.growsurf.com/mcp
   ```
4. Optional: add the [GrowSurf logo](https://app.growsurf.com/assets/img/logo/iconmark-blue-padded.png).
5. Finish the OAuth flow, then start a new chat, choose **Developer mode** from the + menu, and enable GrowSurf.

ChatGPT registers its own OAuth client automatically, so you do not paste an API key.
{% endtab %}

{% tab title="Claude.ai" %}
Add GrowSurf as a remote custom connector in Claude on the web.

1. Open *Settings > Connectors*. On Team or Enterprise, an organization owner must first add the connector under *Organization settings > Connectors*.
2. Select **Add custom connector** and name it **GrowSurf**. Organization owners choose *Add > Custom > Web*.
3. Enter this remote MCP server URL:

   ```
   https://mcp.growsurf.com
   ```
4. Select **Add**, then **Connect**, and sign in to GrowSurf to approve the requested access.
   {% endtab %}

{% tab title="Claude Desktop" %}
Claude remote connectors are tied to your Claude account and also work in Claude Desktop.

1. Open *Settings > Connectors* for the same Claude account you use in Claude Desktop.
2. Select **Add custom connector** and name it **GrowSurf**. On Team or Enterprise, an organization owner must add it first.
3. Enter this remote MCP server URL:

   ```
   https://mcp.growsurf.com
   ```
4. Select **Connect**, sign in to GrowSurf, approve access, then enable **GrowSurf** in Claude Desktop.
   {% endtab %}

{% tab title="Claude Code" %}
Recommended: connect Claude Code to GrowSurf's hosted MCP endpoint:

```bash
claude mcp add --transport http --scope user growsurf https://mcp.growsurf.com
```

On first use, Claude Code opens GrowSurf sign-in and consent. You can also start that flow directly:

```bash
claude mcp login growsurf
```

If you prefer local stdio, install the local server directly into Claude Code:

```bash
claude mcp add growsurf \
  -e GROWSURF_API_KEY=YOUR_API_KEY \
  -- npx -y @growsurfteam/growsurf-mcp
```

For a single existing campaign in local stdio, add:

```bash
-e GROWSURF_CAMPAIGN_ID=YOUR_CAMPAIGN_ID
```

Manual API-key fallback for the hosted endpoint:

```bash
claude mcp add --transport http growsurf https://mcp.growsurf.com/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"
```

For a single existing campaign on the manual hosted path, add:

```bash
--header "x-growsurf-campaign-id: YOUR_CAMPAIGN_ID"
```

{% endtab %}

{% tab title="GitHub Copilot" %}
Add GrowSurf as a remote MCP server in VS Code, then use it from Copilot's agent mode.

Run this in your terminal, or open the Command Palette and run *MCP: Add Server > HTTP*:

```bash
code --add-mcp '{"name":"growsurf","type":"http","url":"https://mcp.growsurf.com"}'
```

Open Copilot Chat, switch to **Agent** mode, start GrowSurf, then sign in and approve access when VS Code prompts you.
{% endtab %}

{% tab title="Cursor" %}
Open *Cursor Settings > Tools & Integrations*, select **New MCP Server**, and add a server named `growsurf`.

Recommended: add GrowSurf's hosted MCP endpoint to `mcp.json`:

{% code overflow="wrap" %}

```json
{
  "mcpServers": {
    "growsurf": {
      "url": "https://mcp.growsurf.com"
    }
  }
}
```

{% endcode %}

For API-key auth instead of OAuth, use the manual hosted path:

{% code overflow="wrap" %}

```json
{
  "mcpServers": {
    "growsurf": {
      "url": "https://mcp.growsurf.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

{% endcode %}

If you prefer local stdio, add this to `mcp.json`:

{% code overflow="wrap" %}

```json
{
  "mcpServers": {
    "growsurf": {
      "command": "npx",
      "args": ["-y", "@growsurfteam/growsurf-mcp"],
      "env": {
        "GROWSURF_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

{% endcode %}

**Sign-in window didn't open?** Some Cursor versions never open the GrowSurf sign-in window (a bug in Cursor, not your setup). Replace the `growsurf` entry with this configuration and reconnect. It needs Node.js installed, and opens sign-in in your browser on the first connection:

{% code overflow="wrap" %}

```json
{
  "mcpServers": {
    "growsurf": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.growsurf.com"]
    }
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Codex" %}
Recommended: connect Codex to GrowSurf's hosted MCP endpoint:

```bash
codex mcp add growsurf --url https://mcp.growsurf.com
```

Start GrowSurf sign-in and consent:

```bash
codex mcp login growsurf
```

Or create or edit `~/.codex/config.toml`:

```toml
[mcp_servers.growsurf]
url = "https://mcp.growsurf.com"
```

For API-key auth instead of OAuth, point Codex at the manual hosted path and read the API key from an environment variable:

```toml
[mcp_servers.growsurf]
url = "https://mcp.growsurf.com/mcp"
bearer_token_env_var = "GROWSURF_API_KEY"
```

If you prefer local stdio, create or edit `~/.codex/config.toml`:

```toml
[mcp_servers.growsurf]
command = "npx"
args = ["-y", "@growsurfteam/growsurf-mcp"]

[mcp_servers.growsurf.env]
GROWSURF_API_KEY = "YOUR_API_KEY"
```

Or configure it from the CLI:

```bash
codex mcp add growsurf \
  --env GROWSURF_API_KEY=YOUR_API_KEY \
  -- npx -y @growsurfteam/growsurf-mcp
```

{% endtab %}

{% tab title="Gemini CLI" %}
Connect GrowSurf to Gemini CLI over HTTP:

```bash
gemini mcp add --transport http growsurf https://mcp.growsurf.com
```

Open Gemini CLI, run `/mcp` to check the connection, then finish signing in and approve access in your browser.
{% endtab %}

{% tab title="Windsurf" %}
Add GrowSurf as a remote MCP server in Windsurf's Cascade.

1. Open *Windsurf Settings > Cascade > Manage MCP servers*, then add a custom server.
2. Add a remote server named **GrowSurf** with this URL:

   ```
   https://mcp.growsurf.com
   ```
3. Refresh the server list, then sign in to GrowSurf and approve access.
   {% endtab %}

{% tab title="Cline" %}
Add GrowSurf as a remote MCP server in the Cline extension.

1. In Cline, open the *MCP Servers* panel and choose *Remote Servers*.
2. Add a server named **GrowSurf** with this URL:

   ```
   https://mcp.growsurf.com
   ```
3. Connect, then sign in to GrowSurf and approve access.
   {% endtab %}

{% tab title="Antigravity" %}
Open Antigravity, click the **…** menu, select *MCP Store*, then open *Manage MCP Servers > View raw config*.

Recommended: add GrowSurf's hosted MCP endpoint to `mcp_config.json`. Antigravity uses `serverUrl` for remote MCP servers:

```json
{
  "mcpServers": {
    "growsurf": {
      "serverUrl": "https://mcp.growsurf.com"
    }
  }
}
```

For API-key auth instead of OAuth, use the manual hosted path:

```json
{
  "mcpServers": {
    "growsurf": {
      "serverUrl": "https://mcp.growsurf.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

If you prefer local stdio, add this to `mcp_config.json`:

```json
{
  "mcpServers": {
    "growsurf": {
      "command": "npx",
      "args": ["-y", "@growsurfteam/growsurf-mcp"],
      "env": {
        "GROWSURF_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

{% endtab %}

{% tab title="Other" %}
For any other client that supports remote Streamable HTTP MCP servers with OAuth:

1. Add a remote Streamable HTTP MCP server and name it **GrowSurf**.
2. Use this OAuth-capable server URL:

   ```
   https://mcp.growsurf.com
   ```
3. Start the connection, then sign in to GrowSurf and approve access.

If your client asks for a URL and custom headers instead of GrowSurf sign-in, use `https://mcp.growsurf.com/mcp` with header `Authorization: Bearer YOUR_API_KEY`.
{% endtab %}
{% endtabs %}

#### Hosted Streamable HTTP endpoint

Use hosted OAuth when your MCP client supports remote Streamable HTTP with OAuth:

* URL: `https://mcp.growsurf.com`
* Auth: GrowSurf sign-in and consent.
* API keys: not required for OAuth clients.

Use this option if your MCP client asks for a URL and custom headers instead of opening GrowSurf sign-in:

* URL: `https://mcp.growsurf.com/mcp`
* Required header for API-calling tools: `Authorization: Bearer YOUR_API_KEY`
* Optional header for a default campaign: `x-growsurf-campaign-id: YOUR_CAMPAIGN_ID`

The local server and manual fallback can use the account-bootstrap tool without an API key. OAuth clients use the GrowSurf team you select and approve. Campaign-scoped tools need either a `campaignId` argument or a default campaign header/environment value.

#### Hosted OAuth connector

GrowSurf's hosted MCP endpoint supports OAuth for ChatGPT, Claude.ai, Claude Desktop, Claude Code, GitHub Copilot, Cursor, Codex, Gemini CLI, Windsurf, Cline, Antigravity, and other compatible remote MCP clients. Browser-only clients must support custom remote MCP/OAuth connectors; if yours does not, use a supported coding agent or the local stdio setup.

#### What access you approve

When you sign in through the hosted connector, GrowSurf asks you to approve access before the agent can do anything. The agent can then, on your behalf:

* Read and update the selected team.
* Read, create, and update programs; create, update, or delete their reward configuration and webhooks.
* Read, add, update, and remove participants.
* Record or refund sales and approve commissions or rewards.
* Read analytics.

The hosted MCP server asks only for scopes used by its current tools. It does not request permission to rotate API keys, delete programs, read detailed reward, commission, or payout records, delete issued rewards, or fulfill rewards. API-key rotation is not an MCP action. Rotate a key from GrowSurf Settings or through a direct REST/SDK client whose API key has the `api_key:rotate` scope.

MCP Team tools stay on the team selected during approval.

You can review or revoke a connected client at any time from your GrowSurf account settings.

***

### Example prompts

After you have the MCP installed, view these example prompts for quickly creating a GrowSurf program.

<details>

<summary><strong>Referral programs</strong></summary>

Ask your agent to use the GrowSurf MCP tools:

```
Use GrowSurf to create a referral program for Acme. Review the default Design, Emails, Options, Installation, and Rewards. Keep rewards safe until I approve them. Return the campaign editor URL and summarize the settings.
```

{% hint style="info" %}
The agent should use this order:

1. `growsurf_create_campaign` with `type: "REFERRAL"`.
2. `growsurf_get_campaign`, `growsurf_list_campaign_rewards`, `growsurf_get_campaign_design`, `growsurf_get_campaign_emails`, `growsurf_get_campaign_options`, and `growsurf_get_campaign_installation`.
3. Patch only requested changes with the `growsurf_update_campaign_*` tools.
4. Fetch the updated campaign, Design, Emails, Options, Installation, and Rewards before reporting back.
   {% endhint %}

</details>

<details>

<summary><strong>Affiliate programs</strong></summary>

Affiliate programs can create payable obligations, so have the agent confirm payout and tax settings before launch:

```
Create an affiliate program for Acme in USD. Review commission defaults, payout threshold, tax collection, affiliate portal design, and emails. Do not publish until I approve the money settings.
```

{% hint style="info" %}
The agent should inspect:

* `growsurf_list_campaign_rewards` for commission/reward config.
* `growsurf_get_campaign_options` for approval, payout, and tax settings.
* `growsurf_get_campaign_design` for affiliate portal sections such as commissions, payouts, affiliate summary, and participant settings.
* `growsurf_get_campaign_design`, `growsurf_get_campaign_emails`, and `growsurf_get_campaign_options` for configuration review.
  {% endhint %}

</details>

***

### Agent Skills

GrowSurf also ships an Agent Skill recipe layer with the MCP package. If your agent supports skills, install or copy the [`growsurf-agent-toolkit`](https://github.com/growsurf/growsurf-mcp/tree/main/skills/growsurf-agent-toolkit) skill from the MCP package. It gives the agent a stricter workflow for:

* Creating referral programs.
* Creating affiliate programs.
* Embedding the widget.
* Adjusting rewards.
* Wiring webhooks.
* Reading analytics.

{% hint style="info" %}
MCP prompts are also bundled in the server, so compatible MCP clients can discover the same recipes without a separate skill install.
{% endhint %}

***

### Resources

* [GrowSurf MCP server](https://github.com/growsurf/growsurf-mcp)
* [GrowSurf REST API reference](/developer-tools/rest-api/api-reference)
* [Model Context Protocol](https://modelcontextprotocol.io/introduction)


# Embeddable Elements

Embedded elements are UI elements you can embed into your web app to create a whitelabel referral experience within your own user portal. Referral links are auto-generated for your users.

{% hint style="info" %}
If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

![The Embedded Form and Embedded Invite](/files/X90XaBYt0YmKx0VsgKh5)

## What are embeddable elements?

* Embeddable elements are web elements that you can insert into your own "Refer and Earn" page for a whitelabel look and feel
* Basic styles and content can be updated from the Program Editor
* Embeddable elements can be fully customized using HTML data attributes
* Some embeddable elements have two UI states that will display differently to participants and non-participants
* They are powered by the [GrowSurf JavaScript SDK](https://docs.growsurf.com/developer-tools/javascript-sdk)

{% hint style="warning" %}
**Important Notes:**

* You must have the [GrowSurf Universal Code](/getting-started#get-the-growsurf-universal-code) installed on the same webpage that embeddable elements are on.
* For troubleshooting auth states, please view [this article](https://support.growsurf.com/article/208-why-am-i-seeing-the-no-auth-state-of-the-embedded-form-when-i-am-expecting-to-see-the-auth-state) for more details.
* If you don't see styles applied to embedded elements, please check your browser developer console for errors/warnings. Data attributes must be parsable by the [`JSON.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) function.
  {% endhint %}

***

## (Optional) Forcefully re-rendering embeddable elements

Although embedded elements listen for changes in data attributes and update dynamically, if you run into issues where the embedded elements do not render/refresh, you can force re-rendering. This may be useful if you are working with dynamic data (such as as setting `data-grsf-email` to the user's email in the [Embedded Form](#embedded-form)).

To force re-rendering, call `growsurf.initElements()`, which destroys and recreates all embeddable elements in the DOM.

```javascript
growsurf.initElements();
```

Please make sure to wait for the GrowSurf Universal Code to load by using the `grsfReady` event listener. [See an example here](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener).

{% hint style="info" %}
For single-page applications (SPAs), there may be issues with embeddable elements rendering on the page due to how URL routes are handled. In this case, calling `growsurf.initElements()` may not work and you will need to call [`growsurf.init()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#initialize-reinitialize-growsurf) to re-initialize GrowSurf to make the embeddable elements render.
{% endhint %}

***

## **Embedded Form**

The embedded form will display the participant's unique referral link and social sharing options.

<figure><img src="/files/LEdgg14rqNmckZV9bVgV" alt=""><figcaption><p>Signed-in participants will see their unique referral link and social sharing options.</p></figcaption></figure>

If the participant is not signed in, then the embedded form will display a signup form.

<figure><img src="/files/pa5rgDyHw2itsztOjEgf" alt=""><figcaption><p>Participants who are not signed in will see the signup form</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-form></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see their unique referral link instead of the signup form.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-form
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-form></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-form
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-metadata="{'company': 'Hooli, Inc', 'companySize': 10000}"
 data-grsf-label-style="{'color': '#515151', 'font-size': '10px'}"
 data-grsf-gdpr-paragraph-style="{'color': '#222222', 'font-size': '11px'}"
 data-grsf-gdpr-checkbox-style="{'color': '#222222', 'font-size': '11px'}"
 data-grsf-button-style="{'background-color': '#5890E7', 'color': '#fcfcfc', 'font-family': 'Sans', 'font-size': '12px'}"
 data-grsf-link-style="{'color': '#515151'}"
 data-grsf-field-first-name-label="Your First Name"
 data-grsf-field-first-name-placeholder="Your First Name"
 data-grsf-field-first-name-label="Your Last Name"
 data-grsf-field-first-name-placeholder="Your Last Name"
 data-grsf-social-buttons-layout-theme="3"
 data-grsf-email-button-style="{'background-color': '#5890E7', 'color': '#fcfcfc', 'font-family': 'Arial', 'font-size': '12px'}"
 data-grsf-email-button-text="Share"
 data-grsf-email-button-message="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-email-button-subject="Check this out friend"
 data-grsf-facebook-button-style="{'background-color': '#5890E7', 'font-family': 'Courier New', 'font-size': '12px'}"
 data-grsf-facebook-button-text="Share"
 data-grsf-facebook-button-message="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-twitter-button-style="{'background-color': '#5890E7', 'font-family': 'Arial', 'font-size': '12px'}"
 data-grsf-twitter-button-text="Share"
 data-grsf-twitter-button-message="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-share-instructions="Share this unique link with your friends"
 data-grsf-share-instructions-style="{'padding': '10px'}"
 data-grsf-share-url-input-style="{'border': '1px solid gray'}"
 data-grsf-copy-link-button-layout-theme="3"
 data-grsf-copy-link-button-text="Copy Link"
 data-grsf-copy-link-button-style="{'color': '#fff', 'background': '#000' }"
 data-grsf-copy-link-container-style="{'padding': '10px'}"
 data-grsf-redirect-url="https://replaceme.com">
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                                | Data Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data-grsf-block-form`**                    | N/A       | (Required) This attribute turns any HTML element into an embedded form.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **`data-grsf-email`**                         | String    | (Optional) If provided with a valid email address, a new participant will be created, or an existing participant will be returned — and their unique referral link and social share buttons will be displayed.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **`data-grsf-first-name`**                    | String    | <p>(Optional) If provided with <code>data-grsf-email</code>, then this value will be saved as the new participant's first name property.</p><p>If the participant already exists in the referral campaign, then this attribute will be ignored.</p>                                                                                                                                                                                                                                                                                                                                                                                                         |
| **`data-grsf-last-name`**                     | String    | <p>(Optional) If provided with <code>data-grsf-email</code>, then this value will be saved as the new participant's last name property.</p><p>If the participant already exists in the referral campaign, then this attribute will be ignored.</p>                                                                                                                                                                                                                                                                                                                                                                                                          |
| **`data-grsf-metadata`**                      | Object    | <p>(Optional) If provided with <code>data-grsf-email</code>, then this value will be saved as the new participant's <a href="/pages/-LfZ01vnHVkarKLqPFbR#metadata">metadata</a>.</p><p>If the participant already exists in the referral campaign, then this attribute will be ignored.</p>                                                                                                                                                                                                                                                                                                                                                                 |
| **`data-grsf-gdpr-paragraph-style`**          | Object    | (Optional) Adds inline styles to the GDPR consent paragraph text (if GDPR enabled).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **`data-grsf-gdpr-checkbox-style`**           | Object    | (Optional) Adds inline styles to the GDPR consent checkbox text (if GDPR is enabled).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **`data-grsf-label-style`**                   | Object    | (Optional) Adds inline styles to the form input labels.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **`data-grsf-button-style`**                  | Object    | (Optional) Adds inline styles to any button elements.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **`data-grsf-link-style`**                    | Object    | (Optional) Adds custom styles to any link elements.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **`data-grsf-social-buttons-layout-theme`**   | Number    | <p>(Optional) Set the theme of the social buttons. Choose from the following options:<br><br><code>1</code> - Color buttons with text<br><code>2</code> - Gray buttons with text<br><code>3</code> - Color icons<br><code>4</code> - Gray icons<br><br>Example: <code>data-grsf-social-buttons-layout-theme="2"</code>.</p>                                                                                                                                                                                                                                                                                                                                 |
| **`data-grsf-field-*-label`**                 | String    | <p>(Optional) Sets the label text for the targeted input field.</p><p>Replace <code>\*</code> with one of the following options: <code>email</code>, <code>first-name</code>, <code>last-name</code>, <code>custom-field</code>.</p><p><br><strong>Example:</strong> <code>data-grsf-field-first-name-label</code>.</p><p><br>Custom fields are supported, so if you have an input field called "Phone Number", you would set <code>data-grsf-field-phone-number-label</code> (make sure to follow <a href="https://en.wikipedia.org/wiki/Letter_case#Kebab_case">kebab-case</a>).</p>                                                                      |
| **`data-grsf-field-*-placeholder`**           | String    | <p>(Optional) Sets the placeholder text for the targeted input field.</p><p>Replace <code>\*</code> with one of the following options: <code>email</code>, <code>first-name</code>, <code>last-name</code>, <code>custom-field</code>.</p><p><br><strong>Example:</strong> <code>data-grsf-field-first-name-placeholder</code>.</p><p><br>Custom fields are supported, so if you have an input field called "Phone Number", you would set <code>data-grsf-field-phone-number-placeholder</code> (make sure to follow <a href="https://en.wikipedia.org/wiki/Letter_case#Special_case_styles">kebab-case</a>).</p>                                           |
| **`data-grsf-*-button-style`**                | Object    | <p>(Optional) Adds inline styles to the targeted social share button.</p><p>Replace <code>\*</code> with one of the following options: <code>email</code>, <code>facebook</code>, <code>twitter</code>, <code>threads</code>, <code>bluesky</code>, <code>pinterest</code>, <code>linkedin</code>, <code>sms</code>, <code>messenger</code>, <code>whatsapp</code>, <code>wechat</code>, <code>telegram</code>, <code>reddit</code>, <code>tumblr</code>, <code>qrcode</code>.</p><p><strong>Example:</strong> <code>data-grsf-facebook-button-style</code>.</p>                                                                                            |
| **`data-grsf-*-button-text`**                 | String    | <p>(Optional) Sets the text of the targeted social share button.</p><p>Replace <code>\*</code> with one of the following options: <code>email</code>, <code>facebook</code>, <code>twitter</code>, <code>threads</code>, <code>bluesky</code>, <code>pinterest</code>, <code>linkedin</code>, <code>sms</code>, <code>messenger</code>, <code>whatsapp</code>, <code>wechat</code>, <code>telegram</code>, <code>reddit</code>, <code>tumblr</code>, <code>qrcode</code>.</p><p><strong>Example:</strong> <code>data-grsf-facebook-button-text</code>.</p>                                                                                                  |
| **`data-grsf-*-button-message`**              | String    | <p>(Optional) Sets the pre-populated message of the targeted social share button.<br><br>Replace <code>\*</code> with one of the following options: <code>email</code>, <code>facebook</code>, <code>twitter</code>, <code>pinterest</code>, <code>sms</code>, <code>whatsapp</code>, <code>reddit</code>, <code>tumblr</code>.</p><p><br><strong>Example:</strong> <code>data-grsf-facebook-button-message</code>.<br><br>Include <code>{{shareUrl}}</code> to dynamically set the participant's Share URL within the pre-populated message.<br></p><p>To change the subject line for email messages, set <code>data-grsf-email-button-subject</code>.</p> |
| **`data-grsf-share-instructions`**            | String    | (Optional) Sets the text of the share instructions (these instructions are only visible when the participant is in the auth state).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **`data-grsf-share-instructions-style`**      | Object    | (Optional) Adds inline styles to the share instructions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **`data-grsf-share-url-input-style`**         | Object    | (Optional) Adds inline styles to the Share URL input field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **`data-grsf-copy-link-button-layout-theme`** | Number    | <p>(Optional) Set the theme of the "Copy Link" button. Choose from the following options:<br><br><code>1</code> - Text button<br><code>2</code> - Icon style #1<br><code>3</code> - Icon style #2<br><code>4</code> - Icon style #3<br><br><strong>Example</strong>: <code>data-grsf-copy-link-button-layout-theme="3"</code>.</p>                                                                                                                                                                                                                                                                                                                          |
| **`data-grsf-copy-link-button-text`**         | String    | (Optional) Sets the text of the 'Copy Link' button.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **`data-grsf-copy-link-button-style`**        | Object    | (Optional) Adds inline styles to the 'Copy Link' button.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **`data-grsf-copy-link-container`**           | Object    | (Optional) Adds inline styles to the container of the input box and Copy Link button.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **`data-grsf-redirect-url`**                  | String    | (Optional) Redirects to the given URL upon form submission                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

***

## **Embedded Invite**

The embedded invite is an element that lets a participant send a bulk email invite out to a list of email addresses. It will only be displayed to signed-in participants.

<figure><img src="/files/wLYCzF0HiIYpfbOY3Pds" alt=""><figcaption><p>Only participants who are signed in will see the embedded invite</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-invite></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see the element in the participant ("auth") view.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-invite
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-invite></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-invite
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-instructions-text="Invite your friends/family!"
 data-grsf-instructions-style="{'text-align': 'left'}"
 data-grsf-label-style="{'font-weight': 'bold'}"
 data-grsf-input-style="{'border': '1px solid #D3D3D3'}"
 data-grsf-input-placeholder-text="Enter email addresses here"
 data-grsf-preview-link-text="Preview your message"
 data-grsf-preview-subject-label="Email Subject"
 data-grsf-preview-subject-placeholder="Check this out"
 data-grsf-preview-subject="Check this out"
 data-grsf-preview-subject-style="{'border': '1px solid #D3D3D3'}"
 data-grsf-preview-message-label="Email Message"
 data-grsf-preview-message-placeholder="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-preview-message="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-preview-message-style="{'border': '1px solid #D3D3D3'}"
 data-grsf-link-style="{'color': '#8885E1'}"
 data-grsf-submit-button-text="Send Invite To Friends"
 data-grsf-button-style="{'background-color': '#5890E7', 'text-transform': 'initial', 'font-family': 'Arial', 'color': '#FFFFFF', 'border-radius': '6px' }"
 data-grsf-contact-pill-style="{'background-color': '#8885E1', 'color': '#fff'}"
 data-grsf-google-button-style="{'background-color': '#5890E7', 'font-size': '8px', 'border-radius': '0', 'min-width': '320px', 'font-weight': '100'}"
 data-grsf-google-button-text="Import from Google"
 data-grsf-contact-picker-search-text="Search for contacts"
 data-grsf-contact-picker-suggestions-text="Here are some suggestions"
 data-grsf-contact-picker-results-text="Your search results"
 data-grsf-contact-picker-load-more-button-text="Load More Contacts">
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                                       | Data Type | Description                                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`data-grsf-block-invite`**                         | N/A       | (Required) This attribute turns any HTML element into an embedded invite.                                                                                                                                                                                                                                                                              |
| **`data-grsf-email`**                                | String    | (Optional) The email of the participant to display the invite element for. If the participant does not yet exist within the campaign, they will be newly added.                                                                                                                                                                                        |
| **`data-grsf-instructions-text`**                    | String    | (Optional) Sets the text of the invite instructions.                                                                                                                                                                                                                                                                                                   |
| **`data-grsf-instructions-style`**                   | Object    | (Optional) Adds inline styles to the invite instructions.                                                                                                                                                                                                                                                                                              |
| **`data-grsf-label-style`**                          | Object    | (Optional) Adds inline styles to the form input labels.                                                                                                                                                                                                                                                                                                |
| **`data-grsf-input-style`**                          | Object    | (Optional) Adds inline styles to the email address input field.                                                                                                                                                                                                                                                                                        |
| **`data-grsf-input-placeholder-text`**               | String    | (Optional) Sets the placeholder text of the email address input field.                                                                                                                                                                                                                                                                                 |
| **`data-grsf-preview-link-text`**                    | String    | (Optional) Sets the text of the preview link. If no value is provided, the button text will default to the GrowSurf window invite preview link text.                                                                                                                                                                                                   |
| **`data-grsf-preview-subject-label`**                | String    | (Optional) Sets the label text for the email subject line in the preview section.                                                                                                                                                                                                                                                                      |
| **`data-grsf-preview-subject-placeholder`**          | String    | (Optional) Sets the placeholder text for the email subject line in the preview section.                                                                                                                                                                                                                                                                |
| **`data-grsf-preview-subject`**                      | String    | (Optional) Sets the pre-populated value for the email subject line in the preview section.                                                                                                                                                                                                                                                             |
| **`data-grsf-preview-subject-style`**                | Object    | (Optional) Adds inline styles to the preview subject input field.                                                                                                                                                                                                                                                                                      |
| **`data-grsf-preview-message-label`**                | String    | (Optional) Sets the label text for the email message body in the preview section.                                                                                                                                                                                                                                                                      |
| **`data-grsf-preview-message-placeholder`**          | String    | (Optional) Sets the placeholder text for the email message body in the preview section.                                                                                                                                                                                                                                                                |
| **`data-grsf-preview-message`**                      | String    | <p>(Optional) Sets the pre-populated value for the email message body in the preview section.</p><p>Include <code>{{shareUrl}}</code> to dynamically set the participant's Share URL within the pre-populated message.</p>                                                                                                                             |
| **`data-grsf-preview-message-style`**                | Object    | (Optional) Adds inline styles to the preview message input field.                                                                                                                                                                                                                                                                                      |
| **`data-grsf-link-style`**                           | Object    | (Optional) Adds inline styles to any link elements. If no value is provided, the link styles will inherit from the GrowSurf window link styles.                                                                                                                                                                                                        |
| **`data-grsf-submit-button-text`**                   | String    | (Optional) Sets the text of the submit button. If no value is provided, the button text will default to the GrowSurf window invite submit button text.                                                                                                                                                                                                 |
| **`data-grsf-button-style`**                         | Object    | (Optional) Adds inline styles to any button elements. If no value is provided, the button styles will inherit from the GrowSurf window button styles.                                                                                                                                                                                                  |
| **`data-grsf-contact-pill-style`**                   | Object    | (Optional) Adds custom styles to the contact pills, which appear underneath the email address input field when email addresses have been entered. If no value is provided, the button styles will inherit from the GrowSurf window contact pill styles.                                                                                                |
| **`data-grsf-*-button-style`**                       | Object    | <p>(Optional) Adds inline styles to the targeted address book button. If no value is provided, the button styles will inherit from the GrowSurf window button styles.</p><p>Replace <code>\*</code> with one of the following options: <code>google</code>.</p><p><strong>Example:</strong> <code>data-grsf-google-button-style</code>.</p>            |
| **`data-grsf-*-button-text`**                        | String    | <p>(Optional) Sets the text of the targeted address book button. If no value is provided, the button text will default to the GrowSurf window invite Google Contacts button text.</p><p>Replace <code>\*</code> with one of the following options: <code>google</code>.</p><p><strong>Example:</strong> <code>data-grsf-google-button-text</code>.</p> |
| **`data-grsf-contact-picker-search-text`**           | String    | (Optional) Sets the "Search" text in the contact picker.                                                                                                                                                                                                                                                                                               |
| **`data-grsf-contact-picker-suggestions-text`**      | String    | (Optional) Sets the "Suggestions" text in the contact picker.                                                                                                                                                                                                                                                                                          |
| **`data-grsf-contact-picker-results-text`**          | String    | (Optional) Sets the "Results" text in the contact picker.                                                                                                                                                                                                                                                                                              |
| **`data-grsf-contact-picker-load-more-button-text`** | String    | (Optional) Sets the "Load More" button text in the contact picker.                                                                                                                                                                                                                                                                                     |

***

## Embedded Rewards

<mark style="color:orange;">Referral programs only</mark>

The embedded rewards will display the participant's earned rewards. If the participant's rewards are not approved yet or if they have not yet unlocked any rewards, they will see an empty state. This element will only be displayed to signed-in participants.

<figure><img src="/files/YjYPm0gyr9yFaAyDRf2v" alt=""><figcaption><p>Only participants who are signed in will see the embedded rewards.</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-rewards></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see the element in the participant ("auth") view.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-rewards
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-rewards></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-rewards
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-card-style="{'background-color': '#FDFDFD', 'box-shadow': 'none', 'border-radius': '12px', 'padding': '10px'}"
 data-grsf-title-style="{'font-size': '16px'}"
 data-grsf-horizontal="true"
 data-grsf-horizontal-scroll="true"
 data-grsf-required-referrals-text="Req Refs"
 data-grsf-required-referrals-style="{'background-color': '#117a8b', 'color': '#CCCCCC'}"
 data-grsf-top-referrers-text="Top ambassadors"
 data-grsf-top-referrers-style="{'background-color': '#5890E7', 'color': '#FFFFFF'}"
 data-grsf-reward-limit-text="per winner"
 data-grsf-reward-monthly-limit-text="per sunny month"
 data-grsf-reward-limit-style="{'color': 'black'}"
 data-grsf-progress-icon-style="{'background-color': '#d39e00', 'color': '#000000'}"
 data-grsf-max-progress-icons="6"
 data-grsf-footer-style="{'text-align': 'center', 'color': '#E7B558'}">
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                            | Data Type | Description                                                                                                                                                                                                                                                                                                                      |
| ----------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data-grsf-block-rewards`**             | N/A       | (Required) This attribute turns any HTML element into embedded rewards.                                                                                                                                                                                                                                                          |
| **`data-grsf-email`**                     | String    | (Optional) The email of the participant to display the rewards element for. If the participant does not yet exist within the campaign, they will be newly added.                                                                                                                                                                 |
| **`data-grsf-card-style`**                | Object    | (Optional) Adds custom styles to the reward card(s).                                                                                                                                                                                                                                                                             |
| **`data-grsf-title-style`**               | Object    | (Optional) Adds custom styles to the reward title.                                                                                                                                                                                                                                                                               |
| **`data-grsf-horizontal`**                | Boolean   | (Optional) Displays the rewards in a horizontal format.                                                                                                                                                                                                                                                                          |
| **`data-grsf-horizontal-scroll`**         | Boolean   | (Optional) If `data-grsf-horizontal` is set to `true`, this property will display rewards in a single scrollable row.                                                                                                                                                                                                            |
| **`data-grsf-required-referrals-text`**   | String    | <p>(Optional) Sets the "required referrals" text. This is the text that is used to indicate the number of referrals a participant must make in order to earn the reward.</p><p><strong>NOTE</strong></p><p>This element only displays for non-Leaderboard reward types.</p>                                                      |
| **`data-grsf-required-referrals-style`**  | Object    | (Optional) Adds custom inline styling to the "required referrals" tag displayed for non Leaderboard reward types. This is the element within the reward that is used to indicate the number of referrals a participant must make in order to earn the reward.                                                                    |
| **`data-grsf-top-referrers-text`**        | String    | <p>(Optional) Updates the "top referrers" text displayed for Leaderboard reward types. This is the text that is used to indicate the reward goal for Leaderboard type rewards.</p><p><strong>NOTE</strong></p><p>This element only displays for Leaderboard reward types</p>                                                     |
| **`data-grsf-top-referrers-style`**       | Object    | (Optional) Adds custom styling to the "top referrers" tag. This is the element within the Leaderboard reward that is used to indicate the rank threshold the participant must reach in order to earn the reward.                                                                                                                 |
| **`data-grsf-reward-limit-text`**         | String    | (Optional) Updates the "max per referrer" text displayed within the reward.                                                                                                                                                                                                                                                      |
| **`data-grsf-reward-monthly-limit-text`** | String    | (Optional) Updates the "per month" text displayed within the reward.                                                                                                                                                                                                                                                             |
| **`data-grsf-reward-limit-style`**        | String    | (Optional) Adds inline styling for the "max per referrer" text and/or "per month" text displayed within the reward.                                                                                                                                                                                                              |
| **`data-grsf-progress-icon-style`**       | Object    | <p>(Optional) Updates the inline styling of the progress icon style used to display the progress the participant has made in order to achieve the reward goal.</p><p><strong>NOTE</strong></p><p>Only <code>background-color</code> , <code>color</code>, and <code>display</code> style properties are currently supported.</p> |
| **`data-grsf-max-progress-icons`**        | Number    | (Optional) Updates the max number of progress icons to display.                                                                                                                                                                                                                                                                  |
| **`data-grsf-footer-style`**              | String    | (Optional) Adds inline styles to the footer text messages (e.g, "manual approval" footer tex&#x74;*,* "max rewards shown" footer text).                                                                                                                                                                                          |

***

## Embedded Next Milestone

The embedded next milestone displays how many referrals a participant needs to make to unlock the next/upcoming milestone reward (only applies to milestone rewards).

* In the Campaign Editor, make sure to update your milestone reward's advanced settings to set the *Next Milestone prefix* and *suffix* values.
* If the participant has reached all milestones, then nothing will be rendered.

<figure><img src="/files/-M2djouqQeqszQ9XVc0i" alt=""><figcaption><p>The embedded next milestone has only one UI state (for participants).</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-next-milestone></div>
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

```html
<div data-grsf-block-next-milestone
 data-grsf-milestones="[
  {'goal': 2, 'prefix': 'You are only ', 'suffix': ' referrals away from winning a free t-shirt!', 'monthly': false},
  {'goal': 5, 'prefix': 'You are only ', 'suffix': ' referrals away from winning a free jacket!', 'monthly': false},
  {'goal': 10, 'prefix': 'You are only ', 'suffix': ' referrals away from a free trip to Hawaii!', 'monthly': false}
 ]"
 data-grsf-only-show-number="true"
 data-grsf-email="gavin@hooli.com"></div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                       | Data Type      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`data-grsf-block-next-milestone`** | N/A            | (Required) This attribute turns any HTML element into an embedded next milestone.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **`data-grsf-milestones`**           | Array\<Object> | <p>(Optional) Set this attribute if you want to override your campaign's milestone rewards so that you can define your own milestone rewards as an Array. Each Object should follow this format:</p><ul><li><strong><code>goal</code></strong> (Number) = The number of referrals needed to unlock the milestone reward</li><li><strong><code>prefix</code></strong> (Text) = The text displayed before the <code>goal</code></li><li><strong><code>suffix</code></strong> (Text) = The text displayed after the <code>goal</code></li><li><strong><code>monthly</code></strong> (Boolean) = Set to <code>true</code> to use the participant's monthly referral count (i.e, if the milestone reward resets every month)</li></ul><p>Example: <code>{'goal': 2, 'prefix': 'You are only ', 'suffix': ' referrals away from winning a free shirt!', 'monthly': false}</code></p> |
| **`data-grsf-email`**                | String         | (Optional) The email of the participant to display their next milestone reward to. If the participant does not yet exist within the campaign, they will be newly added.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **`data-grsf-only-show-number`**     | Boolean        | (Optional) If set to `true`, then only the participant's remaining referrals will be displayed as a number (the *prefix* and *suffix* values will be removed).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

***

## Embedded Referral Status

The embedded referral status will display the progress of the participant's referrals. If no one has signed up yet using the participant's unique referral link or if the participant hasn't sent out any email invites, they will see an empty state. This element will only be displayed to signed-in participants.

For email invitees, if they have not yet signed up, their email address will display as obfuscated

<figure><img src="/files/nwOZFrzbHLTLcruuFtVB" alt=""><figcaption><p>Only participants who are signed in will see the embedded referral status.</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-referral-status></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see their unique referral link instead of a signup form.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-referral-status
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-referral-status></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data properties that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-referral-status
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-referral-status-title="Referral Status"
 data-grsf-referral-status-title-style="{'font-weight': '100', 'font-size': '36px'}"
 data-grsf-your-referral-column-text="Your Friend"
 data-grsf-status-column-text="Their Status"
 data-grsf-button-style="{'background-color': '#5890E7', 'color': '#fcfcfc', 'font-size': '12px', 'border-radius': '100%'}"
 data-grsf-header-style="{'display':'none'}"
 data-grsf-list-item-style="{'border-radius': '0', 'padding': '0', 'box-shadow': 'none', 'align-items': 'flex-start'}"
 data-grsf-link-style="{'background-color': '#8885E1', 'color': '#fff'}">
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                              | Data Type | Description                                                                                                                                                              |
| ------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`data-grsf-block-referral-status`**       | N/A       | (Required) This attribute turns any HTML element into an embedded referral status element.                                                                               |
| **`data-grsf-email`**                       | String    | (Optional) The email of the participant to display the referral status element for. If the participant does not yet exist within the campaign, they will be newly added. |
| **`data-grsf-button-style`**                | Object    | (Optional) Adds inline styles to any buttons within the referral status element.                                                                                         |
| **`data-grsf-link-style`**                  | Object    | (Optional) Adds custom styles to any link elements within the embedded referral status element.                                                                          |
| **`data-grsf-referral-status-title`**       | String    | (Optional) Sets the text of the title above the referral status list.                                                                                                    |
| **`data-grsf-referral-status-title-style`** | Object    | (Optional) Adds inline styles to the text of the title above the referral status list.                                                                                   |
| **`data-grsf-status-column-text`**          | String    | (Optional) Sets the text of the *Status* column header.                                                                                                                  |
| **`data-grsf-your-referral-column-text`**   | String    | (Optional) Sets the text of the *Your Referral* column header.                                                                                                           |
| **`data-grsf-header-style`**                | Object    | (Optional) Adds inline styles to the header that is displayed above the referrals list.                                                                                  |
| **`data-grsf-list-item-style`**             | Object    | (Optional) Adds inline styles to the list items that are displayed within the referrals list.                                                                            |

***

## Embedded Referral Summary

<mark style="color:orange;">Referral programs only</mark>

The embedded referral summary will display the participant's relevant referral program stats (referrals, leads, invites sent, expired referrals, clicks, pending rewards, rewards earned). This element will only be displayed to signed-in participants.

<figure><img src="/files/exhXkGqdhmIFosDTjta0" alt=""><figcaption><p>Only participants who are signed in will see the embedded referral summary.</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-referral-summary></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see the element in the participant ("auth") view.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-referral-summary
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-referral-summary></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-referral-summary
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-referral-summary-title="Your Summary"
 data-grsf-referral-summary-title-style="{'font-size': '16px'}">
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                               | Data Type | Description                                                                                                                                                               |
| -------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data-grsf-block-referral-summary`**       | N/A       | (Required) This attribute turns any HTML element into embedded referral summary.                                                                                          |
| **`data-grsf-email`**                        | String    | (Optional) The email of the participant to display the referral summary element for. If the participant does not yet exist within the campaign, they will be newly added. |
| **`data-grsf-referral-summary-title`**       | String    | (Optional) Sets the text of the title above the referral summary.                                                                                                         |
| **`data-grsf-referral-summary-title-style`** | Object    | (Optional) Adds custom styles to the title.                                                                                                                               |

***

## Embedded Affiliate Summary

<mark style="color:orange;">Affiliate programs only</mark>

The embedded affiliate summary will display the participant's relevant affiliate program stats. This element will only be displayed to signed-in participants.

<figure><img src="/files/k7iFrcOmnud2m6XuQFVf" alt=""><figcaption><p>Only participants who are signed in will see the embedded affiliate summary.</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-affiliate-summary></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see the element in the participant ("auth") view.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-affiliate-summary
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-rewards></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-affiliate-summary
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-affiliate-summary-title="Your Summary"
 data-grsf-affiliate-summary-title-style="{'font-size': '16px'}">
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                                | Data Type | Description                                                                                                                                                                |
| --------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data-grsf-block-affiliate-summary`**       | N/A       | (Required) This attribute turns any HTML element into embedded affiliate summary.                                                                                          |
| **`data-grsf-email`**                         | String    | (Optional) The email of the participant to display the affiliate summary element for. If the participant does not yet exist within the campaign, they will be newly added. |
| **`data-grsf-affiliate-summary-title`**       | String    | (Optional) Sets the text of the title above the affiliate summary.                                                                                                         |
| **`data-grsf-affiliate-summary-title-style`** | Object    | (Optional) Adds custom styles to the title.                                                                                                                                |

***

## Embedded Commissions

<mark style="color:orange;">Affiliate programs only</mark>

The embedded commissions will display the participant's list of commissions. This element will only be displayed to signed-in participants.

<figure><img src="/files/LT3N48n9xxbsFfUh3ZvC" alt=""><figcaption><p>Only participants who are signed in will see the embedded commissions.</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-commissions></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see the element in the participant ("auth") view.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-commissions
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-rewards></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-commissions
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-commissions-title="Your Commissions"
 data-grsf-commissions-title-style="{'font-size': '16px'}"
 data-grsf-commissions-commission-column-text="Your Commission"
 data-grsf-commissions-status-column-text="Your Status"
 data-grsf-button-style="{'background-color': 'red', 'font-family': 'Sans'}"
 data-grsf-header-style="{'display':'none'}"
 data-grsf-list-item-style="{'border-radius': '0', 'padding': '0', 'box-shadow': 'none', 'align-items': 'flex-start'}>
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                                     | Data Type | Description                                                                                                                                                          |
| -------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data-grsf-block-commissions`**                  | N/A       | (Required) This attribute turns any HTML element into embedded commissions.                                                                                          |
| **`data-grsf-email`**                              | String    | (Optional) The email of the participant to display the commissions element for. If the participant does not yet exist within the campaign, they will be newly added. |
| **`data-grsf-commissions-title`**                  | String    | (Optional) Sets the text of the title above the commissions.                                                                                                         |
| **`data-grsf-commissions-title-style`**            | Object    | (Optional) Adds custom styles to the title.                                                                                                                          |
| **`data-grsf-commissions-commission-column-text`** | String    | (Optional) Sets the text of the commission column header.                                                                                                            |
| **`data-grsf-commissions-status-column-text`**     | String    | (Optional) Sets the text of the status column header.                                                                                                                |
| **`data-grsf-button-style`**                       | Object    | (Optional) Adds inline styles to the "Load More" button that is displayed if there are more commissions to load.                                                     |
| **`data-grsf-header-style`**                       | Object    | (Optional) Adds inline styles to the header that is displayed above the commissions list.                                                                            |
| **`data-grsf-list-item-style`**                    | Object    | (Optional) Adds inline styles to the list items that are displayed within the commissions list.                                                                      |

***

## Embedded Payouts

<mark style="color:orange;">Affiliate programs only</mark>

The embedded payouts will display the participant's list of payouts. This element will only be displayed to signed-in participants.

<figure><img src="/files/JslkUwtO57rh1fUQCAkK" alt=""><figcaption><p>Only participants who are signed in will see the embedded payouts.</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-payouts></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see the element in the participant ("auth") view.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-payouts
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-rewards></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-payouts
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-payouts-title="Your Payouts"
 data-grsf-payouts-title-style="{'font-size': '16px'}"
 data-grsf-payouts-payout-column-text="Your Payout"
 data-grsf-payouts-status-column-text="Your Status"
 data-grsf-button-style="{'background-color': 'red', 'font-family': 'Sans'}"
 data-grsf-header-style="{'display':'none'}"
 data-grsf-list-item-style="{'border-radius': '0', 'padding': '0', 'box-shadow': 'none', 'align-items': 'flex-start'}>
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                             | Data Type | Description                                                                                                                                                      |
| ------------------------------------------ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data-grsf-block-payouts`**              | N/A       | (Required) This attribute turns any HTML element into embedded payouts.                                                                                          |
| **`data-grsf-email`**                      | String    | (Optional) The email of the participant to display the payouts element for. If the participant does not yet exist within the campaign, they will be newly added. |
| **`data-grsf-payouts-title`**              | String    | (Optional) Sets the text of the title above the payouts.                                                                                                         |
| **`data-grsf-payouts-title-style`**        | Object    | (Optional) Adds custom styles to the title.                                                                                                                      |
| **`data-grsf-payouts-payout-column-text`** | String    | (Optional) Sets the text of the payout column header.                                                                                                            |
| **`data-grsf-payouts-status-column-text`** | String    | (Optional) Sets the text of the status column header.                                                                                                            |
| **`data-grsf-button-style`**               | Object    | (Optional) Adds inline styles to the "Load More" button that is displayed if there are more payouts to load.                                                     |
| **`data-grsf-header-style`**               | Object    | (Optional) Adds inline styles to the header that is displayed above the payouts list.                                                                            |
| **`data-grsf-list-item-style`**            | Object    | (Optional) Adds inline styles to the list items that are displayed within the payouts list.                                                                      |

***

## Embedded Leaderboard

The embedded leaderboard will show a public list of all the participants in ranked order by their number of successful referrals. It will display to both participants and non-participants.

<figure><img src="/files/5Q70nbmtiPpPfom3VhwI" alt=""><figcaption><p>Non-participants will see the public leaderboard</p></figcaption></figure>

<figure><img src="/files/fY4j8TVNumTq2QzKqFyi" alt=""><figcaption><p>When a participant is signed in, they will see the "You" tag next to them</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-leaderboard></div>
```

{% endtab %}

{% tab title="With auth" %}
If you have users logged into your website or web app, you can pass their email address in so that they always see the element in the participant ("auth") view.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-leaderboard
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"></div>
```

**Here is an equivalent JavaScript implementation:**

Here's what you would have in your HTML file:

```html
<div data-grsf-block-leaderboard></div>
```

And here's what you would have in your JavaScript (make sure to use the [`grsfReady`](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener) event listener anytime you call any `growsurf` functions):

```javascript
// Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively.
growsurf.addParticipant({
  email: "gavin@hooli.com",
  firstName: "Gavin",
  lastName: "Belson"
});
```

{% endtab %}

{% tab title="100% customized" %}
This is an example that contains all of the available data attributes that can be customized.

{% hint style="info" %}
**Note:** If you are already setting `data-grsf-email`, `data-grsf-first-name`, or `data-grsf-last-name` on another GrowSurf embedded element, then you do not need to set them here.
{% endhint %}

```html
<!-- Make sure to replace "gavin@hooli.com", "Gavin", and "Belson" with your logged-in user's email address, first name, and last name, respectively. -->
<div data-grsf-block-leaderboard
 data-grsf-email="gavin@hooli.com"
 data-grsf-first-name="Gavin"
 data-grsf-last-name="Belson"
 data-grsf-button-style="{'background-color': 'red', 'font-family': 'Sans'}"
 data-grsf-link-style="{'background-color': 'red', 'color': '#CCCCCC', 'font-family': 'Courier New'}"
 data-grsf-leaderboard-title="Current Standings"
 data-grsf-leaderboard-title-style="{'font-weight': '100', 'font-size': '36px'}"
 data-grsf-rank-column-text="Position"
 data-grsf-participants-column-text="People"
 data-grsf-referrals-column-text="Count"
 data-grsf-winners-icon-style="{'background-color': 'green', 'color': 'CCCCCC'}"
 data-grsf-header-style="{'display':'none'}"
 data-grsf-list-item-style="{'border-radius': '0', 'padding': '0', 'box-shadow': 'none', 'align-items': 'flex-start'}">
</div>
```

{% endtab %}
{% endtabs %}

**Data attributes:**

| HTML Attribute                           | Data Type | Description                                                                                                                                                          |
| ---------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data-grsf-block-leaderboard`**        | N/A       | (Required) This attribute turns any HTML element into an embedded leaderboard.                                                                                       |
| **`data-grsf-email`**                    | String    | (Optional) The email of the participant to display the leaderboard element for. If the participant does not yet exist within the campaign, they will be newly added. |
| **`data-grsf-button-style`**             | Object    | (Optional) Adds inline styles to any buttons within the leaderboard.                                                                                                 |
| **`data-grsf-link-style`**               | Object    | (Optional) Adds custom styles to any link elements within the embedded leaderboard.                                                                                  |
| **`data-grsf-leaderboard-title`**        | String    | (Optional) Sets the text of the title above the leaderboard.                                                                                                         |
| **`data-grsf-leaderboard-title-style`**  | Object    | (Optional) Adds inline styles to the text of the title above the leaderboard.                                                                                        |
| **`data-grsf-rank-column-text`**         | String    | (Optional) Sets the text of the rank column header.                                                                                                                  |
| **`data-grsf-participants-column-text`** | String    | (Optional) Sets the text of the participants column header.                                                                                                          |
| **`data-grsf-winners-icon-style`**       | Object    | (Optional) Adds inline styles to the winner icon that is displayed next to the winner.                                                                               |
| **`data-grsf-header-style`**             | Object    | (Optional) Adds inline styles to the header that is displayed above the leaderboard list.                                                                            |
| **`data-grsf-list-item-style`**          | Object    | (Optional) Adds inline styles to the list items that are displayed within the leaderboard list.                                                                      |

***

## Embedded How It Works

The embedded How It Works will display the How It Works section of your referral/affiliate program. This element will be always be displayed regardless of whether a participant is signed in or not.

<figure><img src="/files/LDcNDJqCegP4HYDMtVsM" alt=""><figcaption><p>The embedded How It Works will display to all participants regardless of whether they are signed in or not</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-how-it-works></div>
```

{% endtab %}
{% endtabs %}

***

## Embedded FAQ

The embedded FAQ will display the FAQ section of your referral/affiliate program. This element will be always be displayed regardless of whether a participant is signed in or not.

<figure><img src="/files/MEKHPUbvJBqTpb55R2jV" alt=""><figcaption><p>The embedded FAQ will display to all participants regardless of whether they are signed in or not</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-faq></div>
```

{% endtab %}
{% endtabs %}

***

## Embedded Terms

The embedded Terms will display the Terms section of your referral/affiliate program. This element will be always be displayed regardless of whether a participant is signed in or not.

<figure><img src="/files/OFqlX86smdvQoj0EIlX8" alt=""><figcaption><p>The embedded Terms will display to all participants regardless of whether they are signed in or not</p></figcaption></figure>

**Example usage:**

{% tabs %}
{% tab title="Basic" %}
This is the bare minimum code required to display this element.

```html
<div data-grsf-block-terms></div>
```

{% endtab %}
{% endtabs %}


# JavaScript SDK

Use the JavaScript SDK to interact with your GrowSurf program and participant data.

{% hint style="info" %}
If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

## Getting Started

### Step 1: Make sure the GrowSurf Universal Code is installed

When you have the [GrowSurf Universal Code](/getting-started#step-1-choose-where-to-install-growsurf) installed on a webpage, that webpage has access to the JavaScript SDK, and you are ready for development. You can test this by entering [`growsurf.open()`](/developer-tools/javascript-sdk/api-reference#open-growsurf-window) in your browser's Developer Console.

The unique program ID from your GrowSurf Universal Code is the program that is the target. [Click here for image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LfU8ACBJhil-h8kFAU6%2F-LfU8CXlMq8GdEnHEwxt%2FScreen%20Shot%20on%202019-05-22%20at%2018%3A43%3A17.png?alt=media\&token=3778b13a-db9b-43d3-bce0-eef707391e8a).

{% hint style="warning" %}
**Testing in development?**

* If you are testing on a development URL (e.g., `http://localhost:3000`), you will need to whitelist that URL in the Installation step of the *Program Editor*. [Click here for image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LfU8FwcsZe9b-yjChHs%2F-LfU8rnazUxtZgHvmI4x%2FScreen%20Shot%20on%202019-05-22%20at%2018%3A47%3A27.png?alt=media\&token=d82bbd8e-bff3-471d-af16-3d9edc45facb).
* We recommend creating two different programs for development and production environments. [Learn more here](https://support.growsurf.com/article/262-how-can-i-test-in-a-sandbox-or-development-environment).
  {% endhint %}

## **`grsfReady` Event Listener**

The GrowSurf Universal Code loads asynchronously. Therefore, if you intend to execute any `growsurf` functions on page load, you must wait until the library has completely loaded.

When loaded successfully, the GrowSurf Universal Code will dispatch a `grsfReady` event, notifying any event listeners that it is ready for use. Only then will any GrowSurf JavaScript SDK functions work.

### Example of using `grsfReady`

```javascript
// Listen and wait for the Growsurf Universal Code to initialize
window.addEventListener('grsfReady', () => {
  console.log('GrowSurf is Ready!');
  // Your code goes here...
});
```

In some cases, the GrowSurf Universal script may already be available and the `grsfReady` event may have already fired. This depends on how long it takes your scripts to load and can happen for various other reasons.\
\
If your `grsfReady`callback isn't being invoked on the`grsfReady` event we recommend you check to see if the `growsurf` script is already available before adding the event listener callback with a conditional like this...

```javascript
// Check to see if GrowSurf is available
if(!window.growsurf) {
  // Listen and wait for the Growsurf Universal Code to initialize
  window.addEventListener('grsfReady', () => {
    console.log('GrowSurf is Ready!');
    // Your code goes here...
  });
} else {
  console.log('GrowSurf is Already Available');
  // Your code goes here...
}
```

If you are executing `growsurf` functions *not* on page load, we recommend you wrap them in a conditional like this...

### Example of using a conditional

```javascript
// Check if the GrowSurf Universal Code is present
if (window.growsurf) {
    // Then, open the GrowSurf window
    growsurf.open();
}
```

## **URL Parameters**

On any webpage where you have GrowSurf installed (including the GrowSurf-hosted referral portal), you can use the `grsf_email` URL parameter to ensure that when someone lands on the page, they see their unique referral link right away instead of a signup form.

For example, when an existing participant lands on `https://grow.surf/abc123?grsf_email=bob@loblaw.com`, they can instantly access their unique referral link without needing to log in. Conversely, if it's a non-existing participant, they will be added to your program as a participant, skipping the signup process and seeing their unique link immediately.

{% hint style="info" %}
**Other tips**:

* Using `grsf_email` is also useful for adding new participants on the fly (i.e., when a person shows high intent to share, they land on your referral portal, and only then are they added to your GrowSurf program).
* Setting `grsf_first_name` and `grsf_last_name` will also set the participant's first name and last name, respectively, if the participant was newly added.
  {% endhint %}

### List of URL Parameters

| **URL Parameter** | **Description**                                                                                                                                                                                   | **Example URL**                                                                                                                                            |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `grsf_email`      | Set this value if you want to automatically add a new participant, or return an existing participant                                                                                              | `https://grow.surf/abc123/grsf_email=bob@loblaw.com`                                                                                                       |
| `grsf_first_name` | (Only applies if `grsf_email` is set) Set this value if you want to add a new participant with a first name                                                                                       | <p><code><https://grow.surf/abc123?grsf_email=bob@loblaw.com></code><br><code>\&grsf\_first\_name=Bob</code></p>                                           |
| `grsf_last_name`  | (Only applies if `grsf_email` is set) Set this value if you want to add a new participant with a last name                                                                                        | <p><code><https://grow.surf/abc123?grsf_email=bob@loblaw.com></code><br><code>\&grsf\_first\_name=Bob</code><br><code>\&grsf\_last\_name=Loblaw</code></p> |
| `grsf`            | (Read-Only) This value represents the referrer's unique GrowSurf ID. You never have to worry about setting this value, as it gets automatically generated in participant's unique referral links. | `https://yoursite.com?grsf=z7o8au`                                                                                                                         |

## **Next Steps**

* [View Tutorials](/developer-tools/javascript-sdk/tutorials)
* [View Embeddable Elements](/developer-tools/embeddable-elements)
* [View Single Page Applications](/developer-tools/javascript-sdk/single-page-applications)
* [View API Reference](/developer-tools/javascript-sdk/api-reference)


# Tutorials

How to implement the GrowSurf JavaScript SDK in common use-case scenarios.

Table of contents

| Scenario                                                                                                                                                                                                          |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Example 1: Trigger a referral on qualifying action (e.g, on conversion, purchase or upgrade)](#example-1-trigger-a-referral-on-qualifying-action-e.g-on-conversion-purchase-or-upgrade)                          |
| [Example 2: Open the GrowSurf window on button click](#example-2-open-growsurf-window-on-button-click)                                                                                                            |
| [Example 3: Display a participant's unique share link and referral count inline on a webpage](#example-3-display-a-participants-unique-share-link-and-referral-count-inline-on-a-webpage)                         |
| [Example 4: Redirect to another URL after a successful participant signup](#example-4-redirect-to-another-url-after-a-successful-participant-signup)                                                              |
| [Example 5: Add a personalized message to your Share URL for a warm welcome](#example-5-add-a-personalized-message-to-your-share-url-for-a-warm-welcome)                                                          |
| [Example 6: Only add a participant if they were referred](#example-6-only-add-a-participant-if-they-were-referred)                                                                                                |
| [Example 7: Hide the GrowSurf Embedded Form until a GrowSurf participant is detected](#example-7-hide-the-growsurf-embedded-form-until-a-growsurf-participant-is-detected)                                        |
| [Example 8: Add internationalization support for the GrowSurf Embedded Form and Embedded Invite](#example-8-add-internationalization-support-for-the-growsurf-embedded-form-and-embedded-invite)                  |
| [Example 9: Update pre-populated share and email invite messages to capitalize on a customer "aha moment"](#example-9-update-pre-populated-share-and-email-invite-messages-to-capitalize-on-a-customer-aha-momen) |
| [Example 10: Load multiple GrowSurf programs on a single webpage](#example-10-load-multiple-growsurf-campaigns-on-a-single-webpage)                                                                               |
| [Example 11: Display a referral link on your login page](#example-11-display-a-referral-link-on-your-login-page)                                                                                                  |
| [Example 12: Display "You came through a referral link!" on your signup page](#example-12-display-you-came-through-a-referral-link-on-your-signup-page)                                                           |

## Example 1: Trigger a referral on qualifying action (e.g, on conversion, purchase, or upgrade)

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add the participant

{% hint style="warning" %}
**Important Note:** If your program is configured to add participants automatically through a form on your website ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), skip this ste&#x70;**.**
{% endhint %}

First, in the code where you capture the referred friend's email address, add them to your GrowSurf program as a participant with [`growsurf.addParticipant()`](/developer-tools/javascript-sdk/api-reference#add-participant). Let's say you have a signup function called `signUpFree()`, here's what that looks like:

{% code title="your-script.js" %}

```javascript
// In this example, a new person is just signing up for a free account
const signUpFree = (user) => {
    // ...code that registers a new user...
    // Then add the new user as a participant in your GrowSurf program
    if (window.growsurf) {
        growsurf.addParticipant({
            email: user.email,
            firstName: user.firstName,
            lastName: user.lastName
        });
    }
};
```

{% endcode %}

{% hint style="info" %}
Behind the scenes, the GrowSurf Universal Code will associate the referrer (if they exist) with the new participant. At any future date [within the referral credit window](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LfTU5fPPuEimujYPBlL%2F-LfTUYdelF4Itf1vXW9T%2FScreen%20Shot%20on%202019-05-22%20at%2015%3A42%3A38.png?alt=media\&token=b1bd5196-2825-4229-b280-0c1240b0b30e), if this new participant triggers a referral, GrowSurf will provide credit to the referrer.
{% endhint %}

### Step 3: Trigger the referral

Then, in the code where the action takes place, trigger the referral with [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral) . Let's say you have a function called upgradeToPaidPlan(), here's what that looks like:

{% code title="your-script.js" %}

```javascript
// In this example, the user upgrades to a paid plan
const upgradeToPaidPlan = (user) => {
    // ...code that upgrades the user...
    // Then trigger this action as a referral trigger
    if (window.growsurf) {
        growsurf.triggerReferral(user.email);
    }
};
```

{% endcode %}

{% hint style="warning" %}
**Important Note:** Make sure your program's referral trigger is set to *Sign Up + Qualifying Action* ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LnvqQyyEju4bLT4R5PC%2F-LnvsusHI0xFY2PJcJzB%2FScreen%20Shot%202019-09-04%20at%206.42.06%20PM.png?alt=media\&token=21db3d41-f20b-4887-833c-8109205cbc89)). If the referral trigger is set to *Sign Up*, triggering referrals will not work since referral credit has already been provided.
{% endhint %}

{% hint style="info" %}

#### **Remember to set up reward fulfillment automation**

Make sure you have [Webhooks](/developer-tools/webhooks) or [Zapier](/integrations/zapier) set up so that rewards automatically get fulfilled to the participant once they reach a reward goal.
{% endhint %}

## Example 2: Open GrowSurf window on button click

The GrowSurf window allows your users to retrieve their referral link to share, as well as track the status of their referrals and rewards. Follow this tutorial to learn how to open the GrowSurf window from an element, such as a button.

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add code

{% tabs %}
{% tab title="Use CSS" %}

#### Add a CSS class to your button

Add the CSS class `growsurf-open-window` to your button element. When the user clicks the button, it will open the GrowSurf window.

```html
<button class="growsurf-open-window">
   Refer and Earn
</button>
```

However, if the user is not logged in as a participant, they will see a signup form instead of their unique referral link. To ensure they always see their referral link, pass their information using the `data-grsf-email`, `data-grsf-first-name` , and `data-grsf-last-name` data attributes.

Here's a code example (remember to replace the values with your logged-in user's details):

```html
<button class="growsurf-open-window"
   data-grsf-email="gavin@hooli.com"
   data-grsf-first-name="Gavin"
   data-grsf-last-name="Belson">
  Refer and Earn
</button>
```

{% endtab %}

{% tab title="Use JavaScript" %}

#### Add `onclick="growsurf.open()"` to your button

Add `onclick="`[`growsurf.open()`](/developer-tools/javascript-sdk/api-reference#open-growsurf-window)`"` to your button to open the GrowSurf window when clicked.

```html
<button onclick="growsurf.open()">
  Refer Friends
</button>
```

Or use JavaScript:

```html
<button id="refer-button">
  Refer Friends
</button>

<script>
  document.getElementById('refer-button').addEventListener('click', function() {
    growsurf.open();
  });
</script>
```

However, when your user opens the GrowSurf window, they will see a signup form instead of their unique referral link unless they are already added as a participant. To ensure they always see their referral link, add or log them in as a participant first by calling [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant).

Here's a code example (remember to replace the values with your logged-in user's details):

```html
<button onclick="growsurf.addParticipant({
               email: 'gavin@hooli.com',
               firstName: 'Gavin',
               lastName: 'Belson'
            });
            growsurf.open();">
  Refer Friends
</button>
```

Or use JavaScript:

```html
<button id="refer-button">
  Refer Friends
</button>

<script>
  document.getElementById('refer-button').addEventListener('click', function() {
    growsurf.addParticipant({
      email: 'gavin@hooli.com',
      firstName: 'Gavin',
      lastName: 'Belson'
    });
    growsurf.open();
  });
</script>
```

{% endtab %}
{% endtabs %}

## Example 3: Display a participant's unique share link and referral count inline on a webpage

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add code

{% tabs %}
{% tab title="Use Embeddable Elements" %}

#### Add the [Embedded Form](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-form) anywhere in your HTML

Just paste `<div data-grsf-block-form></div>` anywhere in your HTML, and the GrowSurf form will appear. If you want your participant to be already logged in and see their unique referral link (instead of the form), add an attribute `data-grsf-email` and set it to the participant's email address.

{% hint style="warning" %}
**Important Note:**

If you have participant authentication enabled for your program, then the participant's unique share link and social buttons will only display if the participant entered your referral/affiliate program from their browser (either through automatic form detection, the GrowSurf form, or the JavaScript SDK). This is because a browser cookie will be saved that identifies the participant. Otherwise, the signup form will be shown, and the participant can click the *login* link to get sent a one-time login email.
{% endhint %}

{% code title="index.html" %}

```html
<!-- Providing just this code will make the GrowSurf form appear -->
<div data-grsf-block-form></div>

<!-- Add a `data-grsf-email` attribute to authenticate the participant -->
<div data-grsf-block-form
 data-grsf-email="gavin@hooli.com">
</div>

<!-- You can also completely customize the Embedded Form, shown in this example -->
<div data-grsf-block-form
 data-grsf-email="gavin@hooli.com"
 data-grsf-button-style="{'background-color': '#5890E7', 'color': '#fcfcfc', 'font-family': 'Sans', 'font-size': '12px'}"
 data-grsf-email-button-style="{'background-color': '#5890E7', 'color': '#fcfcfc', 'font-family': 'Arial', 'font-size': '12px'}"
 data-grsf-email-button-text="Share"
 data-grsf-twitter-button-style="{'background-color': '#5890E7', 'font-family': 'Arial', 'font-size': '12px'}"
 data-grsf-twitter-button-text="Share"
 data-grsf-facebook-button-style="{'background-color': '#5890E7', 'font-family': 'Courier New', 'font-size': '12px'}"
 data-grsf-facebook-button-text="Share"
 data-grsf-pinterest-button-style="{'background-color': '#5890E7', 'letter-spacing': '1.2', 'font-size': '12px'}"
 data-grsf-pinterest-button-text="Pin It"
 data-grsf-share-instructions="Share this unique link with your friends">
</div>
```

{% endcode %}
{% endtab %}

{% tab title="Use JavaScript" %}

#### Call `growsurf.getParticipantByEmail()`

Fetch a participant's information using [`growsurf.getParticipantByEmail()`](/developer-tools/javascript-sdk/api-reference#get-participant-by-email).

Here's an example of retrieving the participant data, then updating the `#share-url` and `#referral-count` HTML elements to show their unique referral link and referral count.

{% code title="index.html" %}

```html
<!DOCTYPE html>
<html>
<head>
	<title>Your Referral Stats</title>
	<!-- The GrowSurf Universal Code -->
	<script type="text/javascript">
		(function(g,r,s,f){g.growsurf={};g.grsfSettings={campaignId:"REPLACE_ME_WITH_YOUR_CAMPAIGN_ID",version:"2.0.0"};s=r.getElementsByTagName("head")[0];f=r.createElement("script");f.async=1;f.src="https://growsurf.com/growsurf.js"+"?v="+g.grsfSettings.version;f.setAttribute("grsf-campaign", g.grsfSettings.campaignId);!g.grsfInit?s.appendChild(f):"";})(window,document);
	</script>
</head>
<body>
	<input id="share-url" type="text" disabled>
	<div id="referral-count"></div>

	<script>
	    // Listen and wait for Growsurf to initialize
	    window.addEventListener('grsfReady', () => {
	        const participantEmail = 'sarah@website.com'; // replace with your user's email
        	// Get the GrowSurf participant's information
		growsurf.getParticipantByEmail(participantEmail).then(participant => {
			document.getElementById("share-url").value = participant.shareUrl;
			document.getElementById("referral-count").innerHTML = participant.referralCount;
		});
	    });
	</script>
</body>
</html>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Example 4: Redirect to another URL after a successful participant signup

This is for when you want to redirect to another webpage after a participant successfully signs up for your referral/affiliate program.

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add code

{% tabs %}
{% tab title="Use Embeddable Elements" %}
If you are using the [Embedded Form](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-form), you can add the following HTML attribute: `data-grsf-redirect-url`.

Remember to replace `https://replaceme.com` with your redirect URL.

```html
<div data-grsf-block-form
 data-grsf-redirect-url="https://replaceme.com">
</div>
```

{% endtab %}

{% tab title="Use JavaScript" %}
If you are using your own form via automatic form detection or JavaScript Web API, then include the following snippet of code within the `<HEAD>` of the HTML source code. This should be the same page(s) where you have included the [GrowSurf Universal Code](https://docs.growsurf.com/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed). Remember to replace `https://replaceme.com` at line 7 with your redirect URL.

```markup
<script>
    // Listen and wait for the Growsurf Universal Code to initialize
    window.addEventListener('grsfReady', () => {
        console.log('GrowSurf is Ready!');
        // Your redirect code goes here....
        growsurf.subscribe('signup', (participant) => {
          window.location.replace("http://replaceme.com");
        });
    });
</script>
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Please note that if the redirect is not working, it is most likely because the form submission is failing. If this is the case, please check your browser console for errors.
{% endhint %}

## Example 5: Add a personalized message to your Share URL for a warm welcome

When a new visitor lands on your site using their friend's unique link, you can personalize a message for them with [`growsurf.getReferrerId()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-referrer-id) and [`growsurf.getParticipantById()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-participant-by-id). In this example, we have a simple page with a `h1#header` that will display as *"Emily S. invited you to pet puppies on-demand"* if a referrer exists, otherwise it will display as *"Pet puppies on-demand"*.

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add code

{% tabs %}
{% tab title="index.html" %}

```html
<html>
	<body>
		<h1 id="header">Pet puppies on-demand</h1>
	</body>
	<script>
		window.addEventListener('grsfReady', () => {
			const referrerId = growsurf.getReferrerId();
			if (referrerId) {
				growsurf.getParticipantById(referrerId).then(participant => {
					if (participant) {
						const { firstName, lastName = '' } = participant;
						const lastNameAsString = (lastName).toString();
						const newHeader = `${firstName && lastName ? firstName + ' ' + lastNameAsString.charAt(0) + '. invited you to pet puppies on-demand' : 'Pet puppies on-demand'}`;
						const headerEl = document.getElementById('header');
						headerEl.innerHTML = newHeader;
					}
				});
			}
		});
	</script>
</html>
```

{% endtab %}
{% endtabs %}

## Example 6: Only add a participant if they were referred

In this example, we will only add a participant if they were referred by another participant within your program. We will use [`growsurf.addReferredParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-referred-participant), which validates the referrer and creates a participant only when the referrer is valid.

The example code also assumes that you have set up a submit listener on your form which will listen for submission events and invoke the callback function described below. If you are not sure how to add a form submission listener [here is an example](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event).

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add code

{% hint style="warning" %}
This code is for demonstration purposes only. You may need to modify it to work on your website.
{% endhint %}

{% tabs %}
{% tab title="index.html" %}

```html
<html>
	<body>
		<h1 id="header">Pet puppies on-demand</h1>
		<!-- Example form only, this must be replaced with your actual form -->
		<form id="form">
	  		<label>Email: <input name="email" type="text"></label>
  			<button type="submit">Submit form</button>
		</form>
	</body>
	<script>
		// Listen for the GrowSurf Ready Event
		window.addEventListener('grsfReady', () => {
			// Add an event listener to the example form to listen for submissions
			const form = document.getElementById('form');
			form.addEventListener('submit', onFormSubmit);
		});

		// Callback function that is invoked when a new visitor has just submitted a form on your website
		const onFormSubmit = (event) => {
		    // Get the value of the email - Update this depending on your form
		    const userEmail = event.target.email.value;
		    // Only add the participant if a valid referrer exists
		    if (window.growsurf) {
		        window.growsurf.addReferredParticipant({ email: userEmail });
		    }
		    event.preventDefault();
		};
	</script>
</html>
```

{% endtab %}
{% endtabs %}

A few things to notice here are the `window.addEventListener` and the `form.addEventListener` snippets of code. The `window.addEventListener` listens for the GrowSurf script `grsfReady` event which is emitted when the [GrowSurf script is ready](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener). Once the GrowSurf script is ready we are adding a `submit` event listener to our form `form.addEventListener` to listen for submission events. **You will need to get the form element using `document.getElementById` using the id of your form for this to work - this is just an example.**\
\
The next piece of code we will look at is the `onFormSubmit` function that is called when our form is submitted. The [addReferredParticipant()](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-referred-participant) function validates the current referrer and only creates a participant when the referrer is valid. **You will need to get the value of the`userEmail` input using the id or name of the input element of your form - this is just an example.**\
\
Please note that this example will attempt referral-only participant creation on all form submissions regardless if the form is valid or not. If you wish to perform some validation before adding the participant that will require some extra coding to do so but is out of scope for this example.

## Example 7: Hide the GrowSurf Embedded Form until a GrowSurf participant is detected

Let's say you are using the [Embedded Form](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-form) and passing an email address as a data attribute so that a participant gets created. Because GrowSurf needs to wait for a network request to finish, the signup form may be shown for a few seconds or less. To change this behavior to hide the signup form, you can use the following HTML, CSS, and JS (jQuery) code as an example below.

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add code

{% tabs %}
{% tab title="HTML" %}

```html
<div data-grsf-block-form
  data-grsf-email="sarah@smith.com"
  class="hide-until-grsf-auth"></div>
```

{% endtab %}

{% tab title="CSS" %}

```css
.show-after-grsf-auth { display: initial }
.hide-until-grsf-auth { display: none }
```

{% endtab %}

{% tab title="JS (jQuery)" %}

```javascript
// Check if a participant is logged-in, and display auth views based on if there is a participant
function showGrsf() {
	var participantAuth = growsurf.getParticipantId();
	if (participantAuth) {
		$('.hide-until-grsf-auth').addClass('show-after-grsf-auth');
	} else {
		// Subscribe to a 'GrowSurf signup' event listener
		growsurf.subscribe('signup', function(participant) {
		  $('.hide-until-grsf-auth').addClass('show-after-grsf-auth');
		});
	}
}

// See if GrowSurf is available
if(!window.growsurf) {
	// Listen and wait for the Growsurf Universal Code to initialize
	window.addEventListener('grsfReady', function() {
		showGrsf();
	});
} else {
	showGrsf();
}
```

{% endtab %}
{% endtabs %}

## Example 8: Add internationalization support for the GrowSurf Embedded Form and embedded invite

In this example, we'll walk through how to use GrowSurf embeddable elements to support multiple languages on your website. We will use the [Embedded Form](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-form) and [Embedded Invite](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-invite) elements, customizing data attributes to display text in both English and Spanish.

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add code

{% tabs %}
{% tab title="Embedded Form" %}
These examples only use `facebook` and `twitter` as the enabled social share buttons. If you have other social share options enabled, make sure to account for them.\
\
These examples also assume that you have a custom signup field called "Phone Number" ([see image](https://gblobscdn.gitbook.com/assets%2F-LeklWo0yn03AhWro2Ux%2F-MZLXwjfm2woyi5XcNvF%2F-MZLYxUjnDT8b5lUVQlO%2Fmain_full.png?alt=media\&token=d328abcb-ca39-46b0-8878-cbbe447198c7)). Custom fields are supported via [kebab-case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles) (see example usage of `phone-number` at lines 6 and 7 in the code snippets below).

**In English:**

```html
<div data-grsf-block-form
 data-grsf-field-first-name-label="First name"
 data-grsf-field-first-name-placeholder="First name"
 data-grsf-field-first-name-label="Last name"
 data-grsf-field-first-name-placeholder="Last name"
 data-grsf-field-phone-number-label="Phone number"
 data-grsf-field-phone-number-placeholder="Phone number"
 data-grsf-share-instructions="Share this unique link with your friends"
 data-grsf-copy-link-button-text="Copy Link"
 data-grsf-email-button-text="Share"
 data-grsf-email-button-message="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-email-button-subject="Check this out friend"
 data-grsf-facebook-button-text="Share"
 data-grsf-facebook-button-message="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-twitter-button-text="Share"
 data-grsf-twitter-button-message="I just saved $X,XXX by using this service! {{shareUrl}}">
</div>
```

**In Spanish:**

```html
<div data-grsf-block-form
 data-grsf-field-first-name-label="Primer nombre"
 data-grsf-field-first-name-placeholder="Primer nombre"
 data-grsf-field-first-name-label="Apellido"
 data-grsf-field-first-name-placeholder="Apellido"
 data-grsf-field-phone-number-label="Número de teléfono"
 data-grsf-field-phone-number-placeholder="Número de teléfono"
 data-grsf-share-instructions="Comparte este enlace único con tus amigos"
 data-grsf-copy-link-button-text="Copiar link"
 data-grsf-email-button-text="Cuota"
 data-grsf-email-button-message="¡Acabo de ahorrar $X,XXX al usar este servicio! {{shareUrl}}"
 data-grsf-email-button-subject="Mira esto amigo"
 data-grsf-facebook-button-text="Cuota"
 data-grsf-facebook-button-message="¡Acabo de ahorrar $X,XXX al usar este servicio! {{shareUrl}}"
 data-grsf-twitter-button-text="Cuota"
 data-grsf-twitter-button-message="¡Acabo de ahorrar $X,XXX al usar este servicio! {{shareUrl}}">
</div>
```

{% endtab %}

{% tab title="Embedded Invite" %}
These examples used `Google` as the enabled address book. If you have other address books enabled, make sure to account for them.

**In English:**

```html
<div data-grsf-block-invite
 data-grsf-input-placeholder-text="Enter email addresses here"
 data-grsf-preview-link-text="Preview your message"
 data-grsf-preview-subject-label="Email Subject"
 data-grsf-preview-subject-placeholder="Check this out friend"
 data-grsf-preview-subject="Check this out friend"
 data-grsf-preview-message-label="Email Message"
 data-grsf-preview-message-placeholder="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-preview-message="I just saved $X,XXX by using this service! {{shareUrl}}"
 data-grsf-submit-button-text="Send Invites"
 data-grsf-google-button-text="Import Google Contacts"
 data-grsf-contact-picker-search-text="Search"
 data-grsf-contact-picker-suggestions-text="Suggestions"
 data-grsf-contact-picker-results-text="Results"
 data-grsf-contact-picker-load-more-button-text="Load More">
</div>
```

**In Spanish:**

```html
<div data-grsf-block-invite
 data-grsf-input-placeholder-text="Ingrese las direcciones de correo electrónico aquí"
 data-grsf-preview-link-text="Vista previa de su mensaje"
 data-grsf-preview-subject-label="Asunto del email"
 data-grsf-preview-subject-placeholder="Mira esto amigo"
 data-grsf-preview-subject="Mira esto amigo"
 data-grsf-preview-message-label="Mensaje de correo electrónico"
 data-grsf-preview-message-placeholder="¡Acabo de ahorrar $X,XXX al usar este servicio! {{shareUrl}}"
 data-grsf-preview-message="¡Acabo de ahorrar $X,XXX al usar este servicio! {{shareUrl}}"
 data-grsf-submit-button-text="Enviar invitaciones"
 data-grsf-google-button-text="Importar contactos de Google"
 data-grsf-contact-picker-search-text="Buscar"
 data-grsf-contact-picker-suggestions-text="Sugerencias"
 data-grsf-contact-picker-results-text="Resultados"
 data-grsf-contact-picker-load-more-button-text="Carga más">
</div>
```

{% endtab %}
{% endtabs %}

## Example 9: Update pre-populated share and email invite messages to capitalize on a customer "aha moment"

If your product has an "[aha moment](https://userguiding.com/blog/what-is-aha-moment-how-to-find-it/)", this is a great time to ask for referrals. On your webpage or web app, display the [Embedded Form](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-form) and [Embedded Invite](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-invite) elements to provoke the participant to share.

In this example, we will use two methods [`growsurf.updateSocialShareMessage()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#update-social-share-message) and [`growsurf.updateEmailInviteMessage()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#update-email-invite-message) to update pre-populated social share messages so that the default text is more relevant to your user.

### [Step 1: Make sure the GrowSurf Universal Code is installed](/developer-tools/javascript-sdk#step-1-make-sure-the-growsurf-universal-code-is-installed)

### Step 2: Add code

To better illustrate this use-case, consider the following scenarios:

{% tabs %}
{% tab title="Social media SaaS" %}
Let's say you're a SaaS company that helps social media users gain more followers. You could ask for referrals once a user gains 100 followers.

Add the following HTML code (e.g, in a popup on your webpage):

```html
<div>
    <h2>💯 Alert!</h2>
    <p>Amazing, you just hit 100 followers this past week.</p>
    <div data-grsf-block-form
         data-grsf-share-instructions="Get your next month on us when you refer a friend"
         data-grsf-copy-link-container-style="{'display': 'none'}"></div>
    <div data-grsf-block-invite></div>
</div>
```

Add the following JavaScript code:

```javascript
// Sign up (or log in) your user as a GrowSurf participant
const userEmail = 'bob@boblaw.com'; // Replace with the user's email address
growsurf.addParticipant({email: userEmail});

// Set the initial message and subject line
const message = "I've just gained 100 followers by using this tool! {{shareUrl}}";
const subjectLine = "Check this out!";

// Update the social share messages
growsurf.updateSocialShareMessage('email', message, subjectLine);
growsurf.updateSocialShareMessage('facebook', message);
growsurf.updateSocialShareMessage('twitter', message);
growsurf.updateSocialShareMessage('pinterest', message);
growsurf.updateSocialShareMessage('sms', message);
growsurf.updateSocialShareMessage('whatsapp', message);

// Update the pre-populated email invite message and subject line
growsurf.updateEmailInviteMessage(message, subjectLine);
```

If you need to call this on immediate page load, wrap the JavaScript code in a [`grsfReady` Event Listener](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener).
{% endtab %}

{% tab title="Enterprise messaging app" %}
Let's say you're a messaging SaaS (e.g, Slack). You could ask for referrals once a team sends 2,000 messages in a workspace.

Add the following HTML code (e.g, in a popup on your webpage):

```html
<div>
    <h2>Woohoo, you've just sent 2,000 messages!</h2>
    <p>That's 6 days worth of time saved in productivity.</p>
    <div data-grsf-block-form
         data-grsf-share-instructions="Share your victory:"
         data-grsf-copy-link-container-style="{'display': 'none'}"></div>
    <div data-grsf-block-invite></div>
</div>
```

Add the following JavaScript code:

```javascript
// Sign up (or log in) your user as a GrowSurf participant
const userEmail = 'bob@boblaw.com'; // Replace with the user's email address
growsurf.addParticipant(userEmail);

// Set the initial message and subject line
const message = "We've just sent 2,000 messages using this service and have saved 6 days of productivity. Love this service! {{shareUrl}}";
const subjectLine = "Check this out!";

// Update the social share messages
growsurf.updateSocialShareMessage('email', message, subjectLine);
growsurf.updateSocialShareMessage('facebook', message);
growsurf.updateSocialShareMessage('twitter', message);
growsurf.updateSocialShareMessage('pinterest', message);
growsurf.updateSocialShareMessage('sms', message);
growsurf.updateSocialShareMessage('whatsapp', message);

// Update the pre-populated email invite message and subject line
growsurf.updateEmailInviteMessage(message, subjectLine);
```

If you need to call this on immediate page load, wrap the JavaScript code in a [`grsfReady` Event Listener](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener).
{% endtab %}

{% tab title="Food delivery service" %}
Let's say you're a food delivery service company (e.g, Doordash). You could ask for referrals once the user leaves a positive review after a delivery.

Add the following HTML code (e.g, in a popup on your webpage):

```html
<div>
    <h2>Loving Doordash?</h2>
    <div data-grsf-block-form
         data-grsf-share-instructions="Get your next meal on us, up to $20 when you refer a friend."
         data-grsf-copy-link-container-style="{'display': 'none'}"></div>
    <div data-grsf-block-invite></div>
</div>
```

Add the following JavaScript code:

```javascript
// Sign up (or log in) your user as a GrowSurf participant
const userEmail = 'bob@boblaw.com'; // Replace with the user's email address
growsurf.addParticipant(userEmail);

// Set the initial message and subject line
const message = "I just ordered delicious Wing's spicy noodle soup with DoorDash. 5/5 experience! Get $20 off your first order: {{shareUrl}}";
const subjectLine = "Check this out!";

// Update the social share messages
growsurf.updateSocialShareMessage('email', message, subjectLine);
growsurf.updateSocialShareMessage('facebook', message);
growsurf.updateSocialShareMessage('twitter', message);
growsurf.updateSocialShareMessage('pinterest', message);
growsurf.updateSocialShareMessage('sms', message);
growsurf.updateSocialShareMessage('whatsapp', message);

// Update the pre-populated email invite message and subject line
growsurf.updateEmailInviteMessage(message, subjectLine);
```

If you need to call this on immediate page load, wrap the JavaScript code in a [`grsfReady` Event Listener](https://docs.growsurf.com/developer-tools/javascript-sdk#grsfready-event-listener).
{% endtab %}
{% endtabs %}

## Example 10: Load multiple GrowSurf programs on a single webpage

If you have multiple GrowSurf programs and want to use the same landing page and/or signup pages, here's how you can load the right program depending on where the traffic is coming from.

### Step 1: Update each Share URL for each of your programs

For each of your programs, navigate to *Program Editor > 5. Installation* and update the Share URL to include a `?growsurf_campaign` parameter.

* Grab the program ID in the address bar of your browser.
* See an example in the image below:

<figure><img src="/files/OX9ao5r0PymzIKKOLZsg" alt=""><figcaption><p>Update your Share URL with a ?growsurf_campaign parameter</p></figcaption></figure>

### Step 2: Paste this code into the \<HEAD> of your website instead of the GrowSurf Universal Code

Instead of pasting the GrowSurf Universal Code into the `<HEAD>` of your webpage(s), add the following code below. Make sure to update the `DEFAULT_GROWSURF_PROGRAM_ID` value at line 3 to your own default program ID.

```html
<script type="text/javascript">
   // Update these parameters
   const DEFAULT_GROWSURF_PROGRAM_ID = 'abc123'; // (Optional) Replace with your default program ID. This will be used as a fallback if provided.

   // Additional configurable parameters
   const GROWSURF_PROGRAM_ID_URL_PARAM = 'growsurf_campaign';
   const GROWSURF_PROGRAM_ID_COOKIE_NAME = 'growsurf_campaign'; // Make it the same name as the URL param for simplicity

    function getBaseDomain() {
      const hostname = window.location.hostname;
      const parts = hostname.split('.');
      if (parts.length > 1) { return '.' + parts.slice(-2).join('.'); }
      return hostname;
   }

   function getQueryParam(name) {
      const urlParams = new URLSearchParams(window.location.search);
      const value = urlParams.get(name);
      if (value && value.includes('?')) {
         return value.split('?')[0];
      }
      return value;
   }

   function setCookie(name, value, days) {
      let expires = "";
      if (days) {
         const date = new Date();
         date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
         expires = "; expires=" + date.toUTCString();
      }
      const domain = getBaseDomain();
      document.cookie = `${name}=${value}; domain=${domain}; path=/;${expires}`;
   }

   function getCookie(name) {
      const nameEQ = `${name}=`;
      const ca = document.cookie.split(';');
      for (let i = 0; i < ca.length; i++) {
         let c = ca[i];
         while (c.charAt(0) === ' ') c = c.substring(1, c.length);
         if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
      }
      return null;
   }

   const growsurfProgramIdInUrlParam = getQueryParam(GROWSURF_PROGRAM_ID_URL_PARAM);
   if (growsurfProgramIdInUrlParam) {
      setCookie(GROWSURF_PROGRAM_ID_COOKIE_NAME, growsurfProgramIdInUrlParam, 365); // Stores program ID in cookie for 365 days
   }
   const growsurfProgramId = getCookie(GROWSURF_PROGRAM_ID_COOKIE_NAME) || DEFAULT_GROWSURF_PROGRAM_ID;
   if (growsurfProgramId) {
      console.log('Loading GrowSurf Universal Code with program ID:', growsurfProgramId);
      // Call the GrowSurf Universal Code
      (function(g,r,s,f){g.grsfSettings={campaignId:growsurfProgramId,version:"2.0.0"};s=r.getElementsByTagName("head")[0];f=r.createElement("script");f.async=1;f.src="https://app.growsurf.com/growsurf.js"+"?v="+g.grsfSettings.version;f.setAttribute("grsf-campaign", g.grsfSettings.campaignId);!g.grsfInit?s.appendChild(f):"";})(window,document);
   }
</script>
```

{% hint style="info" %}
**Here's what this code does:**

* Referral links will now look something like this: `https://mysite.com?growsurf_campaign=abc123&grsf=xyz789` . The program ID is `abc123` and will be saved as a cookie for 365 days. So when a referred friend lands on a referral link, the appropriate program ID will first be loaded. (The referrer ID `xyz789` is also automatically saved as a cookie).
* If that referred friend revisits or returns to your site (e.g, `mysite.com`) even without using a referral link, the appropriate program will still be loaded b/c the program ID was saved as a cookie.
* Once the referred friend signs up, the program that they originally came through a referral link from will be the one they get added to.
* If a website visitor did not use a referral link to land on your website and sign ups, the fallback program `abc123` will be the one used.
  {% endhint %}

## Example 11: Display a Referral Link on Your Login Page

In this tutorial, you'll learn how to display referral links to users on your login page. The typical use-case for this is to remind returning users of your referral/affiliate program and conveniently provide their referral link that they can share.

<figure><img src="/files/GgqelkfpPbPMdzKuqpUF" alt=""><figcaption><p>Display a referral link to returning users on your login page</p></figcaption></figure>

This tutorial uses React, Firebase Authentication, and the GrowSurf JavaScript SDK.

{% hint style="success" %}
**Demo:** To view a working demo and to access the full code, [click here](https://codesandbox.io/p/sandbox/54r4g5).
{% endhint %}

### Step 1: Install GrowSurf in Your React App

The first step is to install the [GrowSurf Universal Code](https://docs.growsurf.com/getting-started#get-the-growsurf-universal-code) by dynamically injecting it into your React app.

Inside your `App.js`, add the following function and use it in a `useEffect`:

```jsx
const GROWSURF_PROGRAM_ID = "x8yi1l" // Replace with your own program ID

const addGrsfScript = () => {
  if (document.querySelector('script[src*="growsurf.js"]')) return;
  const script = document.createElement("script");
  script.src = "https://app.growsurf.com/growsurf.js?v=2.0.0";
  script.setAttribute("grsf-campaign", GROWSURF_PROGRAM_ID);
  script.async = true;
  document.head.appendChild(script);
};

useEffect(() => {
  onAuthStateChanged(auth, (user) => {
    setCurrentUser(user);
  });

  if (document.readyState === "complete") {
    addGrsfScript();
  } else {
    window.addEventListener("load", addGrsfScript);
    return () => window.removeEventListener("load", addGrsfScript);
  }
}, []);
```

{% hint style="danger" %}
**Important**: Make sure to replace `x8yi1l` at line 1 with your own program ID.
{% endhint %}

This ensures GrowSurf loads once when the app starts.

### Step 2: Register Users and Add Them to GrowSurf

For the purpose of this demo, this is the logic that we'll have when a new user registers:

1. Create the user in Firebase
2. Add the user to GrowSurf using [`growsurf.addParticipant()`](/developer-tools/javascript-sdk/api-reference#add-participant)
3. Redirect them to the Profile page

This is what the `register()` function in the `Register.js` file looks like:

```jsx
const register = (e) => {
  e.preventDefault();
  createUserWithEmailAndPassword(auth, email, password)
    .then((userCredential) => {
      const user = userCredential.user;

      // Add user to GrowSurf
      if (window.growsurf?.addParticipant) {
        window.growsurf.addParticipant(user.email);
      }
      navigate("/"); // Redirect to profile
    })
    .catch((err) => setError(err.message));
};

```

### Step 3: Display Profile Page After Login/Registration

In the `Profile.js` file, we'll show the user’s email and display a Logout button:

```jsx
<h2>Welcome, {currentUser.email}</h2>
<button onClick={logout}>Logout</button>
```

When the user logs out, they’re redirected back to the Login page.

### **Step 4:** Login and Validate the GrowSurf Participant

When a user logs in, we'll have the following logic be executed:

1. After a successful Firebase login, check if the user exists in your GrowSurf program using [`growsurf.getParticipantByEmail(email)`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-participant-by-email).
2. If the user exists in the program, call [`growsurf.addParticipant(email)`](/developer-tools/javascript-sdk/api-reference#add-participant) to log them in as a GrowSurf participant.

Here's what we have in the `Login.js` file:

```jsx
const login = (e) => {
  e.preventDefault();
  setError("");

  signInWithEmailAndPassword(auth, email, password)
    .then(() => {
      if (window.growsurf?.getParticipantByEmail) {
        window.growsurf.getParticipantByEmail(email, (participant) => {
          if (participant) {
            // Initialize GrowSurf participant session
            window.growsurf.addParticipant(email, () => {
              localStorage.setItem("hasLoggedIn", "true");
              setShowReferral(true);
              navigate("/");
            });
          }
        });
      } else {
        setError("GrowSurf is not ready. Please try again shortly.");
      }
    })
    .catch((err) => setError(err.message));
};
```

### Step 5: Show the Referral Widget (Only After Logout)

After tracking the user login state, we can now conditionally display the [GrowSurf Embedded Form](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-form) (aka the referral link) on the Login page — but only after logout.

```jsx
{showReferral && (
  <div className="referral-sidebar">
    <div
      data-grsf-block-form
      data-grsf-share-instructions="<h3 style='text-align: center;'>Refer a friend</h3>"
      data-grsf-social-buttons-layout-theme="3"
      data-grsf-copy-link-button-layout-theme="3"
    ></div>
  </div>
)}

```

{% hint style="info" %}
**Important note on authentication:**\
This tutorial focuses on integrating GrowSurf referral tracking in a React app using Firebase for authentication. However, the same concepts apply no matter what auth system you’re using (Supabase, Auth0, a custom backend, etc).

For simplicity, the tutorial assumes that returning users already exist in both your authentication system and your GrowSurf program.

This tutorial doesn’t cover all security details, and you'll want to adapt the logic to fit your own authentication flow and app structure.
{% endhint %}

## Example 12: Display "You came through a referral link!" on Your Signup Page

In this tutorial, you'll learn how to display a message like “You came through a referral link!” on your signup page using the GrowSurf JavaScript SDK using the following two methods:

* [`growsurf.getReferrerId()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-referrer-id) to fetch the referrer ID (aka the referral code)
* [`growsurf.getCampaign()`](/developer-tools/javascript-sdk/api-reference#get-campaign) to fetch custom reward metadata (for displaying the `50` in "$50 discount will automatically be applied to your account.")
* [`growsurf.addReferredParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-referred-participant) to add new referred signups

The use-case for this scenario is for verifying to referred visitors that they came through a referral link.

<figure><img src="/files/X24ggAXpVPVXT9mSNXaL" alt=""><figcaption><p>Display "You came through a referral link!" on your signup page</p></figcaption></figure>

This tutorial uses React, Firebase Authentication, and the GrowSurf JavaScript SDK.

{% hint style="success" %}
**Demo:**

* To view a working demo, [click here](https://dgxz4y.csb.app/?grsf=ay7rx1) and navigate to the signup page.
* To access the full code, [click here](https://codesandbox.io/p/sandbox/dgxz4y).
  {% endhint %}

From this tutorial, the following can be assumed:

* The GrowSurf Universal Code will be dynamically injected in `App.js`
* User authentication is via Firebase Auth and Firebase Realtime Database
* `growsurf.addReferredParticipant(email)` will be called after user signup to track referrals
* The login state is managed using a custom `AuthContext.js`

### Step 1: Install GrowSurf in Your React App

The first step is to install the [GrowSurf Universal Code](https://docs.growsurf.com/getting-started#get-the-growsurf-universal-code) by dynamically injecting it into your React app.

Inside your `App.js`, add the following function and use it in a `useEffect`:

```jsx
const GROWSURF_PROGRAM_ID = "x8yi1l" // Replace with your own program ID

const addGrsfScript = () => {
  if (document.querySelector('script[src*="growsurf.js"]')) return;
  const script = document.createElement("script");
  script.src = "https://app.growsurf.com/growsurf.js?v=2.0.0";
  script.setAttribute("grsf-campaign", GROWSURF_PROGRAM_ID);
  script.async = true;
  document.head.appendChild(script);
};

useEffect(() => {
  onAuthStateChanged(auth, (user) => {
    setCurrentUser(user);
  });

  if (document.readyState === "complete") {
    addGrsfScript();
  } else {
    window.addEventListener("load", addGrsfScript);
    return () => window.removeEventListener("load", addGrsfScript);
  }
}, []);
```

{% hint style="danger" %}
**Important**: Make sure to replace `x8yi1l` at line 1 with your own program ID.
{% endhint %}

This ensures GrowSurf loads once when the app starts.

### Step 2: Get the `referralId` and show the referral message on the registration page

Now switch to `Register.js`. Inside a `useEffect`, check if a referral ID is stored by calling [`growsurf.getReferrerId()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-referrer-id).

If there is a referrer ID, then show a banner that says "You came through a referral link! $50 discount will automatically be applied to your account." Get the `50` by fetching the reward amount from your GrowSurf program's reward metadata by calling [`growsurf.getCampaign()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-campaign):

```jsx
useEffect(() => {
  if (window.growsurf?.getReferrerId) {
    const referrerId = window.growsurf.getReferrerId();

    if (referrerId) {
      setShowReferralBanner(true);

      if (window.growsurf?.getCampaign) {
        window.growsurf.getCampaign((campaign) => {
          const reward = campaign?.rewards?.[0];
          const rewardValue = reward?.metadata?.rewardForReferred;

          if (rewardValue !== undefined) {
            setRewardAmount(rewardValue);
          }
        });
      }
    }
  }
}, []);
```

This code does two things:

1. Shows a referral banner only if a referrer ID is stored. The `growsurf.getReferrerId()` method checks if there is a referral cookie stored (which would be present if the visitor initially came from a referral link).
2. Uses `growsurf.getCampaign()` to fetch the metadata of your program's first reward. Note, you'll need to have [set the reward metadata](https://docs.growsurf.com/developer-tools/metadata#reward-metadata-1).

Then render the message inside your JSX:

```jsx
{showReferralBanner && rewardAmount !== null && rewardAmount !== undefined && (
  <div style={{
    backgroundColor: "#fff3cd",
    padding: "12px",
    borderRadius: "6px",
    marginBottom: "15px",
    border: "1px solid #ffeeba",
    color: "#856404",
    fontWeight: "bold",
  }}>
    You came through a referral link! <strong>${rewardAmount} discount</strong> will automatically be applied to your account.
  </div>
)}
```

### **Step 4:** Register Users and Add Them to GrowSurf

When a new user signs up, you’re already registering them with Firebase Auth. After that, use [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant) to add them to your GrowSurf program:

```jsx
if (response?.user?.email) {
  window.growsurf.addParticipant(response.user.email, () => {
    // Mark that this user is part of GrowSurf
    localStorage.setItem("isGrowSurfParticipant", "true");
  });
}
```

{% hint style="warning" %}
**Important note on applying the $50 discount upfront:**

This tutorial does not cover how to apply the $50 discount the new user who just signed up. To view how to apply the actual discount, [view this article](https://support.growsurf.com/article/280-how-can-i-have-a-coupon-code-instantly-available-for-a-referred-person-before-they-sign-up).
{% endhint %}


# Single Page Applications

View sample code and troubleshooting tips for integrating GrowSurf into common JavaScript frameworks such as React and Vue.

{% hint style="info" %}
To test in a sandbox/development environment, we recommend creating two different programs for development and production environments. [Learn more here](https://support.growsurf.com/article/262-how-can-i-test-in-a-sandbox-or-development-environment).

Due to the asynchronous behavior of SPAs, if the GrowSurf Universal Code has already been added you may need to re-initialize GrowSurf at times. For example, if embeddable elements are not being displayed, call [growsurf.init()](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#initialize-reinitialize-growsurf).
{% endhint %}

## GitHub

[Check out the `growsurf-samples` GitHub repo for sample code](https://github.com/growsurf/growsurf-samples).

## React

Check out the GitHub sample code for React [here](https://github.com/growsurf/growsurf-samples/tree/master/samples/growsurf-react-example) and our [GrowSurf React project](https://github.com/growsurf/growsurf-react-firebase).

### React Component

To initialize GrowSurf asynchronously within your SPA, simply include the following code within your [React components `componentDidMount()`](https://reactjs.org/docs/react-component.html#componentdidmount)lifecycle event.

{% hint style="info" %}
IMPORTANT: `componentDidMount()`is a lifecycle method for class components and cannot be used in functional components. If you want to initialize GrowSurf using a functional component you will need to use the [Effect Hook](https://reactjs.org/docs/hooks-effect.html).
{% endhint %}

### Example using Classes

This snippet of code will only add the GrowSurf Universal Code when a visitor is brought to a page within your site that includes the component with this code. Once the script has been added successfully and [initialized](/developer-tools/javascript-sdk#grsfready-event-listener), you will then have the ability to add any [GrowSurf embeddable element](/developer-tools/embeddable-elements)(s) you would like within your components JSX.

{% code title="App.js" %}

```jsx
 class App extends React.Component {
   componentDidMount() {
    const script = document.createElement('script');
    script.src = 'https://app.growsurf.com/growsurf.js?v=2.0.0';
    script.setAttribute('grsf-campaign', 'jaoh4t');
    script.async = true;
    document.head.appendChild(script);
  }

  render() {
  return (
    <div>
      <div className='App'>REACT + GROWSURF</div>
      <div data-grsf-block-form></div>
    </div>
    )
  }
  }
```

{% endcode %}

### Example using Effect Hook

{% code title="App.js" %}

```jsx
  import {useEffect} from 'react'

  function App() {
    // GrowSurf Universal Code
    const addGrsfScript = () => {
      const script = document.createElement('script');
      script.src = 'https://app.growsurf.com/growsurf.js?v=2.0.0';
      script.setAttribute('grsf-campaign', 'jaoh4t');
      script.async = true;
      document.head.appendChild(script);
  };

    useEffect(() => {
    addGrsfScript();
    }, [])
  }
```

{% endcode %}

{% hint style="info" %}
In React, third-party JavaScript SDKs like GrowSurf's are not automatically accessible within the Virtual DOM. To interact with them, you must reference them via the `window` object.\
\
**Example**

```javascript
window.growsurf.getParticipantId();
```

{% endhint %}

## Vue

[Check out the GitHub sample code for Vue here](https://github.com/growsurf/growsurf-samples/tree/master/samples/growsurf-vue-example).

## Troubleshooting

If you experience issues with embeddable elements rendering on the page (depending on how URL routes are handled in your SPA, this behavior will typically be seen when you refresh the webpage with the absolute route) you will need to call [`growsurf.init()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#initialize-reinitialize-growsurf)to re-initialize GrowSurf to make the embeddable elements render.


# API Reference

This reference documents the GrowSurf JavaScript SDK, including all available public methods and examples of each.

{% hint style="info" %}
If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

Use this page to look up individual GrowSurf JavaScript SDK methods. All asynchronous methods support both callback and Promise styles unless otherwise noted.

## SDK LIFECYCLE ↓

### Initialize / Reinitialize GrowSurf

Initializes or reinitializes the `window.growsurf` Object.

{% hint style="info" %}
The method is useful for the following use-cases:

* If you have participant authentication enabled for your program and you would like to [automatically authenticate](/getting-started/participant-auto-authentication) your participants after they log in within your own user portal.
* Load multiple programs on a single webpage depending on where the traffic is coming from. [View a tutorial here](https://docs.growsurf.com/developer-tools/javascript-sdk/tutorials#example-10-load-multiple-growsurf-campaigns-on-a-single-webpage).
  {% endhint %}

```javascript
growsurf.init(settings);
```

**Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
growsurf.init({ email: "participant@email.com", hash: "HASH_VALUE" }, () => {
    // GrowSurf is Ready
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a promise
growsurf.init({ email: "participant@email.com", hash: "HASH_VALUE" }).then(() => {
    // GrowSurf is Ready
});
```

{% endtab %}
{% endtabs %}

| Parameter      | Data Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| -------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`settings`** | Object    | <p>(Optional) The settings GrowSurf should use when initializing or reinitializing.</p><ul><li><strong><code>campaignId</code></strong>- Provide this to initialize another program</li><li><strong><code>email</code>-</strong> The email of the participant you wish to <a href="/pages/-LzeET4Tt-MT4IzQ7haT">auto authenticate</a> (only applies if authentication is enabled for your program).</li><li><strong><code>hash</code></strong>- The hash token generated by your server. Used to <a href="/pages/-LzeET4Tt-MT4IzQ7haT">auto authenticate</a> a participant (only applies if authentication is enabled for your program).</li></ul> |

***

### Get participant ID

Returns the ID of the authenticated participant or **`null`** if there is no participant authentication cookie present.

{% hint style="info" %}
**Example:** Someone signed up as a participant in your referral/affiliate program from your website. Calling this method will return `aj7auu1` (which is the participant ID).
{% endhint %}

```javascript
growsurf.getParticipantId();
```

#### **Example use**

```javascript
growsurf.getParticipantId();
```

**Example response**

```javascript
"aj7auu1"
```

***

### Log out

Logs the participant out of the browser (clears the participant's GrowSurf browser cookie and local storage).

```javascript
growsurf.logout();
```

#### **Example use**

```javascript
growsurf.logout();
```

***

## CAMPAIGNS ↓

### Get campaign

Retrieves limited details of a campaign.

```javascript
growsurf.getCampaign(callback);
```

| Parameter      | Data Type | Description                                                                 |
| -------------- | --------- | --------------------------------------------------------------------------- |
| **`callback`** | Function  | (Optional) A callback function that will be invoked with the campaign data. |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)containing limited campaign data of `id` and `rewards`.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
growsurf.getCampaign((campaign) => {
    // Handle Campaign
    console.log(campaign);
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise
growsurf.getCampaign().then(campaign =>  {
    // Handle Campaign
    console.log(campaign);
});
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
    "id": "bpsxg4",
    "type": "REFERRAL",
    "rewards": [
        {
            "id": "crew_xyz789",
            "type": "DOUBLE_SIDED",
            "description": "Refer a friend and get $20",
            "referralDescription": "Sign up and get $10 off your first invoice",
            "referredRewardUpfront": false,
            "isUnlimited": false,
            "limit": 1,
            "conversionsRequired": 1,
            "numberOfWinners": 3,
            "imageUrl": "https://example.com/reward-image.png",
            "metadata": {
                "rewardValueForReferrer": 20,
                "rewardValueForReferred": 10
            },

            // Only for affiliate programs:
            "commissionStructure": {
                "amount": null,
                "event": "SALE",
                "type": "PERCENT",
                "minPaidReferrals": 3,
                "holdDuration": 30,
                "duration": "FOREVER",
                "durationInMonths": 12,
                "approvalRequired": false,
                "percent": 50,
                "hasMaxAmount": false,
                "maxAmount": null,
                "maxAmountISO": "USD",
                "hasIntro": false,
                "introType": null,
                "introPercent": null,
                "introAmount": null,
                "introAmountISO": "USD",
                "introDuration": "REPEATING",
                "introDurationInMonths": 2
            }
        }
    ]
}
```

***

## GROWSURF WINDOW ↓

### Open GrowSurf window

Opens the GrowSurf window.

```javascript
growsurf.open(callback);
```

| **Parameter**  | Data Type | Description                                                       |
| -------------- | --------- | ----------------------------------------------------------------- |
| **`callback`** | Function  | (Optional) A callback function that will be invoked once complete |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves once complete.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
growsurf.open(function() {
    // Do something here
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise
growsurf.open().then(() => {
    // Do something here
});
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}

#### **CSS Alternative:**

Instead of using the JavaScript method `growsurf.open()`, you can simply add a CSS class `growsurf-open-window` to a button.

A benefit of this option is that if the participant has any unread rewards, the unread badge will automatically show up as well.\
\
**Here is an example:**

```html
<a class="growsurf-open-window">
  Refer and Earn
</a>
```

**Note:** You'll need to make sure you have the [GrowSurf Universal Code](https://docs.growsurf.com/getting-started#get-the-growsurf-universal-code) installed.
{% endhint %}

***

### Close GrowSurf window

Closes the GrowSurf window.

```javascript
growsurf.close(callback);
```

| **Parameter**  | Data Type | Description                                                       |
| -------------- | --------- | ----------------------------------------------------------------- |
| **`callback`** | Function  | (Optional) A callback function that will be invoked once complete |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves once complete.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
growsurf.close(() => {
    // Do something here
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise
growsurf.close().then(() => {
    // Do something here
});
```

{% endtab %}
{% endtabs %}

***

## ATTRIBUTION ↓

### Get referrer ID

Returns the ID of the participant that referred the visitor or **`null`** if the visitor was not referred. This method will first check to see if a `grsf` URL parameter exists, then will check for the presence of a referrer ID as a browser cookie (which was set from the initial visit).

{% hint style="info" %}
**Example:** If someone refers their friend, and the friend visits `https://yoursite.com?grsf=1h97da`, calling this method will return `1h97da` (which is the referrer ID).
{% endhint %}

```javascript
growsurf.getReferrerId();
```

#### **Example use**

```javascript
growsurf.getReferrerId();
```

#### Example response

```javascript
"1h97da"
```

{% hint style="info" %}
**Note:** You can verify that the referrer ID is valid by calling [`growsurf.validateReferrer()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#validate-referrer).
{% endhint %}

***

### Validate referrer

Checks whether a referrer (participant) exists in the campaign. Returns `true` if the referrer exists, `false` otherwise. Unlike [`getParticipantById()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-participant-by-id), this method does **not** require participant authentication and does **not** return any participant data.

{% hint style="info" %}
**When to use this:** Use `validateReferrer()` when you need to confirm that a referral link is valid or to check if a participant exists. If you want to add a referred signup only when the referrer is valid, use [`addReferredParticipant()`](#add-referred-participant).
{% endhint %}

```javascript
growsurf.validateReferrer(referrerId, callback);
```

| Parameter        | Data Type | Description                                                                                                                                             |
| ---------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`referrerId`** | String    | (Optional) The GrowSurf referrer ID to validate. If omitted, the referrer ID is automatically resolved from the `grsf` URL parameter or browser cookie. |
| **`callback`**   | Function  | (Optional) A callback function that will be invoked with `true` if the referrer exists or `false` if the referrer does not exist.                       |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) that resolves with a [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean). Returns `true` if the referrer exists as a participant in the campaign, `false` otherwise.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
// Without specifying a referrer ID (auto-detects referrer)
growsurf.validateReferrer(isValid => {
  if (isValid) {
    // Referrer exists
  }
});

// With a specific referrer ID
growsurf.validateReferrer('kafewp', (isValid) => {
  if (isValid) {
    // Referrer exists
  }
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise
// Without specifying a participant ID (auto-detects referrer)
growsurf.validateReferrer().then(isValid => {
  if (isValid) {
    // Referrer exists
  }
});

// With a specific participant ID
growsurf.validateReferrer('kafewp').then(isValid => {
  if (isValid) {
    // Referrer exists
  }
});
```

{% endtab %}
{% endtabs %}

#### **Example response**

<pre class="language-javascript"><code class="lang-javascript"><strong>true
</strong></code></pre>

***

## PARTICIPANTS ↓

### Add referred participant

Adds a participant only when the current visitor has a valid referrer. Use this method when you want to track referred signups.

The method validates an explicit `referredBy` value first. If one is not provided, it automatically uses the referrer ID from the `grsf` URL parameter or browser cookie. If no valid referrer is present, it returns a normal not-added result.

{% hint style="info" %}
**Tips:** Though they are optional, we recommend passing in the fields `firstName` and `lastName` . These fields are used for anti-fraud purposes and they show up in referred friend motivator elements, if enabled.
{% endhint %}

```javascript
growsurf.addReferredParticipant(data, callback);
```

| Parameter      | Data Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`data`**     | String or Object | <p>(Required) A String containing the participant email or an Object containing the participant email and any other data to include for the participant.</p><p>If providing an Object, <code>referredBy</code> is optional and will override the automatically detected referrer. Any Object keys other than <code>email</code>, <code>firstName</code>, <code>lastName</code>, <code>referredBy</code>, <code>referredAt</code>, and <code>gdprAgreements</code> will be treated as <a href="/pages/-LfZ01vnHVkarKLqPFbR#metadata"><code>metadata</code></a> by GrowSurf.</p> |
| **`callback`** | Function         | (Optional) A callback function that will be invoked with the result.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) that resolves with a result object.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
growsurf.addReferredParticipant({
  email: 'gavin@hooli.com',
  firstName: 'Gavin',
  lastName: 'Belson'
}, (result) => {
  if (result.added) {
    // handle result.participant
  }
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
const result = await growsurf.addReferredParticipant({
  email: 'gavin@hooli.com',
  firstName: 'Gavin',
  lastName: 'Belson'
});

if (result.added) {
  // handle result.participant
}
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
    "added": true,
    "validReferral": true,
    "referredBy": "kafewp",
    "participant": {
        "id": "gavin",
        "firstName": "Gavin",
        "lastName": "Belson",
        "referralCount": 0,
        "monthlyReferralCount": 0,
        "shareUrl": "https://piedpiper.com?grsf=gavin-kafewp",
        "rewards": [],
        "vanityKeys": [
            "gavin-kafewp"
        ]
    }
}
```

If no participant is added, `notAddedReason` will be one of `no_referrer`, `invalid_referrer`, or `participant_already_exists`.

***

### Add participant

Adds a participant to the referral/affiliate program. Use this method for the following use-cases:

* Add every signup to your GrowSurf program. If a referral link was used, GrowSurf automatically submits the referrer ID behind the scenes.
* Generate referral links for your signed-in users on the fly (or return existing data if they are an existing participant)

For referral-only signup tracking, use [`growsurf.addReferredParticipant()`](#add-referred-participant) instead.

{% hint style="info" %}
**Tips:** Though they are optional, we recommend passing in the fields `firstName` and `lastName` . These fields are used for anti-fraud purposes and they show up in referred friend motivator elements, if enabled.
{% endhint %}

{% hint style="warning" %}
**Note:** A `401` error will be returned if the following conditions are met: (1) the program has participant authentication enabled, (2) there is no authentication cookie present on the participant's browser, (3) the given email is the same as an existing participant.
{% endhint %}

```javascript
growsurf.addParticipant(data, callback);
```

| Parameter      | Data Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data`**     | String or Object | <p>(Required) A String containing the participant email or an Object containing the participant email and any other data to include for the participant.</p><p>If providing an Object, any Object keys other than <code>email</code>, <code>firstName</code>, <code>lastName</code> , and <code>gdprAgreements</code> will be treated as <a href="/pages/-LfZ01vnHVkarKLqPFbR#metadata"><code>metadata</code></a> by GrowSurf.<br><br>For more information about metadata please see our <a href="https://docs.growsurf.com/developer-tools/rest-api/api-guidelines">API Guidelines</a>.</p> |
| **`callback`** | Function         | (Optional) A callback function that will be invoked with the added participant data if successful.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)containing limited participant data.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Email only using a Callback
growsurf.addParticipant('gavin@hooli.com', (participant) => {
  // handle participant
});

// Object using a Callback
growsurf.addParticipant({
  email: 'gavin@hooli.com',
  firstName: 'Gavin', // optional, but recommended for anti-fraud purposes
  lastName: 'Belson', // optional, but recommended for anti-fraud purposes
  company: 'Hooli, Inc', // Fields that are not email, firstName, or lastName will be saved as custom metadata
  companySize: 10000 // Fields that are not email, firstName, or lastName will be saved as custom metadata
}, (participant) => {
  // handle participant
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Email only using a Promise
growsurf.addParticipant('gavin@hooli.com').then(participant => {
  // handle participant
});

// Object using a Promise
growsurf.addParticipant({
  email: 'gavin@hooli.com',
  firstName: 'Gavin', // optional, but recommended for anti-fraud purposes
  lastName: 'Belson', // optional, but recommended for anti-fraud purposes
  company: 'Hooli, Inc', // Fields that are not email, firstName, or lastName will be saved as custom metadata
  companySize: 10000 // Fields that are not email, firstName, or lastName will be saved as custom metadata
}).then(participant => {
  // handle participant
});
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
    "id": "kafewp",
    "firstName": "Gavin",
    "lastName": "Belson",
    "referralCount": 0,
    "monthlyReferralCount": 0,
    "shareUrl": "https://piedpiper.com?grsf=gavin-kafewp",
    "rewards": [],
    "vanityKeys": [
        "gavin-kafewp"
    ]
}
```

***

### Get participant by email

Retrieves limited details of an existing participant. You will need to supply the unique email of the participant.

{% hint style="warning" %}
**Note:** A `403` error will be returned if the following conditions are met: (1) the program has participant authentication enabled, (2) there is no authentication cookie present on the participant's browser.
{% endhint %}

```javascript
growsurf.getParticipantByEmail(participantEmail, callback);
```

| Parameter              | Data Type | Description                                                                                                                                   |
| ---------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **`participantEmail`** | String    | (Required) The email of the participant to retrieve.                                                                                          |
| **`callback`**         | Function  | (Optional) A callback function that will be invoked with the participant data if successful or `undefined` if the participant does not exist. |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)containing the participant data. If the participant does not exist in the campaign, then `undefined` is returned.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a callback
growsurf.getParticipantByEmail('gavin@hooli.com', (participant) => {
    // Handle participant data
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a promise
growsurf.getParticipantByEmail('gavin@hooli.com').then(participant => {
    // Handle participant data
});
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
    "id": "kafewp",
    "firstName": "Gavin",
    "lastName": "Belson",
    "referralCount": 0,
    "monthlyReferralCount": 0,
    "shareUrl": "https://piedpiper.com?grsf=gavin-kafewp",
    "rewards": [],
    "vanityKeys" [
        "gavin-kafewp"
    ]
}
```

***

### Get participant by ID

Retrieves limited details of an existing participant. You will need to supply the GrowSurf unique identifier that was returned upon participant creation.

{% hint style="warning" %}
**Note:** A `403` error will be returned if the following conditions are met: (1) the program has participant authentication enabled, (2) there is no authentication cookie present on the participant's browser.
{% endhint %}

```javascript
growsurf.getParticipantById(participantId, callback);
```

| Parameter           | Data Type | Description                                                                                                                                   |
| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **`participantId`** | String    | (Required) The GrowSurf identifier of the participant to retrieve.                                                                            |
| **`callback`**      | Function  | (Optional) A callback function that will be invoked with the participant data if successful or `undefined` if the participant does not exist. |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)containing the participant data. If the participant does not exist in the campaign, then `undefined` is returned.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
growsurf.getParticipantById('kafewp', (participant) => {
    // Handle participant data
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a promise
growsurf.getParticipantById('kafewp').then(participant => {
    // Handle participant data
});
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
    "id": "kafewp",
    "firstName": "Gavin",
    "lastName": "Belson",
    "referralCount": 0,
    "monthlyReferralCount": 0,
    "shareUrl": "https://piedpiper.com?grsf=gavin-kafewp",
    "rewards": [],
    "vanityKeys" [
        "gavin-kafewp"
    ]
}
```

***

## REFERRALS AND INVITES ↓

### Update social share message

Updates the pre-populated social share message for the given share type (e.g, email, Facebook, Twitter). This method will update all social share buttons in GrowSurf embedded elements and the GrowSurf window.

{% hint style="info" %}
**Example:** This method is useful for optimizing referral asks when your participants complete an "[aha moment](https://userguiding.com/blog/what-is-aha-moment-how-to-find-it/)". You would present your participant with the [GrowSurf Embedded Form](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-form) element and then call this method to update social share message(s) to be specific to the "aha moment". See [this tutorial](https://docs.growsurf.com/developer-tools/javascript-sdk/tutorials#example-9-update-pre-populated-share-and-email-invite-messages-to-capitalize-on-a-customer-aha-momen) for an example.
{% endhint %}

```javascript
growsurf.updateSocialShareMessage(type, message, subjectLine);
```

| Parameter         | Data Type | Description                                                                                                                                                                                                                                                                                                                                                                                |
| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`type`**        | String    | <p>(Required) The social share type to update.</p><p><br>These are the options:</p><ul><li><code>email</code></li><li><code>facebook</code></li><li><code>twitter</code></li><li><code>threads</code></li><li><code>bluesky</code></li><li><code>pinterest</code></li><li><code>sms</code></li><li><code>whatsapp</code></li><li><code>reddit</code></li><li><code>tumblr</code></li></ul> |
| **`message`**     | String    | <p>(Required) The new pre-populated social share message.</p><p><br>Use <code>{{shareUrl}}</code> to reference the participant's referral link.</p>                                                                                                                                                                                                                                        |
| **`subjectLine`** | String    | <p>(Optional) The new pre-populated subject line (only applies when <code>type</code> is <code>email</code>).</p><p><br>Use <code>{{shareUrl}}</code> to reference the participant's referral link.</p>                                                                                                                                                                                    |

#### **Example use**

```javascript
const message = "I have saved 1,540 hours using this service. Highly recommend! {{shareUrl}}";
const subjectLine = "Check this out!";

// Update the pre-populated email social share message
growsurf.updateSocialShareMessage('email', message, subjectLine);

// Update the pre-populated Facebook social share message
growsurf.updateSocialShareMessage('facebook', message);

// Update the pre-populated Twitter social share message
growsurf.updateSocialShareMessage('twitter', message);

// Update the pre-populated Threads social share message
growsurf.updateSocialShareMessage('threads', message);

// Update the pre-populated Bluesky social share message
growsurf.updateSocialShareMessage('bluesky', message);

// Update the pre-populated Pinterest social share message
growsurf.updateSocialShareMessage('pinterest', message);

// Update the pre-populated SMS social share message
growsurf.updateSocialShareMessage('sms', message);

// Update the pre-populated WhatsApp social share message
growsurf.updateSocialShareMessage('whatsapp', message);

// Update the pre-populated Reddit social share message
growsurf.updateSocialShareMessage('reddit', message);

// Update the pre-populated Tumblr social share message
growsurf.updateSocialShareMessage('tumblr', message);
```

***

### Update email invite message

Updates the pre-populated email invite message. This method will only apply updates to [GrowSurf Embedded Invite](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-invite) elements (the email invite section within the GrowSurf window will not be updated).

{% hint style="info" %}
**Example:** This method is useful for optimizing referral asks when your participants complete an "[aha moment](https://userguiding.com/blog/what-is-aha-moment-how-to-find-it/)". You would present your participant with the [GrowSurf Embedded Invite](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-invite) element and then call this method to update the email invite message to be specific to the "aha moment". See [this tutorial](https://docs.growsurf.com/developer-tools/javascript-sdk/tutorials#example-9-update-pre-populated-share-and-email-invite-messages-to-capitalize-on-a-customer-aha-momen) for an example.
{% endhint %}

```javascript
growsurf.updateEmailInviteMessage(message, subjectLine);
```

| Parameter         | Data Type | Description                                                                                                                                         |
| ----------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`message`**     | String    | <p>(Required) The new pre-populated email invite message.</p><p><br>Use <code>{{shareUrl}}</code> to reference the participant's referral link.</p> |
| **`subjectLine`** | String    | <p>(Optional) The new pre-populated subject line.</p><p><br>Use <code>{{shareUrl}}</code> to reference the participant's referral link.</p>         |

#### **Example use**

```javascript
const message = "I have saved 1,540 hours using this service. Highly recommend! {{shareUrl}}";
const subjectLine = "Check this out!";

// Update the pre-populated email invite message and subject line
growsurf.updateEmailInviteMessage(message, subjectLine);
```

***

## REFERRAL PROGRAMS ↓

### Trigger referral

<mark style="color:orange;">Referral programs only</mark>

Triggers a referral, awarding referral credit to the referrer of an existing or new participant. If the program participant does not exist, they will be newly added.

{% hint style="warning" %}
**Note:** A `401` error will be returned but the referral will still be triggered if the following conditions are met: (1) the program has participant authentication enabled, (2) there is no authentication cookie present on the participant's browser, (3) the given email is the same as an existing participant.
{% endhint %}

```javascript
growsurf.triggerReferral(data, callback);
```

| Parameter      | Data Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`data`**     | String or Object | <p>(Optional) A String containing the participant email or an Object containing the participant email and any other data to include for the participant.</p><p>If providing an Object, any Object keys other than <code>email</code>, <code>firstName</code>, and <code>lastName</code> will be treated as <a href="/pages/-LfZ01vnHVkarKLqPFbR#metadata"><code>metadata</code></a> by GrowSurf.</p><p><em>\*This parameter is only optional if the participant has already signed up for the campaign and GrowSurf is able to determine they are a participant (does not include participants imported or manually added using the dashboard). For more information about metadata please see our</em> <a href="/pages/-LfZ01vnHVkarKLqPFbR#metadata"><em>API Guidelines</em></a><em>.</em></p> |
| **`callback`** | Function         | (Optional) A callback function that will be invoked with the added or updated participant data if successful.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)containing limited participant data.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Email only using a Callback
growsurf.triggerReferral('gavin@hooli.com', (participant) => {
  // handle participant
});

// Object using a Callback
growsurf.triggerReferral({
  email: 'gavin@hooli.com',
  firstName: 'Gavin', // optional, but recommended for anti-fraud purposes
  lastName: 'Belson', // optional, but recommended for anti-fraud purposes
  company: 'Hooli, Inc', // Fields that are not email, firstName, or lastName will be saved as custom metadata
  companySize: 10000 // Fields that are not email, firstName, or lastName will be saved as custom metadata
}, (participant) => {
  // handle participant
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Email only using a Promise
growsurf.triggerReferral('gavin@hooli.com').then(participant => {
  // handle participant
});

// Object using a Promise
growsurf.triggerReferral({
  email: 'gavin@hooli.com',
  firstName: 'Gavin',
  lastName: 'Belson',
  company: 'Hooli, Inc',
  companySize: 10000
}).then(participant => {
  // handle participant
});
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
    "id": "kafewp",
    "firstName": "Gavin",
    "lastName": "Belson",
    "referralCount": 0,
    "shareUrl": "https://piedpiper.com?grsf=gavin-kafewp",
    "rewards": [],
    "vanityKeys" [
        "gavin-kafewp"
    ]
}
```

***

### Get upfront discount

<mark style="color:orange;">Referral programs only</mark>

Use this method when you want to apply an upfront discount to a referred friend (e.g., "Get 20% off your first invoice").

Returns the upfront discount promotion code and coupon ID for the current referred visitor. Returns `null` if the visitor was not referred, if no upfront discount is enabled, or if the program has ended.

{% hint style="warning" %}
**Note:** The upfront discount must be enabled on a Double-Sided reward (via the "Give the referred friend their reward upfront instead of after they complete the qualifying action" toggle) and a coupon integration ([Stripe](https://docs.growsurf.com/integrations/stripe#upfront-discounts), [Chargebee](https://docs.growsurf.com/integrations/chargebee#upfront-discounts), or [Recurly](https://docs.growsurf.com/integrations/recurly#upfront-discounts)) must be connected with referred friend coupon settings. The visitor must have been referred (i.e., arrived via a referral link) for a discount to be returned.
{% endhint %}

| Parameter         | Data Type | Description                                                                                                                                    |
| ----------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `integrationType` | String    | (Optional) One of `'stripe'`, `'chargebee'`, or `'recurly'`. If omitted, returns the first available upfront discount across all integrations. |

Returns an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics) or `null`.

#### Example use

```js
// Get the first available upfront discount
const discount = window.growsurf.getUpfrontDiscount();

// Get Stripe-specific upfront discount
const stripeDiscount = window.growsurf.getUpfrontDiscount('stripe');

// Get Chargebee-specific upfront discount
const chargebeeDiscount = window.growsurf.getUpfrontDiscount('chargebee');

if (discount) {
  // Apply the promotion code to your checkout flow
  applyDiscount(discount.promotionCode);
}
```

#### Example response

```js
{
  integration: 'stripe',          // Which integration the discount is from
  promotionCode: 'GRSF-A1B2C3D4', // Customer-facing code
  couponId: 'coupon_abc123'       // Provider coupon ID
}
```

***

### Get referral summary

<mark style="color:orange;">Referral programs only</mark>

Returns referral summary statistics for the currently logged-in participant.

{% hint style="warning" %}
**Note:** A `401` error will be returned if the following conditions are met: (1) the program has participant authentication enabled, (2) there is no authentication cookie present on the participant's browser
{% endhint %}

```javascript
growsurf.getReferralSummary();
```

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics) containing the participant's referral summary stats.

#### Example use

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
growsurf.getReferralSummary({}, (summary) => {
  console.log('Referral Summary:', summary);
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise
const summary = await growsurf.getReferralSummary();
console.log(summary);
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
  "referrals": 23,         // Number of successful referrals
  "leads": 45,             // Number of pending referrals (leads)
  "expiredReferrals": 3,   // Number of referrals that expired before being credited
  "clicks": 23000,         // Number of unique visitors from the participant's referral link
  "rewardsEarned": 4,      // Number of rewards the participant has earned (approved)
  "pendingRewards": 1,     // Number of rewards still waiting to be approved (not yet earned)
  "invitesSent": 12,       // Number of email invites the participant has sent through GrowSurf
  "currencyISO": "USD"     // The ISO 4217 currency code of the campaign
}
```

***

## AFFILIATE PROGRAMS ↓

### Get commissions

<mark style="color:orange;">Affiliate programs only</mark>

Returns a paginated list of commissions for the logged-in participant.

{% hint style="warning" %}
**Note:** A `401` error will be returned if the following conditions are met: (1) the program has participant authentication enabled, (2) there is no authentication cookie present on the participant's browser
{% endhint %}

```javascript
growsurf.getCommissions(options, callback);
```

| Parameter            | Data Type | Description                                                                                                                                                                                                                                                          |
| -------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`options`**        | Object    | (Optional) An object containing pagination options.                                                                                                                                                                                                                  |
| **`options.limit`**  | Number    | (Optional) The number of commissions to return per page. Defaults to 20.                                                                                                                                                                                             |
| **`options.nextId`** | String    | (Optional) The ID of the commission to start the next result set with. This can be used to skip through the list or to page the list results. Each response will provide a `nextId` value if there are more commissions otherwise the `nextId` value will be `null`. |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)containing limited commissions data.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback - First page
growsurf.getCommissions({ limit: 10 }, (result) => {
  console.log(result.commissions); // Array of commission objects
  console.log(result.summary); // Summary of commissions by status
  console.log(result.hasMore); // Boolean indicating if more results are available
  console.log(result.nextId); // Cursor ID for next page (undefined if no more results)
});

// Fetching the next page
growsurf.getCommissions({ limit: 10, nextId: 'comm_abc123' }, (result) => {
  console.log(result.commissions); // Next page of results
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise - First page
const result = await growsurf.getCommissions({ limit: 10 });
console.log(result.commissions); // Array of commission objects
console.log(result.summary); // Summary of commissions by status

// Fetching additional pages
if (result.hasMore) {
  const nextPage = await growsurf.getCommissions({ limit: 10, nextId: result.nextId });
  console.log(nextPage.commissions); // Next page of results
}
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
  "commissions": [
    {
      "id": "comm_t1so1w",
      "amount": 7228,
      "currencyISO": "USD",
      "status": "PENDING",
      "holdDuration": 0,
      "createdAt": 1764768074294,
      "amountInCampaignCurrency": 7228,
      "saleAmountInCampaignCurrency": 38900,
      "campaignCurrencyISO": "USD"
    }
  ],
  "summary": {
    "pending": {
      "count": 1,
      "totalAmount": 7228
    },
    "approved": {
      "count": 0,
      "totalAmount": 0
    },
    "paid": {
      "count": 0,
      "totalAmount": 0
    },
    "reversed": {
      "count": 0,
      "totalAmount": 0
    }
  },
  "totalCount": 1,
  "totalAmount": 7228,
  "nextId": "comm_def456",
  "hasMore": true
}
```

***

### Get payouts

<mark style="color:orange;">Affiliate programs only</mark>

Returns a paginated list of payouts for the logged-in participant.

{% hint style="warning" %}
**Note:** A `401` error will be returned if the following conditions are met: (1) the program has participant authentication enabled, (2) there is no authentication cookie present on the participant's browser
{% endhint %}

```javascript
growsurf.getPayouts(options, callback);
```

| Parameter            | Data Type | Description                                                                                                                                                                                                                                                  |
| -------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`options`**        | Object    | (Optional) An object containing pagination options.                                                                                                                                                                                                          |
| **`options.limit`**  | Number    | (Optional) The number of payouts to return per page. Defaults to 20.                                                                                                                                                                                         |
| **`options.nextId`** | String    | (Optional) The ID of the payout to start the next result set with. This can be used to skip through the list or to page the list results. Each response will provide a `nextId` value if there are more payouts otherwise the `nextId` value will be `null`. |

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)containing limited payouts data.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback - First page
growsurf.getPayouts({ limit: 10 }, (result) => {
  console.log(result.payouts); // Array of payout objects
  console.log(result.summary); // Summary of payouts by status
  console.log(result.hasMore); // Boolean indicating if more results are available
  console.log(result.nextId); // Cursor ID for next page (undefined if no more results)
});

// Fetching the next page
growsurf.getPayouts({ limit: 10, nextId: 'payout_xyz' }, (result) => {
  console.log(result.payouts); // Next page of results
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise - First page
const result = await growsurf.getPayouts({ limit: 10 });
console.log(result.payouts); // Array of payout objects
console.log(result.summary); // Summary of commissions by status

// Fetching additional pages
if (result.hasMore) {
  const nextPage = await growsurf.getPayouts({ limit: 10, nextId: result.nextId });
  console.log(nextPage.payouts); // Next page of results
}
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
	"payouts": [
		{
			"id": "po_kj19ss",
			"amount": 91212,
			"currencyISO": "USD",
			"status": "UPCOMING",
			"createdAt": 1763974665314,
			"amountInCampaignCurrency": 91212,
			"campaignCurrencyISO": "USD"
		},
		{
			"id": "po_asaj1s",
			"amount": 89120,
			"currencyISO": "USD",
			"status": "ISSUED",
			"createdAt": 1763974665314,
			"amountInCampaignCurrency": 89120,
			"campaignCurrencyISO": "USD"
		}
	],
  "summary": {
    "upcoming": {
      "count": 1,
      "totalAmount": 91212
    },
    "queued": {
      "count": 0,
      "totalAmount": 0
    },
    "issued": {
      "count": 1,
      "totalAmount": 89120
    }
  },
	"totalCount": 2,
	"totalAmount": 180332,
	"nextId": "po_x99s1o",
	"hasMore": true
}
```

***

### Get affiliate summary

<mark style="color:orange;">Affiliate programs only</mark>

Returns affiliate summary statistics for the currently logged-in participant.

{% hint style="warning" %}
**Note:** A `401` error will be returned if the following conditions are met: (1) the program has participant authentication enabled, (2) there is no authentication cookie present on the participant's browser
{% endhint %}

```javascript
growsurf.getAffiliateSummary();
```

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)containing limited commissions data.

#### Example use

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
growsurf.getAffiliateSummary({}, (summary) => {
  console.log('Affiliate Summary:', summary);
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise
const summary = await growsurf.getAffiliateSummary();
console.log(summary);
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
  "referralRevenue": 2500000, // Total revenue generated from referrals (in minor currency units, e.g., cents)
  "totalPaidOut": 1500000, // Total commissions paid out to the affiliate (in minor currency units)
  "upcomingPayout": 500000, // Pending commissions to be paid out (in minor currency units)
  "referrals": 23, // Number of successful referrals
  "leads": 45, // Number of pending referrals (leads)
  "clicks": 23000, // Number of unique visitors from the affiliate's referral link (aka unique impressions)
  "currencyISO": "USD" // The ISO 4217 currency code of the campaign (e.g., "USD")
}
```

***

## NOTIFICATIONS ↓

### Initialize unread notifications badge

This method will inject an unread notifications badge onto a target element.

<figure><img src="/files/vCcjehDiad8m0OwCg6wq" alt=""><figcaption><p>The unread badge will be injected into your target element</p></figcaption></figure>

This method is useful for highlighting an unread notifications badge to your users from within your own user portal.

We recommend that the target element be a button that opens the GrowSurf window (via [`growsurf.open()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#open-growsurf-window)), because the unread notifications badge will be cleared when the participant views the respective section in the GrowSurf window (rewards section for referral programs; commissions or payouts sections for affiliate programs).

{% hint style="info" %}
Alternatively, you can use [`growsurf.markNotificationsAsRead()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#mark-notifications-as-read) to clear the unread notifications badge.
{% endhint %}

If a participant cookie doesn't exist, the badge will not be displayed on the target element.

```javascript
growsurf.initUnreadNotificationsBadge(targetElement, type);
```

<table><thead><tr><th width="249.33333333333331">Parameter</th><th>Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>targetElement</code></strong></td><td>String</td><td><p>(Required) The target element</p><p><br>Example: <code>.my-button</code></p></td></tr><tr><td><strong><code>type</code></strong></td><td>String</td><td>(Optional) Available options:<br><br><code>rewards</code><br><code>commissions</code><br><code>payouts</code><br><br>If no <code>type</code> is provided, then all unread notification badges will be initialized.</td></tr></tbody></table>

#### **Example use**

```html
<a class="my-button">
  Refer and Earn
</a>

<script>
  growsurf.initUnreadNotificationsBadge('.my-button');
</script>
```

{% hint style="success" %}

#### **CSS Alternative:**

Instead of using the JavaScript method `growsurf.initUnreadNotificationsBadge()`, you can simply add a CSS class `growsurf-unread-notifications-badge` to your target element. This will also inject the unread badge without requiring JavaScript.\
\
**Here is an example:**

```html
<a href="/refer"
   class="my-button growsurf-unread-notifications-badge">
  Refer and Earn
</a>
```

**Note:** You'll need to make sure you have the [GrowSurf Universal Code](https://docs.growsurf.com/getting-started#get-the-growsurf-universal-code) installed.
{% endhint %}

{% hint style="danger" %}
**Important Note**: Notification counts will not appear if you have certain sections disabled within the *Program Editor > 2. Design > Rewards* section. For example:

* For referral programs, if you have the rewards section hidden (see image below), the notification counts will not appear.

  <div align="left"><figure><img src="/files/iyQXSSFzAiW4CONEDUrG" alt="" width="375"><figcaption></figcaption></figure></div>
* For affiliate programs, if you have the commissions or payouts sections hidden (see image below), the notification counts will only reflect the sections that are enabled.

  <div align="left"><figure><img src="/files/gnOmPhxDowMpJ8z0xwtK" alt="" width="375"><figcaption></figcaption></figure></div>

{% endhint %}

***

### Get unread notifications count

Returns the number of unread notifications (rewards for referral programs; commissions and payouts for affiliate programs) of the authenticated participant or **`null`** if there is no participant authentication cookie present. This method is useful for highlighting an unread notifications badge to your users from within your own user portal.

{% hint style="info" %}
Alternatively, you can use the [`growsurf.initUnreadNotificationsBadge()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#initialize-unread-notifications-badge) method for displaying the unread notifications count as a badge on a target element.
{% endhint %}

<table><thead><tr><th width="249.33333333333331">Parameter</th><th>Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>type</code></strong></td><td>String</td><td>(Optional) Available options:<br><br><code>rewards</code><br><code>commissions</code><br><code>payouts</code><br><br>If no <code>type</code> is provided, then all unread notification counts will be returned.</td></tr></tbody></table>

```javascript
growsurf.getUnreadNotificationsCount(type);
```

#### **Example use**

```javascript
growsurf.getUnreadNotificationsCount('rewards');
```

**Example response**

```javascript
2
```

{% hint style="danger" %}
**Important Note**: Notification counts will not appear if you have certain sections disabled within the *Program Editor > 2. Design > Rewards* section. For example:

* For referral programs, if you have the rewards section hidden (see image below), the notification counts will not appear.

  <div align="left"><figure><img src="/files/iyQXSSFzAiW4CONEDUrG" alt="" width="375"><figcaption></figcaption></figure></div>
* For affiliate programs, if you have the commissions or payouts sections hidden (see image below), the notification counts will only reflect the sections that are enabled.

  <div align="left"><figure><img src="/files/gnOmPhxDowMpJ8z0xwtK" alt="" width="375"><figcaption></figcaption></figure></div>

{% endhint %}

***

### Mark notifications as read

Mark unread notifications of the authenticated participant. This method is useful if you are using [`growsurf.initUnreadNotificationsBadge()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#initialize-unread-notifications-badge) instead of the GrowSurf window to show your users their unread notifications count and want to clear out the unread badge.

```javascript
growsurf.markNotificationsAsRead(type);
```

<table><thead><tr><th width="249.33333333333331">Parameter</th><th>Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>type</code></strong></td><td>String</td><td>(Optional) Available options:<br><br><code>rewards</code><br><code>commissions</code><br><code>payouts</code><br><br>If no <code>type</code> is provided, then all unread notifications will be marked as read.</td></tr></tbody></table>

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)that resolves with an [Object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics)with a success response.

#### **Example use**

{% tabs %}
{% tab title="Using Callbacks" %}

```javascript
// Using a Callback
growsurf.markNotificationsAsRead(response => {
  // handle success response
});
```

{% endtab %}

{% tab title="Using Promises" %}

```javascript
// Using a Promise
growsurf.markNotificationsAsRead().then(response => {
  // handle success response
});
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
    "success": true
}
```

***

## EVENTS ↓

### Subscribe to event

Adds an event subscription of the given event type. When an event of the given type occurs, the given callback will be invoked. Below are detailed descriptions of each event type.

```javascript
growsurf.subscribe(eventType, callback);
```

| Parameter       | Data Type | Description                                                                                                                                                                                                                                       |
| --------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`eventType`** | String    | <p>(Required) The event type to subscribe to.</p><p><br>These are the options:</p><ul><li><code>referral</code></li><li><code>referralTrigger</code></li><li><code>signup</code></li><li><code>share</code></li><li><code>invite</code></li></ul> |
| **`callback`**  | Function  | The callback function that will be invoked when the event occurs.                                                                                                                                                                                 |

#### **Example use**

```javascript
/**
 * REFERRED FRIEND EVENTS
 */

// Subscribe to a `referral` event type
growsurf.subscribe('referral', (participant) => {
  // A new participant was referred
});

// Subscribe to a `referralTrigger` event type
growsurf.subscribe('referralTrigger', (participant) => {
  // A referred participant triggered a referral (AKA they completed the qualifying action)
});


/**
 * REFERRER EVENTS
 */

// Subscribe to a `signup` event type
growsurf.subscribe('signup', (participant) => {
  // A new participant was added (only non-referred signups)
});

// Subscribe to a `share` event type
growsurf.subscribe('share', (data) => {
  // A participant shared their unique referral URL by clicking a social share button
});

// Subscribe to an `invite` event type
growsurf.subscribe('invite', (participant) => {
  // A participant sent out an invite
});
```

#### **Example response**

Dispatched anytime an event happens. The provided callback will be invoked with an Object containing data relevant to the event.

{% tabs %}
{% tab title="" %}
The `'referral'` event returns limited data of the new referred participant. The `referredBy` key represents the referring participant's unique ID.

```json
{
    "id": "kafewp",
    "email": "gavin@hooli.com",
    "firstName": "Gavin",
    "lastName": "Belson",
    "referredBy": "xyz789",
    "referralCount": 0,
    "shareUrl": "https://piedpiper.com?grsf=kafewp",
    "rewards": [],
    "campaign": {
       "id": "abc123"
    }
}
```

{% endtab %}

{% tab title="" %}
The `'referralTrigger'` Event returns limited data of the referred participant that triggered a referral (which means they completed a qualifying action).

**Note:** This event happens when calling [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral). If you are looking for the referred signup event, use the 'referral' Event that contains a `referredBy` property.

```json
{
    "id": "kafewp",
    "email": "gavin@hooli.com",
    "firstName": "Gavin",
    "lastName": "Belson",
    "referralCount": 0,
    "shareUrl": "https://piedpiper.com?grsf=kafewp",
    "rewards": [],
    "campaign": {
       "id": "abc123"
    }
}
```

{% endtab %}

{% tab title="" %}
The `'signup'` Event returns limited data of the new non-referred participant.

```json
{
    "id": "kafewp",
    "email": "gavin@hooli.com",
    "firstName": "Gavin",
    "lastName": "Belson",
    "referralCount": 0,
    "shareUrl": "https://piedpiper.com?grsf=kafewp",
    "rewards": [],
    "campaign": {
       "id": "abc123"
    }
}
```

{% endtab %}

{% tab title="" %}
The `'share'` Event returns limited data of the participant and the share type.

The `shareType` value will either be a social network (e.g., `linkedin`, `reddit`) or `copyLink` if the participant copied their link to share (e.g., they clicked "Copy Link").

```json
{
    "participant": {
        "id": "kafewp",
        "email": "gavin@hooli.com",
        "firstName": "Gavin",
        "lastName": "Belson",
        "referralCount": 0,
        "shareUrl": "https://piedpiper.com?grsf=kafewp",
        "rewards": []
    },
    "shareType": "facebook",
    "campaign": {
       "id": "abc123"
    }
}
```

{% endtab %}

{% tab title="" %}
The `'invite'` Event returns limited data of the participant and the number of invites sent.<br>

If your campaign is set up for email invites to be sent by participants, `invitesAttempted` will always match `invitesSent`. If email invites are sent by your company, `invitesSent` will only count successfully delivered emails confirmed by our server. [Learn more here](https://support.growsurf.com/article/353-how-email-invites-work).

```json
{
    "participant": {
        "id": "kafewp",
        "email": "gavin@hooli.com",
        "firstName": "Gavin",
        "lastName": "Belson",
        "referralCount": 0,
        "shareUrl": "https://piedpiper.com?grsf=kafewp",
        "rewards": []
    },
    "invitesAttempted": 3,
    "invitesSent": 3,
    "campaign": {
       "id": "abc123"
    }
}
```

{% endtab %}
{% endtabs %}


# Client Response Codes

Refer to the below response code glossary to help you troubleshoot any errors when using the JavaScript SDK or Embeddable Elements.

## Glossary

| **Response Code**                | **Messages**                                                                                                                                                         | **Explanation**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200 OK`                         | The request was successful!                                                                                                                                          | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `400 Bad Request`                | Participant cannot join this program.                                                                                                                                | The participant was prevented from being added to the program (please check that your program's anti-fraud settings are not set to *Strict*, or that you do not have the email or IP address blacklisted)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `401 Unauthorized`               | Participant authentication is required.                                                                                                                              | If an existing participant is trying to access their account, they need to first authenticate (by logging in via one-time access token link in email)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `401 Failed to add participant`  | Participant was not able to join this program.                                                                                                                       | The person may be a high-risk fraudster, and has been blocked from entering the program. [Learn more about how GrowSurf's anti-fraud system works](https://support.growsurf.com/article/195-what-does-the-growsurf-anti-fraud-system-entail).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `402`                            | Usage limit exceeded                                                                                                                                                 | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `403 Forbidden`                  | <ol><li>You are not allowed to perform that action.</li><li>No valid participant access token provided.</li><li>Request was blocked (includes CORS issues)</li></ol> | <ol><li>This may be due to the URL not matching what is configured for your program. Make sure to check your whitelisted URLs as well. Any URLs that makes excessive unauthorized requests to your GrowSurf program may be blocked. Please reach out to <support@growsurf.com> for assistance.</li><li>If an existing participant is trying to access their account, they need to first authenticate (by logging in via one-time access token link in email)</li><li>Your program may be blocked due to excessive requests made to our system from the same IP address. Please see <a href="https://support.growsurf.com/article/483-i-am-having-cors-issues-when-loading-the-growsurf-universal-code">this article</a>.</li></ol> |
| `404 Resource Not Found`         | The requested resource does not exist.                                                                                                                               | You may be trying to request a resource that does not exist or was deleted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `409 Conflict Duplicate Request` | Conflicting duplicate request.                                                                                                                                       | <p>If a request is made but has not finished and that exact same request is made.</p><p>More details on the specific request will be provided within the returned error.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `429 Too Many Requests`          | You have reached your \<rate> limit                                                                                                                                  | You have reached the rate limit.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `5XX Internal Server Error`      | The GrowSurf server is inaccessible or offline -- that's our fault! Check for updates on our [status page](https://growsurf.com/status).                             | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |


# iOS SDK (Beta)

Install and use the GrowSurf iOS SDK to capture referral attribution, create referred participants, and show a native referral window in your app.

{% hint style="info" %}
If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

## Install

The core library is lightweight, adding roughly \~2.6 MB (uncompressed device binary) to your iOS app (attribution adapters add only tens of KB each).

Choose one install path.

{% tabs %}
{% tab title="CocoaPods" %}
Add the SDK from the public `v0.3.3` podspec:

```ruby
growsurf_podspec = 'https://raw.githubusercontent.com/growsurf/growsurf-ios-sdk-distribution/v0.3.3/GrowSurfSDK.podspec'

pod 'GrowSurfSDK', :podspec => growsurf_podspec
```

Optional attribution adapter subspecs:

```ruby
pod 'GrowSurfSDK/BranchAttribution', :podspec => growsurf_podspec
pod 'GrowSurfSDK/AdjustAttribution', :podspec => growsurf_podspec
pod 'GrowSurfSDK/AppsFlyerAttribution', :podspec => growsurf_podspec
pod 'GrowSurfSDK/SingularAttribution', :podspec => growsurf_podspec
```

{% endtab %}

{% tab title="Swift Package Manager" %}
In Xcode, add the public binary package repository:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution.git
```

Choose version `0.3.3` or later, then add the `GrowSurfSDK` product to your app target.

For a `Package.swift` target:

```swift
dependencies: [
    .package(url: "https://github.com/growsurf/growsurf-ios-sdk-distribution.git", from: "0.3.3"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "GrowSurfSDK", package: "growsurf-ios-sdk-distribution"),
        ]
    ),
]
```

Optional attribution adapter products are available from the same package:

* `GrowSurfBranchAttribution`
* `GrowSurfAdjustAttribution`
* `GrowSurfAppsFlyerAttribution`
* `GrowSurfSingularAttribution`

The optional `GrowSurfGoogleContacts` product additionally pulls in Google Sign-In, so add it only if you want the native in-app Google contacts sign-in sheet.
{% endtab %}

{% tab title="Manual XCFramework" %}

1. Download `GrowSurfSDK.xcframework.zip` from the public [`v0.3.3` release](https://github.com/growsurf/growsurf-ios-sdk-distribution/releases/tag/v0.3.3).
2. Unzip it and drag `GrowSurfSDK.xcframework` into your Xcode project.
3. In your app target, set `GrowSurfSDK.xcframework` to **Embed & Sign**.
4. Add optional adapter XCFrameworks the same way when you use Branch, Adjust, AppsFlyer, or Singular helpers.
   {% endtab %}
   {% endtabs %}

{% hint style="info" %}
If you use Branch, Adjust, AppsFlyer, or Singular, add the matching GrowSurf adapter and keep your provider's SDK setup in your app.
{% endhint %}

### Initialize

Enable Mobile SDK access in your GrowSurf program on the instructions page, then configure the SDK once when your app starts or before your first GrowSurf call.

* Find `campaignId` in your GrowSurf program dashboard. It is the 6-character program ID, such as `p9josq`.
* Find `publicKey` in *Program Editor > 5. Installation > Instructions page > Step 1. iOS > Configure SDK*.

```swift
import GrowSurfSDK

let growsurf = GrowSurf.configure(
    campaignId: "p9josq",
    publicKey: "pk_mobile"
)
```

{% hint style="info" %}
Native apps use a public Mobile SDK key, which can safely be exposed. This is different than your REST API key on your backend, which you should always keep secret.
{% endhint %}

***

## Track referrals

Tracking referrals entails capturing attribution and creating new referred participants.

### Capture attribution

Capture referral attribution before you create the referred friend's participant record.

{% stepper %}
{% step %}
**For direct app links that open your installed app:**

```swift
if let url {
    try await growsurf.handleDeepLink(url)
}
```

{% hint style="info" %}
**Already support deep links?** If you use an attribution provider (Branch, AppsFlyer, Adjust, Singular) or otherwise open your app from links, this is already set up — just forward the opened URL to `handleDeepLink(url)`.

**Starting from scratch?** Register a custom URL scheme (`CFBundleURLSchemes` in `Info.plist`) — the quickest path, no domain needed — and/or configure Universal Links (Associated Domains entitlement) for nicer `https` links, which require a domain you control. Then call `handleDeepLink(url)` from your app's URL-open handler (SwiftUI `.onOpenURL` or `application(_:open:options:)`).
{% endhint %}
{% endstep %}

{% step %}
**For deferred deep links from an attribution provider:**

Unlike Android (which reads the Play Install Referrer for native deferred attribution), iOS has no native deferred deep link mechanism, so deferred attribution is delegated to your attribution provider (e.g., Branch, AppsFlyer). View [Adapter docs](https://docs.growsurf.com/developer-tools/ios-sdk/attribution-providers#adapters) for your specific provider setup instructions.
{% endstep %}
{% endstepper %}

### Create a referred participant

Use [`addReferredParticipant()`](https://docs.growsurf.com/developer-tools/ios-sdk/api-reference#add-referred-participant) for referred signups. This is typically where new users sign up in your app.

The SDK validates saved or explicit attribution and only creates the participant when the referral code is valid.

```swift
// Only creates a referred participant if the referral code is valid
let created = try await growsurf.addReferredParticipant(
    .init(
        email: "person@example.com",
        firstName: "Ada",
        lastName: "Lovelace",
        metadata: ["plan": "pro"] // Optional, saved as participant metadata
        // The referral code and mobile instance ID (for anti-fraud) are passed automatically
    )
)

let participant = created.participant
```

***

## Generate referral links for your users

Generating referral links to users in your app entails generating a participant token by using the GrowSurf API, then opening the GrowSurf window.

### Generate a participant token

To allow authenticated access to your logged-in users, you must call the GrowSurf backend to generate a participant token.

{% stepper %}
{% step %}
**Call backend endpoint** [**create a mobile participant token**](/developer-tools/rest-api/api-reference#post-campaign-id-mobile-participant-token)**.**

Here is an example `cURL` command:

```bash
curl -X POST "https://api.growsurf.com/v2/campaign/YOUR_PROGRAM_ID/mobile-participant-token" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
   "email": "person@example.com",
   "firstName": "Ada",
   "lastName": "Lovelace",
   "mobileInstanceId": "5f7d0f4c-3e7c-4aa9-8c41-d81d998f0bb1",
   "ipAddress": "203.0.113.10",
   "metadata": {
      "plan": "pro"
   }
}'
```

Only `email` is required. `firstName`, `lastName`, `mobileInstanceId`, and `ipAddress` are optional but recommended for anti-fraud. `metadata` is optional and is not used by GrowSurf.

{% hint style="info" %}
Using TypeScript, Python, PHP, Ruby, or Java for your backend? Use an official [GrowSurf API Library](https://docs.growsurf.com/developer-tools/rest-api/api-libraries).
{% endhint %}

**Optional:** To get `mobileInstanceId`, which is used for anti-fraud purposes, use the SDK method [`mobileInstanceId()`](https://docs.growsurf.com/developer-tools/ios-sdk/api-reference#get-mobile-instance-id).

This will create a new participant or return an existing one, along with a participant token that allows authenticated calls.
{% endstep %}

{% step %}
**Pass it to the app, then store in the SDK via** [**`setParticipantToken()`**](https://docs.growsurf.com/developer-tools/ios-sdk/api-reference#set-participant-token)**.**

Here is example SDK code:

```swift
let mobileInstanceId = try await growsurf.mobileInstanceId() // Used for anti-fraud (optional)
let backendResponse = try await api.createMobileParticipantToken(
    email: user.email,
    mobileInstanceId: mobileInstanceId
)
let participantToken = backendResponse.participantToken

try await growsurf.setParticipantToken(participantToken)
```

{% endstep %}
{% endstepper %}

### Show the GrowSurf window

<div align="left"><figure><img src="/files/vGVp8AZN5tbayyFVkxks" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/8FwQnM1Vl2glf35ZnzbE" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/5AQKI2yUBMFXHb57Avr4" alt="" width="188"><figcaption></figcaption></figure></div>

The GrowSurf window allows your participants to view/share their referral link and track the status of their referrals and rewards.

Call [`presentGrowSurfWindow()`](https://docs.growsurf.com/developer-tools/ios-sdk/api-reference#present-growsurf-window) from your own button, menu item, or referral screen. Set the `identity` parameter to [`.existingParticipantToken()`](https://docs.growsurf.com/developer-tools/ios-sdk/models-and-errors#growsurfwindowidentity), which will use the participant token you generated above.

```swift
growsurf.presentGrowSurfWindow(
    from: viewController,
    identity: .existingParticipantToken(participantToken),
    theme: GrowSurfWindowTheme(
        primaryColorHex: "#13795B",
        presentationStyle: .automatic
    ),
    callbacks: GrowSurfWindowCallbacks(
        onShareTracked: { type in
            print("Share tracked: \(type)")
        },
        onError: { error in
            print(error.localizedDescription)
        }
    )
)
```

***

## \[Optional] Google Contacts invites <a href="#google-contacts" id="google-contacts"></a>

<div align="left"><figure><img src="/files/lQkax8mjoV7S1Jw2HI9p" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/ZROHSVtl41CI7D0Cd95a" alt="" width="188"><figcaption></figcaption></figure></div>

Only needed when Google Contacts invites are enabled for your program. When enabled, the native GrowSurf window can read the participant's Google contacts (read-only) so they can pick people to invite.

This works **out of the box** — the core `GrowSurfSDK` uses a dependency-free external-browser sign-in flow, so there is **no extra dependency to install** for the default experience.

To use the **native in-app Google Sign-In sheet** instead (a smoother flow that doesn't leave your app), add the optional `GrowSurfGoogleContacts` product. It bundles Google Sign-In, so it is kept out of the core SDK — apps that don't use it never link GoogleSignIn.

{% hint style="info" %}
The native in-app Google Sign-In sheet is available via **Swift Package Manager only**. CocoaPods apps use the built-in browser-based Google contacts flow described above — no extra package needed.
{% endhint %}

Add the `GrowSurfGoogleContacts` product from the `growsurf-ios-sdk-distribution` package to your app target (alongside `GrowSurfSDK`).

First complete the [Google Cloud setup](https://support.growsurf.com/article/343-how-to-set-up-google-contacts-address-book) to create your OAuth client and add your iOS Client ID and reversed-client-ID URL scheme to your GrowSurf campaign. The steps below are the additional in-app setup the in-app Google Sign-In sheet needs — without them the in-app sign-in will fail even when your campaign is configured correctly.

{% stepper %}
{% step %}
**Enable the in-app GoogleSignIn flow** at app startup, before opening a GrowSurf window that offers Google contacts import:

```swift
import GrowSurfGoogleContacts

GrowSurfGoogleContacts.enable()
```

{% endstep %}

{% step %}
**Register your Google reversed-client-ID URL scheme** in `Info.plist`.

Add a `CFBundleURLTypes` entry whose `CFBundleURLSchemes` value is your reversed client ID (the `REVERSED_CLIENT_ID` from your `GoogleService-Info.plist` / OAuth client, in the form `com.googleusercontent.apps.XXXXXXXX`).
{% endstep %}

{% step %}
**Forward incoming URLs to GrowSurf** from your app's URL-open handler so the Google Sign-In callback is handled:

```swift
// SwiftUI
.onOpenURL { url in
    GrowSurf.handleGoogleSignInURL(url)
}

// UIKit
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
    GrowSurf.handleGoogleSignInURL(url)
}
```

{% endstep %}
{% endstepper %}

Either way, the SDK requests only the `contacts.readonly` scope and imports the participant's primary Google connections.

***

## Log out

If your user logs out of your app, call [`shutdown()`](https://docs.growsurf.com/developer-tools/ios-sdk/api-reference#shutdown) to remove all participant data from the device:

```swift
try await growsurf.shutdown()
```

***

## Next steps

{% content-ref url="/pages/YE7Ni8qQb5eckfGra6D3" %}
[Attribution Providers](/developer-tools/ios-sdk/attribution-providers)
{% endcontent-ref %}

{% content-ref url="/pages/NfDPGxhzyFbz5HJzp01b" %}
[API Reference](/developer-tools/ios-sdk/api-reference)
{% endcontent-ref %}

{% content-ref url="/pages/slZUcKYhVJInEALri596" %}
[Models and Errors](/developer-tools/ios-sdk/models-and-errors)
{% endcontent-ref %}

{% content-ref url="/pages/exdoU1ymhoG3SfIjmIsO" %}
[Getting Started for Native Mobile](/getting-started-for-native-mobile)
{% endcontent-ref %}


# Attribution Providers

Configure direct deep links and attribution adapters for the GrowSurf iOS SDK.

On iOS, GrowSurf relies on your app or attribution provider to return the referral payload after install. Pass that payload into the SDK before calling `addReferredParticipant()`.

Unlike Android (which reads the Play Install Referrer for native deferred attribution via `handleDeferredDeepLink()`), iOS has no native deferred deep link equivalent, so deferred attribution is delegated to your attribution provider (e.g., Branch, AppsFlyer).

### Why iOS deferred is provider-specific

For a referral program, the deferred / cold-install path is the **primary** one — a referral targets people who don't yet have your app. When a friend taps a referral link, installs your app, then opens it for the first time (a **deferred** / cold install), iOS has no reliable native way to carry the referral across the install. iOS 14 (App Tracking Transparency removed the IDFA) and iOS 15 (Private Relay masks the Safari IP) broke the probabilistic device matching attribution providers previously relied on. Each provider now solves this differently, so **deferred setup is not interchangeable between providers** — follow the integration guide for yours.

| Provider                                                                        | iOS deferred mechanism                          | On by default?                  | What you must turn on                                                                                                                                                                        |
| ------------------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**Branch**](/integrations/branch#ios-deferred-deep-linking-new-installs)       | NativeLink (encrypted clipboard token)          | Yes, once NativeLink is enabled | Branch dashboard **Enable NativeLink** + a non-web-only link; call `checkPasteboardOnInstall()` before `initSession()` (iOS 16+: consider `BranchPasteControl`).                             |
| [**Adjust**](/integrations/adjust#ios-deferred-deep-linking-new-installs)       | LinkMe (clipboard token)                        | No (optional)                   | `ADJConfig.enableLinkMe()` (v5) / `setLinkMeEnabled(true)` (v4) + link tag `adj_linkme=1` or `linkme=1`; otherwise deferred is server-side/probabilistic.                                    |
| [**Singular**](/integrations/singular#ios-deferred-deep-linking-new-installs)   | Clipboard-Based DDL (clipboard token)           | No (optional, enterprise)       | `SingularConfig.clipboardAttribution = true` + Singular WebSDK on the landing page (ask your Singular CSM to enable); otherwise server-side/probabilistic.                                   |
| [**AppsFlyer**](/integrations/appsflyer#ios-deferred-deep-linking-new-installs) | Server-side Unified Deep Linking (no clipboard) | Yes                             | Implement the `deepLinkDelegate` / `didResolveDeepLink(_:)` callback; new installs receive `deep_link_value` + `deep_link_sub1`–`deep_link_sub10` within a \~15-min click-to-install window. |

In every case the GrowSurf SDK simply reads `grsf` out of whatever deep link your provider hands back. So GrowSurf deferred attribution survives a cold install only when (1) your provider's deferred path is enabled (above) **and** (2) the link your participants share carries `grsf`. The integration guides cover keeping `grsf` on the link; this table covers turning on the provider's deferred path.

{% hint style="info" %}
Any **clipboard-based** path (Branch NativeLink, Adjust LinkMe, Singular Clipboard-Based DDL) triggers Apple's one-time "Pasted from …" prompt on first launch on iOS 16+. AppsFlyer's server-side UDL does not use the clipboard and shows no prompt. Provider SDK APIs are version-specific — confirm exact method names against your installed provider SDK.

iOS deferred is **best-effort even when configured** — the user can decline the paste prompt, overwrite the clipboard before first launch, or tap from an in-app/non-Safari browser (AppsFlyer also has a \~15-minute click-to-install window) — so always pair it with a fallback such as manual referral-code entry. Android's Play Install Referrer is deterministic and not subject to these.
{% endhint %}

***

## Direct deep links

Use `handleDeepLink(_:)` when the installed app opens from a link that already contains `grsf`, which contains the referral code.

```swift
if let url {
    let attribution = try await growsurf.handleDeepLink(url)
}
```

{% hint style="info" %}
**Example accepted links:**

* `your-app://open?grsf=referrer_id`
* `https://example.com/app?grsf=referrer_id`
  {% endhint %}

{% hint style="info" %}
**Already support deep links?** If you use an attribution provider (Branch, AppsFlyer, Adjust, Singular) or otherwise open your app from links, this is already set up — just forward the opened URL to `handleDeepLink(url)`.

**Starting from scratch?** Register a custom URL scheme (`CFBundleURLSchemes` in `Info.plist`) — the quickest path, no domain needed — and/or configure Universal Links (Associated Domains entitlement) for nicer `https` links, which require a domain you control. Then call `handleDeepLink(url)` from your app's URL-open handler (SwiftUI `.onOpenURL` or `application(_:open:options:)`).
{% endhint %}

***

## Adapters

GrowSurf provides adapters for popular attribution providers. Choose your provider below, or use **Other** to pass a dictionary of attribution values from any other provider.

{% tabs %}
{% tab title="Adjust" %}

## Adjust adapter

Add the Adjust adapter:

{% tabs %}
{% tab title="CocoaPods" %}

```ruby
pod 'GrowSurfSDK/AdjustAttribution',
    :podspec => 'https://raw.githubusercontent.com/growsurf/growsurf-ios-sdk-distribution/v0.3.3/GrowSurfSDK.podspec'
```

{% endtab %}

{% tab title="Swift Package Manager" %}
Add the `GrowSurfAdjustAttribution` product alongside `GrowSurfSDK` from the public binary package repository:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution.git
```

For a `Package.swift` target:

```swift
dependencies: [
    .package(url: "https://github.com/growsurf/growsurf-ios-sdk-distribution.git", from: "0.3.3"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "GrowSurfSDK", package: "growsurf-ios-sdk-distribution"),
            .product(name: "GrowSurfAdjustAttribution", package: "growsurf-ios-sdk-distribution"),
        ]
    ),
]
```

{% endtab %}

{% tab title="Manual" %}
Download `GrowSurfAdjustAttribution.xcframework.zip` from the public release:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution/releases/tag/v0.3.3
```

Unzip it, drag `GrowSurfAdjustAttribution.xcframework` into your Xcode project alongside `GrowSurfSDK.xcframework`, and set it to **Embed & Sign** in your app target.
{% endtab %}
{% endtabs %}

Then pass the Adjust deferred deep link into GrowSurf:

```swift
import GrowSurfAdjustAttribution

try await GrowSurfAdjustAttribution.handle(adjustDeferredDeepLinkURL, sdk: growsurf)
```

The adapter accepts `URL` and `String` deep link values.

{% hint style="warning" %}
For **deferred** (no-app-installed) referrals on iOS, Adjust's clipboard path (**LinkMe**) is optional and off by default — enable it with `ADJConfig.enableLinkMe()` (v5) / `setLinkMeEnabled(true)` (v4) and tag your link `adj_linkme=1`/`linkme=1`; without it, deferred falls back to Adjust's server-side matching. See [Adjust - iOS Deferred Deep Linking](/integrations/adjust#ios-deferred-deep-linking-new-installs) for detailed instructions.
{% endhint %}
{% endtab %}

{% tab title="AppsFlyer" %}

## AppsFlyer adapter

Add the AppsFlyer adapter:

{% tabs %}
{% tab title="CocoaPods" %}

```ruby
pod 'GrowSurfSDK/AppsFlyerAttribution',
    :podspec => 'https://raw.githubusercontent.com/growsurf/growsurf-ios-sdk-distribution/v0.3.3/GrowSurfSDK.podspec'
```

{% endtab %}

{% tab title="Swift Package Manager" %}
Add the `GrowSurfAppsFlyerAttribution` product alongside `GrowSurfSDK` from the public binary package repository:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution.git
```

For a `Package.swift` target:

```swift
dependencies: [
    .package(url: "https://github.com/growsurf/growsurf-ios-sdk-distribution.git", from: "0.3.3"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "GrowSurfSDK", package: "growsurf-ios-sdk-distribution"),
            .product(name: "GrowSurfAppsFlyerAttribution", package: "growsurf-ios-sdk-distribution"),
        ]
    ),
]
```

{% endtab %}

{% tab title="Manual" %}
Download `GrowSurfAppsFlyerAttribution.xcframework.zip` from the public release:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution/releases/tag/v0.3.3
```

Unzip it, drag `GrowSurfAppsFlyerAttribution.xcframework` into your Xcode project alongside `GrowSurfSDK.xcframework`, and set it to **Embed & Sign** in your app target.
{% endtab %}
{% endtabs %}

Then pass AppsFlyer conversion data into GrowSurf:

```swift
import GrowSurfAppsFlyerAttribution

try await GrowSurfAppsFlyerAttribution.handle(appsFlyerParams, sdk: growsurf)
```

The adapter accepts `[String: String]`, `[String: Any]`, and `[AnyHashable: Any]` payloads.

{% hint style="warning" %}
For **deferred** (no-app-installed) referrals on iOS, AppsFlyer has **no clipboard path** — the referral arrives via server-side **Unified Deep Linking** (`deepLinkDelegate` / `didResolveDeepLink(_:)`) within a \~15-minute lookback, carrying `deep_link_value` and `deep_link_sub1`–`deep_link_sub10`. See [AppsFlyer - iOS Deferred Deep Linking](/integrations/appsflyer#ios-deferred-deep-linking-new-installs) for detailed instructions.
{% endhint %}
{% endtab %}

{% tab title="Branch" %}

## Branch adapter

Add the Branch adapter:

{% tabs %}
{% tab title="CocoaPods" %}

```ruby
pod 'GrowSurfSDK/BranchAttribution',
    :podspec => 'https://raw.githubusercontent.com/growsurf/growsurf-ios-sdk-distribution/v0.3.3/GrowSurfSDK.podspec'
```

{% endtab %}

{% tab title="Swift Package Manager" %}
Add the `GrowSurfBranchAttribution` product alongside `GrowSurfSDK` from the public binary package repository:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution.git
```

For a `Package.swift` target:

```swift
dependencies: [
    .package(url: "https://github.com/growsurf/growsurf-ios-sdk-distribution.git", from: "0.3.3"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "GrowSurfSDK", package: "growsurf-ios-sdk-distribution"),
            .product(name: "GrowSurfBranchAttribution", package: "growsurf-ios-sdk-distribution"),
        ]
    ),
]
```

{% endtab %}

{% tab title="Manual" %}
Download `GrowSurfBranchAttribution.xcframework.zip` from the public release:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution/releases/tag/v0.3.3
```

Unzip it, drag `GrowSurfBranchAttribution.xcframework` into your Xcode project alongside `GrowSurfSDK.xcframework`, and set it to **Embed & Sign** in your app target.
{% endtab %}
{% endtabs %}

Then pass Branch callback data into GrowSurf:

```swift
import GrowSurfBranchAttribution

try await GrowSurfBranchAttribution.handle(branchParams, sdk: growsurf)
```

The adapter accepts `[String: String]`, `[String: Any]`, and `[AnyHashable: Any]` payloads.

{% hint style="warning" %}
For **deferred** (no-app-installed) referrals on iOS, Branch requires **NativeLink**: enable it in the Branch dashboard (Configuration → Enable NativeLink) with a non-web-only link, and call `Branch.getInstance().checkPasteboardOnInstall()` **before** `initSession()` so the SDK reads the NativeLink clipboard token on first launch (iOS 14+ removed the fingerprint matching used previously; on iOS 16+ Branch also offers `BranchPasteControl` as a user-tappable alternative to the silent read). See [Branch - iOS Deferred Deep Linking](/integrations/branch#ios-deferred-deep-linking-new-installs) for detailed instructions.
{% endhint %}
{% endtab %}

{% tab title="Singular" %}

## Singular adapter

Add the Singular adapter:

{% tabs %}
{% tab title="CocoaPods" %}

```ruby
pod 'GrowSurfSDK/SingularAttribution',
    :podspec => 'https://raw.githubusercontent.com/growsurf/growsurf-ios-sdk-distribution/v0.3.3/GrowSurfSDK.podspec'
```

{% endtab %}

{% tab title="Swift Package Manager" %}
Add the `GrowSurfSingularAttribution` product alongside `GrowSurfSDK` from the public binary package repository:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution.git
```

For a `Package.swift` target:

```swift
dependencies: [
    .package(url: "https://github.com/growsurf/growsurf-ios-sdk-distribution.git", from: "0.3.3"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "GrowSurfSDK", package: "growsurf-ios-sdk-distribution"),
            .product(name: "GrowSurfSingularAttribution", package: "growsurf-ios-sdk-distribution"),
        ]
    ),
]
```

{% endtab %}

{% tab title="Manual" %}
Download `GrowSurfSingularAttribution.xcframework.zip` from the public release:

```
https://github.com/growsurf/growsurf-ios-sdk-distribution/releases/tag/v0.3.3
```

Unzip it, drag `GrowSurfSingularAttribution.xcframework` into your Xcode project alongside `GrowSurfSDK.xcframework`, and set it to **Embed & Sign** in your app target.
{% endtab %}
{% endtabs %}

Then pass Singular callback data into GrowSurf:

```swift
import GrowSurfSingularAttribution

try await GrowSurfSingularAttribution.handle(singularParams, sdk: growsurf)
```

The adapter accepts `[String: String]`, `[String: Any]`, `[AnyHashable: Any]`, `URL`, and `String` payloads. It parses GrowSurf referral keys from Singular deep link, deferred deep link, and passthrough fields such as `_dl`, `_ddl`, and `_p`.

{% hint style="warning" %}
For **deferred** (no-app-installed) referrals on iOS, Singular **Clipboard-Based DDL** is an optional, enterprise feature requiring `SingularConfig.clipboardAttribution = true` and the Singular WebSDK on your landing page (enabled via your Singular CSM); otherwise deferred is server-side/probabilistic. See [Singular - iOS Deferred Deep Linking](/integrations/singular#ios-deferred-deep-linking-new-installs) for detailed instructions.
{% endhint %}
{% endtab %}

{% tab title="Other" %}

## Manual attribution parameters

Use `handleAttributionParameters(_:provider:)` for any other provider that can return a dictionary of attribution values. No extra adapter install is required.

```swift
try await growsurf.handleAttributionParameters(
    [
        "grsf": "referrer_id",
        "click_id": "click_123",
    ],
    provider: "your-provider-name"
)
```

{% endtab %}
{% endtabs %}

***

## Accepted attribution keys

| Key          | Description                                                                                      |
| ------------ | ------------------------------------------------------------------------------------------------ |
| `grsf`       | Preferred GrowSurf referrer ID.                                                                  |
| `ref`        | Alternate referrer ID.                                                                           |
| `referredBy` | Alternate referrer ID.                                                                           |
| `provider`   | Attribution provider name. Ignored when the SDK method receives an explicit `provider` argument. |
| `clickId`    | Provider click ID metadata.                                                                      |
| `click_id`   | Provider click ID metadata.                                                                      |
| `unique`     | Optional boolean string: `true` or `false`.                                                      |

The SDK also parses values nested inside URL-like payload fields. For example, a provider value of `https://example.com/?grsf=referrer_id&click_id=click_123` can still produce GrowSurf attribution. If a provider returns a GrowSurf-hosted share URL such as `https://grow.surf/share/:campaignId/:referrerId`, the SDK uses the participant value from the path.


# API Reference

Public methods, attribution adapters, and models exposed by the GrowSurf iOS SDK.

{% hint style="info" %}
If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

Use this page to look up individual GrowSurf iOS SDK methods. All SDK methods use Swift concurrency unless otherwise noted.

{% hint style="warning" %}
Use the Mobile SDK public key in your app. Do not embed your secret REST API key in an iOS app.
{% endhint %}

## SDK LIFECYCLE ↓

### Configure

Call this once before using GrowSurf. It connects the SDK to your GrowSurf campaign and Mobile SDK public key.

```swift
let growsurf = GrowSurf.configure(
    campaignId: "abc123",
    publicKey: "pk_mobile"
)
```

| Parameter        | Data Type | Description                                                                                  |
| ---------------- | --------- | -------------------------------------------------------------------------------------------- |
| **`campaignId`** | `String`  | (Required) Your GrowSurf program ID.                                                         |
| **`publicKey`**  | `String`  | (Required) Your Mobile SDK public key.                                                       |
| **`baseURL`**    | `URL`     | (Optional) Custom Mobile SDK API base URL. Defaults to `https://api.growsurf.com/mobile/v2`. |

Returns a configured `GrowSurf` instance.

#### **Example use**

```swift
import GrowSurfSDK

let growsurf = GrowSurf.configure(
    campaignId: "p9josq",
    publicKey: "pk_mobile"
)
```

Optionally, for advanced apps, initialize directly with explicit stores or a custom transport. Pass the production stores shown below, or your own conformances to the public store protocols:

```swift
let growsurf = GrowSurf(
    configuration: GrowSurfConfiguration(
        campaignId: "abc123",
        publicKey: "pk_mobile"
    ),
    tokenStore: GrowSurfKeychainTokenStore(),
    attributionStore: GrowSurfUserDefaultsAttributionStore(),
    mobileInstanceIdStore: GrowSurfUserDefaultsMobileInstanceIdStore()
)
```

***

### Set participant token

Use this after your backend creates a mobile participant token for a signed-in user. It lets participant-scoped SDK calls load or update that participant's data.

```swift
try await growsurf.setParticipantToken(participantToken)
```

| Parameter   | Data Type | Description                                                                                         |
| ----------- | --------- | --------------------------------------------------------------------------------------------------- |
| **`token`** | `String`  | (Required) A mobile participant token returned by your backend or by a participant creation method. |

Returns `Void`.

#### **Example use**

```swift
try await growsurf.setParticipantToken(participantToken)
```

{% hint style="info" %}
Use this method with tokens created by the REST API mobile participant token endpoint after a user is already signed in.
{% endhint %}

***

### Get participant token

Returns the participant token currently held by the SDK, or `nil` if none is stored. Useful right after the GrowSurf window's `ParticipantFields` signup flow so your app can persist the freshly minted token for the user's next session.

```swift
try await growsurf.participantToken()
```

Returns `String?`.

#### **Example use**

```swift
if let token = try await growsurf.participantToken() {
    // Persist the token to your backend so the user stays signed in to GrowSurf.
}
```

***

### Get current participant ID

Returns the current participant's ID decoded from the stored participant token, or `nil` if no participant token is set.

```swift
let participantId = try await growsurf.currentParticipantId()
```

Returns `String?`.

#### **Example use**

```swift
if let participantId = try await growsurf.currentParticipantId() {
    print("Current participant:", participantId)
}
```

***

### Get mobile instance ID

Returns the app-install ID the SDK sends with participant creation for mobile anti-fraud. You usually only need this if your backend creates mobile participant tokens and needs to pass the same ID to GrowSurf.

```swift
try await growsurf.mobileInstanceId()
```

Returns a lowercase UUID `String`.

#### **Example use**

```swift
let mobileInstanceId = try await growsurf.mobileInstanceId()
```

{% hint style="info" %}
Participant creation methods send `mobileInstanceId` automatically. Read it manually only when your backend creates a mobile participant token and needs to pass `mobileInstanceId` to the REST API.
{% endhint %}

***

### Shutdown

Call this when a user signs out or you need to reset GrowSurf state on the device. It clears the stored session token, participant token, and pending attribution.

```swift
try await growsurf.shutdown()
```

Returns `Void`.

#### **Example use**

```swift
try await growsurf.shutdown()
```

***

## CAMPAIGNS ↓

### Get campaign

Use this to read campaign details and rewards for the configured GrowSurf program. The SDK creates or uses a session token before calling GrowSurf.

```swift
try await growsurf.getCampaign()
```

Returns `GrowSurfCampaign`.

#### **Example use**

```swift
let campaign = try await growsurf.getCampaign()
print(campaign.id)
print(campaign.rewards)
```

***

### Get leaderboard

Use this to show leaderboard rows in a custom referral screen. You can page through results with page or cursor parameters.

```swift
try await growsurf.getLeaderboard(
    limit: 20,
    page: 1,
    offsetKey: nil,
    leaderboardType: nil
)
```

| Parameter             | Data Type | Description                                        |
| --------------------- | --------- | -------------------------------------------------- |
| **`limit`**           | `Int?`    | (Optional) Number of rows to return.               |
| **`page`**            | `Int?`    | (Optional) Page number.                            |
| **`offsetKey`**       | `String?` | (Optional) Cursor key for offset-based pagination. |
| **`leaderboardType`** | `String?` | (Optional) Leaderboard type filter.                |

Returns `GrowSurfLeaderboardResponse`.

#### **Example use**

```swift
let leaderboard = try await growsurf.getLeaderboard(limit: 10)
for row in leaderboard.participants {
    print(row.rank as Any, row.email as Any)
}
```

***

## GROWSURF WINDOW ↓

### Present GrowSurf window

Call this from your own button, menu item, or referral screen to open GrowSurf's native SwiftUI referral window.

{% hint style="info" %}
The native GrowSurf window uses the GrowSurf window settings from your dashboard. This method is available on iOS.
{% endhint %}

```swift
growsurf.presentGrowSurfWindow(
    from: viewController,
    identity: .existingParticipantToken(participantToken),
    theme: GrowSurfWindowTheme(),
    callbacks: GrowSurfWindowCallbacks()
)
```

| Parameter       | Data Type                 | Description                                                                                                                                                          |
| --------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`from`**      | `UIViewController`        | (Required) The view controller that presents the native window.                                                                                                      |
| **`identity`**  | `GrowSurfWindowIdentity`  | (Optional) How the window should identify the current user. Defaults to `.anonymous`.                                                                                |
| **`theme`**     | `GrowSurfWindowTheme`     | (Optional) Native presentation and theme overrides.                                                                                                                  |
| **`callbacks`** | `GrowSurfWindowCallbacks` | (Optional) Event callbacks for window open, close, participant creation (from the signup form), share tracking, invite sending, payout/settings actions, and errors. |

Returns `GrowSurfWindowController` — call `close()` on it to dismiss the window programmatically.

#### **Example use**

```swift
let windowController = growsurf.presentGrowSurfWindow(
    from: self,
    identity: .existingParticipantToken(participantToken),
    theme: GrowSurfWindowTheme(
        primaryColorHex: "#13795B",
        presentationStyle: .automatic
    ),
    callbacks: GrowSurfWindowCallbacks(
        onShareTracked: { type in
            print("Share tracked:", type)
        },
        onParticipantCreated: { participant, participantToken in
            print("Participant:", participant.id)
        },
        onError: { error in
            print("GrowSurf window error:", error)
        }
    )
)
```

***

### Get GrowSurf window

Use this when you are building your own referral screen instead of showing the native GrowSurf window. It returns the campaign, participant, share, reward, leaderboard, and affiliate data used by the window.

```swift
try await growsurf.getGrowSurfWindow(identity: .anonymous)
```

| Parameter      | Data Type                | Description                                           |
| -------------- | ------------------------ | ----------------------------------------------------- |
| **`identity`** | `GrowSurfWindowIdentity` | (Optional) Window identity. Defaults to `.anonymous`. |

Returns `GrowSurfWindowResponse`.

#### **Example use**

```swift
let window = try await growsurf.getGrowSurfWindow(
    identity: .existingParticipantToken(participantToken)
)

let shareUrl = window.participant?.shareUrl ?? window.share?.preferredUrl ?? window.share?.fallbackUrl
```

{% hint style="info" %}
Use `participant.shareUrl` as the customer-facing referral link when a participant is available. Fall back to `share.preferredUrl` or `share.fallbackUrl` only for rendering.
{% endhint %}

***

## ATTRIBUTION ↓

### Handle deep link

Call this when your app opens from a referral deep link. If the URL contains `grsf`, `ref`, or `referredBy`, the SDK saves the attribution so you can apply it when the user signs up.

```swift
try await growsurf.handleDeepLink(url)
```

| Parameter | Data Type | Description                                      |
| --------- | --------- | ------------------------------------------------ |
| **`url`** | `URL`     | (Required) The deep link URL opened by your app. |

Returns `GrowSurfAttribution?`. Returns `nil` when no GrowSurf referral value is found.

#### **Example use**

```swift
if let url {
    let attribution = try await growsurf.handleDeepLink(url)
    print(attribution?.referredBy as Any)
}
```

***

### Handle attribution parameters

Call this from an attribution provider callback, such as Branch, Adjust, AppsFlyer, or Singular. If the parameters include `grsf`, `ref`, or `referredBy` directly or inside URL-like values, the SDK saves the attribution for signup.

```swift
try await growsurf.handleAttributionParameters(parameters, provider: "branch")
```

| Parameter        | Data Type          | Description                                                                                                                                     |
| ---------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **`parameters`** | `[String: String]` | (Required) Provider callback parameters. The SDK recognizes direct values and nested URL-like values containing `grsf`, `ref`, or `referredBy`. |
| **`provider`**   | `String?`          | (Optional) Attribution provider name, such as `branch`, `adjust`, `appsflyer`, or `singular`.                                                   |

Returns `GrowSurfAttribution?`. Returns `nil` when no GrowSurf referral value is found.

#### **Example use**

```swift
let attribution = try await growsurf.handleAttributionParameters(
    [
        "grsf": "referrer_id",
        "click_id": "click_123",
        "unique": "true",
    ],
    provider: "branch"
)
```

***

### Get pending attribution

Use this to inspect referral attribution saved on this device before creating or signing in a participant.

```swift
try await growsurf.pendingAttribution()
```

Returns `GrowSurfAttribution?`.

#### **Example use**

```swift
if let attribution = try await growsurf.pendingAttribution() {
    print("Pending referrer:", attribution.referredBy as Any)
}
```

***

### Clear pending attribution

Clear saved referral attribution when it should no longer apply, such as after you handle it or when a different user signs in.

```swift
try await growsurf.clearPendingAttribution()
```

Returns `Void`.

#### **Example use**

```swift
try await growsurf.clearPendingAttribution()
```

***

### Validate referrer

Use this to check whether a saved or supplied referrer is valid before you show a referred state or create a participant.

```swift
try await growsurf.validateReferrer(attribution)
```

| Parameter         | Data Type              | Description                                                                                           |
| ----------------- | ---------------------- | ----------------------------------------------------------------------------------------------------- |
| **`attribution`** | `GrowSurfAttribution?` | (Optional) Attribution to validate. If omitted, the SDK validates locally stored pending attribution. |

Returns `GrowSurfValidateReferrerResponse`.

#### **Example use**

{% tabs %}
{% tab title="Pending attribution" %}

```swift
let validation = try await growsurf.validateReferrer()

if validation.valid {
    print("Valid referrer:", validation.referredBy as Any)
}
```

{% endtab %}

{% tab title="Explicit referrer" %}

```swift
let validation = try await growsurf.validateReferrer(referredBy: "referrer_id")

if validation.valid {
    print("Valid referrer")
}
```

{% endtab %}
{% endtabs %}

***

## PARTICIPANTS ↓

### Add referred participant

Use this for referred signups. The SDK looks for a saved or explicit referrer, validates it, and only creates the participant when the referral is valid.

```swift
try await growsurf.addReferredParticipant(input)
```

| Parameter   | Data Type                  | Description                                                                                                 |
| ----------- | -------------------------- | ----------------------------------------------------------------------------------------------------------- |
| **`input`** | `GrowSurfParticipantInput` | (Required) Participant fields, optional explicit `referredBy`, optional attribution, and optional metadata. |

Returns `GrowSurfAddReferredParticipantResponse`.

#### **Example use**

```swift
let result = try await growsurf.addReferredParticipant(
    GrowSurfParticipantInput(
        email: "person@example.com",
        firstName: "Ada",
        lastName: "Lovelace",
        metadata: ["plan": "pro"]
    )
)

if result.added {
    print("Referred participant:", result.participant?.id as Any)
} else {
    print("Not added:", result.notAddedReason as Any)
}
```

{% hint style="info" %}
If no participant is added, `notAddedReason` will be `no_referrer`, `invalid_referrer`, or `participant_already_exists`.
{% endhint %}

***

### Add participant

Use this for public signup flows where the SDK can create a participant even without a referral. It sends pending attribution when available, stores the returned participant token when present, and includes the SDK-generated mobile instance ID for anti-fraud.

```swift
try await growsurf.addParticipant(input)
```

| Parameter   | Data Type                  | Description                                                                 |
| ----------- | -------------------------- | --------------------------------------------------------------------------- |
| **`input`** | `GrowSurfParticipantInput` | (Required) Participant fields, optional attribution, and optional metadata. |

Returns `GrowSurfCreateParticipantResponse`.

#### **Example use**

```swift
let response = try await growsurf.addParticipant(
    GrowSurfParticipantInput(
        email: "person@example.com",
        firstName: "Ada",
        lastName: "Lovelace",
        metadata: ["plan": "pro"]
    )
)

if let participant = response.participant {
    print("Created participant:", participant.id)
}
```

{% hint style="info" %}
Use this method for public signup flows where the SDK should create a new participant. If the email already belongs to an existing participant, GrowSurf returns `requiresParticipantToken: true` and does not return a participant token. For signed-in or existing users, use an SDK-issued participant token you already have, or create a mobile participant token from your backend, then pass it to `setParticipantToken(_:)` or `.existingParticipantToken(...)`.
{% endhint %}

***

### Get participant

Use this after you have a participant token to load the participant's referral data, including their referral link and counts.

```swift
try await growsurf.getParticipant()
```

Returns `GrowSurfParticipant`.

#### **Example use**

```swift
let participant = try await growsurf.getParticipant()
print(participant.shareUrl as Any)
```

***

### Update participant

Use this when your app lets a participant update profile fields, such as first name, last name, or metadata.

```swift
try await growsurf.updateParticipant(with: input)
```

| Parameter  | Data Type                        | Description                                                                   |
| ---------- | -------------------------------- | ----------------------------------------------------------------------------- |
| **`with`** | `GrowSurfParticipantUpdateInput` | (Required) Fields to update, such as `firstName`, `lastName`, and `metadata`. |

Returns `GrowSurfParticipant`.

#### **Example use**

```swift
let participant = try await growsurf.updateParticipant(
    with: GrowSurfParticipantUpdateInput(
        firstName: "Ada",
        lastName: "Lovelace",
        metadata: ["plan": "enterprise"]
    )
)
```

***

### Update vanity links

Use this when your app lets a participant manage multiple custom referral link keys at once.

```swift
try await growsurf.updateVanityLinks(vanityKeys: ["ada", "ada-pro"])
```

| Parameter        | Data Type  | Description                                               |
| ---------------- | ---------- | --------------------------------------------------------- |
| **`vanityKeys`** | `[String]` | (Required) Vanity keys to associate with the participant. |

Returns `GrowSurfParticipant`.

#### **Example use**

```swift
let participant = try await growsurf.updateVanityLinks(
    vanityKeys: ["ada", "ada-pro"]
)
```

***

## REFERRALS AND INVITES ↓

### Get participant referrals

Use this to show who a participant has referred and the status of each referral.

```swift
try await growsurf.getParticipantReferrals(
    limit: 20,
    offset: 0
)
```

| Parameter    | Data Type | Description                               |
| ------------ | --------- | ----------------------------------------- |
| **`limit`**  | `Int?`    | (Optional) Number of referrals to return. |
| **`offset`** | `Int?`    | (Optional) Offset for pagination.         |

Returns `GrowSurfReferralsResponse`.

#### **Example use**

```swift
let response = try await growsurf.getParticipantReferrals(
    limit: 20
)

for referral in response.referrals {
    print(referral.email as Any, referral.referralStatus as Any)
}
```

***

### Send invites

Use this to send referral invite emails from a participant's referral screen.

```swift
try await growsurf.sendInvites(
    emailAddresses: ["friend@example.com"],
    messageText: "Join me on GrowSurf",
    subjectText: "You're invited"
)
```

| Parameter            | Data Type  | Description                           |
| -------------------- | ---------- | ------------------------------------- |
| **`emailAddresses`** | `[String]` | (Required) Email addresses to invite. |
| **`messageText`**    | `String`   | (Required) Invite message body.       |
| **`subjectText`**    | `String?`  | (Optional) Invite email subject.      |

Returns `GrowSurfInviteResponse`.

#### **Example use**

```swift
let response = try await growsurf.sendInvites(
    emailAddresses: ["friend@example.com"],
    messageText: "Try this app with my referral link.",
    subjectText: "Join me"
)
```

***

### Track share

Call this after a participant shares their referral link from your UI. GrowSurf records the share type, such as `copy`, `email`, `sms`, or a social channel.

```swift
try await growsurf.trackShare(type: "copy")
```

| Parameter  | Data Type | Description                                                                                                               |
| ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------- |
| **`type`** | `String`  | (Required) Share type, such as `copy`, `email`, `sms`, or a social channel type returned by the GrowSurf window response. |

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```swift
try await growsurf.trackShare(type: "copy")
```

***

## REFERRAL PROGRAMS ↓

### Trigger referral

<mark style="color:orange;">Referral programs only</mark>

Use this when a referred participant completes the in-app action that should count as a referral conversion. For purchases or other high-trust events, trigger referral credit from your backend instead.

```swift
try await growsurf.triggerReferral()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```swift
let response = try await growsurf.triggerReferral()
```

{% hint style="warning" %}
For server-verified purchases, subscriptions, or other high-trust reward events, trigger referral credit from your backend using the REST API or a GrowSurf integration instead of from the app.
{% endhint %}

***

### Get participant rewards

<mark style="color:orange;">Referral programs only</mark>

Use this to show the rewards a participant has earned or can track inside your app.

```swift
try await growsurf.getParticipantRewards(
    limit: 20,
    nextId: nil
)
```

| Parameter    | Data Type | Description                             |
| ------------ | --------- | --------------------------------------- |
| **`limit`**  | `Int?`    | (Optional) Number of rewards to return. |
| **`nextId`** | `String?` | (Optional) Cursor ID for the next page. |

Returns `GrowSurfRewardsResponse`.

#### **Example use**

```swift
let rewards = try await growsurf.getParticipantRewards(
    limit: 20
)
```

***

### Mark participant rewards read

<mark style="color:orange;">Referral programs only</mark>

Call this after showing reward notifications so GrowSurf can clear the participant's unread reward state.

```swift
try await growsurf.markParticipantRewardsRead()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```swift
try await growsurf.markParticipantRewardsRead()
```

***

### Get participant referral summary

<mark style="color:orange;">Referral programs only</mark>

Use this for referral programs to show a participant's high-level referral stats (referrals, leads, expired referrals, clicks, rewards earned, pending rewards, invites sent).

```swift
try await growsurf.getParticipantReferralSummary()
```

Returns `GrowSurfReferralSummary`.

#### **Example use**

```swift
let summary = try await growsurf.getParticipantReferralSummary()
print(summary.referrals as Any)
```

***

## AFFILIATE PROGRAMS ↓

### Get participant commissions

<mark style="color:orange;">Affiliate programs only</mark>

Use this for affiliate programs to show a participant's commission history.

```swift
try await growsurf.getParticipantCommissions(
    limit: 20,
    nextId: nil
)
```

| Parameter    | Data Type | Description                                 |
| ------------ | --------- | ------------------------------------------- |
| **`limit`**  | `Int?`    | (Optional) Number of commissions to return. |
| **`nextId`** | `String?` | (Optional) Cursor ID for the next page.     |

Returns `GrowSurfCommissionsResponse`.

#### **Example use**

```swift
let commissions = try await growsurf.getParticipantCommissions(
    limit: 20
)
```

***

### Mark participant commissions read

<mark style="color:orange;">Affiliate programs only</mark>

Call this after showing commission notifications so GrowSurf can clear the participant's unread commission state.

```swift
try await growsurf.markParticipantCommissionsRead()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```swift
try await growsurf.markParticipantCommissionsRead()
```

***

### Get participant payouts

<mark style="color:orange;">Affiliate programs only</mark>

Use this for affiliate programs to show a participant's payout history.

```swift
try await growsurf.getParticipantPayouts(
    limit: 20,
    nextId: nil
)
```

| Parameter    | Data Type | Description                             |
| ------------ | --------- | --------------------------------------- |
| **`limit`**  | `Int?`    | (Optional) Number of payouts to return. |
| **`nextId`** | `String?` | (Optional) Cursor ID for the next page. |

Returns `GrowSurfPayoutsResponse`.

#### **Example use**

```swift
let payouts = try await growsurf.getParticipantPayouts(
    limit: 20
)
```

***

### Mark participant payouts read

<mark style="color:orange;">Affiliate programs only</mark>

Call this after showing payout notifications so GrowSurf can clear the participant's unread payout state.

```swift
try await growsurf.markParticipantPayoutsRead()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```swift
try await growsurf.markParticipantPayoutsRead()
```

***

### Get participant affiliate summary

<mark style="color:orange;">Affiliate programs only</mark>

Use this for affiliate programs to show a participant's high-level affiliate stats, such as referral revenue, total paid out, and upcoming payout.

```swift
try await growsurf.getParticipantAffiliateSummary()
```

Returns `GrowSurfAffiliateSummary`.

#### **Example use**

```swift
let summary = try await growsurf.getParticipantAffiliateSummary()
print(summary.upcomingPayout as Any)
```

***

### Request PayPal confirm email

<mark style="color:orange;">Affiliate programs only</mark>

Use this when your affiliate program needs the participant to confirm their PayPal email before payouts can continue.

```swift
try await growsurf.requestPaypalConfirmEmail()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```swift
let response = try await growsurf.requestPaypalConfirmEmail()
```

***

### Request tax info session

Use this when the campaign requires tax documentation and the participant needs to complete or resubmit their W-9 / W-8 form before rewards or payouts can continue. It starts a secure hosted tax-form session and returns the hosted URL to open in an in-app browser, plus the participant's new tax status. The native GrowSurf window calls this automatically from its Tax Forms settings row; call it yourself only if you build a custom settings UI.

```swift
try await growsurf.requestTaxInfoSession()
```

Returns `GrowSurfTaxSessionResponse`.

#### **Example use**

```swift
let session = try await growsurf.requestTaxInfoSession()
if let urlString = session.hostedUrl, let url = URL(string: urlString) {
    await UIApplication.shared.open(url)
}
```

{% hint style="info" %}
GrowSurf never stores participant tax IDs. The W-9 / W-8 is completed on a hosted page served by GrowSurf's IRS-authorized e-file partner.
{% endhint %}

***

## ATTRIBUTION ADAPTERS ↓

### Branch attribution adapter

Use this helper when Branch returns attribution data. It normalizes Branch payloads and can store the resulting GrowSurf attribution on the SDK.

```swift
GrowSurfBranchAttribution.normalize(parameters)
try await GrowSurfBranchAttribution.handle(parameters, sdk: growsurf)
```

| Method                                               | Description                                                                       |
| ---------------------------------------------------- | --------------------------------------------------------------------------------- |
| **`normalize(_ parameters: [String: String])`**      | Parses a string dictionary and returns `GrowSurfAttribution?` without storing it. |
| **`normalize(_ parameters: [String: Any])`**         | Converts a mixed dictionary, then parses attribution without storing it.          |
| **`normalize(_ parameters: [AnyHashable: Any])`**    | Converts a hashable-key dictionary, then parses attribution without storing it.   |
| **`handle(_ parameters: [String: String], sdk:)`**   | Parses and stores attribution on the provided SDK instance.                       |
| **`handle(_ parameters: [String: Any], sdk:)`**      | Converts, parses, and stores attribution on the provided SDK instance.            |
| **`handle(_ parameters: [AnyHashable: Any], sdk:)`** | Converts, parses, and stores attribution on the provided SDK instance.            |

#### **Example use**

```swift
import GrowSurfBranchAttribution

try await GrowSurfBranchAttribution.handle(
    branchParams,
    sdk: growsurf
)
```

***

### Adjust attribution adapter

Use this helper when Adjust returns a deep link. It normalizes the URL and can store the resulting GrowSurf attribution on the SDK.

```swift
GrowSurfAdjustAttribution.normalize(url)
try await GrowSurfAdjustAttribution.handle(url, sdk: growsurf)
```

| Method                                  | Description                                                         |
| --------------------------------------- | ------------------------------------------------------------------- |
| **`normalize(_ url: URL)`**             | Parses a URL and returns `GrowSurfAttribution?` without storing it. |
| **`normalize(_ urlString: String)`**    | Parses a URL string or encoded URL string without storing it.       |
| **`handle(_ url: URL, sdk:)`**          | Parses and stores attribution on the provided SDK instance.         |
| **`handle(_ urlString: String, sdk:)`** | Parses and stores attribution on the provided SDK instance.         |

#### **Example use**

```swift
import GrowSurfAdjustAttribution

try await GrowSurfAdjustAttribution.handle(
    adjustDeeplinkURL,
    sdk: growsurf
)
```

***

### AppsFlyer attribution adapter

Use this helper when AppsFlyer returns conversion or deep link data. It normalizes the payload and can store the resulting GrowSurf attribution on the SDK.

```swift
GrowSurfAppsFlyerAttribution.normalize(parameters)
try await GrowSurfAppsFlyerAttribution.handle(parameters, sdk: growsurf)
```

| Method                                               | Description                                                                       |
| ---------------------------------------------------- | --------------------------------------------------------------------------------- |
| **`normalize(_ parameters: [String: String])`**      | Parses a string dictionary and returns `GrowSurfAttribution?` without storing it. |
| **`normalize(_ parameters: [String: Any])`**         | Converts a mixed dictionary, then parses attribution without storing it.          |
| **`normalize(_ parameters: [AnyHashable: Any])`**    | Converts a hashable-key dictionary, then parses attribution without storing it.   |
| **`handle(_ parameters: [String: String], sdk:)`**   | Parses and stores attribution on the provided SDK instance.                       |
| **`handle(_ parameters: [String: Any], sdk:)`**      | Converts, parses, and stores attribution on the provided SDK instance.            |
| **`handle(_ parameters: [AnyHashable: Any], sdk:)`** | Converts, parses, and stores attribution on the provided SDK instance.            |

#### **Example use**

```swift
import GrowSurfAppsFlyerAttribution

try await GrowSurfAppsFlyerAttribution.handle(
    conversionData,
    sdk: growsurf
)
```

***

### Singular attribution adapter

Use this helper when Singular returns callback parameters or deep link values. It normalizes the payload and can store the resulting GrowSurf attribution on the SDK.

```swift
GrowSurfSingularAttribution.normalize(parameters)
try await GrowSurfSingularAttribution.handle(parameters, sdk: growsurf)
```

| Method                                               | Description                                                                       |
| ---------------------------------------------------- | --------------------------------------------------------------------------------- |
| **`normalize(_ parameters: [String: String])`**      | Parses a string dictionary and returns `GrowSurfAttribution?` without storing it. |
| **`normalize(_ parameters: [String: Any])`**         | Converts a mixed dictionary, then parses attribution without storing it.          |
| **`normalize(_ parameters: [AnyHashable: Any])`**    | Converts a hashable-key dictionary, then parses attribution without storing it.   |
| **`normalize(_ url: URL)`**                          | Parses a URL without storing it.                                                  |
| **`normalize(_ urlString: String)`**                 | Parses a URL string or encoded URL string without storing it.                     |
| **`handle(_ parameters: [String: String], sdk:)`**   | Parses and stores attribution on the provided SDK instance.                       |
| **`handle(_ parameters: [String: Any], sdk:)`**      | Converts, parses, and stores attribution on the provided SDK instance.            |
| **`handle(_ parameters: [AnyHashable: Any], sdk:)`** | Converts, parses, and stores attribution on the provided SDK instance.            |
| **`handle(_ url: URL, sdk:)`**                       | Parses and stores attribution on the provided SDK instance.                       |
| **`handle(_ urlString: String, sdk:)`**              | Parses and stores attribution on the provided SDK instance.                       |

#### **Example use**

```swift
import GrowSurfSingularAttribution

try await GrowSurfSingularAttribution.handle(
    singularPayload,
    sdk: growsurf
)
```

***

## UTILITIES ↓

### Normalize attribution parameters

Use this when you need to read GrowSurf attribution from raw provider parameters without storing it. It looks for `grsf`, `ref`, or `referredBy` directly and inside URL-like values.

```swift
GrowSurfAttributionNormalizer.normalize(
    parameters: parameters,
    provider: "branch"
)
```

| Parameter        | Data Type          | Description                                                                                |
| ---------------- | ------------------ | ------------------------------------------------------------------------------------------ |
| **`parameters`** | `[String: String]` | (Required) Raw parameters. The normalizer checks direct fields and URL-like nested values. |
| **`provider`**   | `String?`          | (Optional) Provider name to attach to the attribution result.                              |

Returns `GrowSurfAttribution?`.

#### **Example use**

```swift
let attribution = GrowSurfAttributionNormalizer.normalize(
    parameters: [
        "deep_link_value": "https://example.com/signup?grsf=referrer_id",
        "click_id": "click_123",
    ],
    provider: "appsflyer"
)
```

***

### Normalize attribution URL

Use this when you need to parse a URL for `grsf`, `ref`, or `referredBy` without storing attribution on the SDK.

```swift
GrowSurfAttributionNormalizer.normalize(url: url, provider: "adjust")
```

| Parameter      | Data Type | Description                                                   |
| -------------- | --------- | ------------------------------------------------------------- |
| **`url`**      | `URL`     | (Required) URL to parse.                                      |
| **`provider`** | `String?` | (Optional) Provider name to attach to the attribution result. |

Returns `GrowSurfAttribution?`.

#### **Example use**

```swift
let attribution = GrowSurfAttributionNormalizer.normalize(
    url: URL(string: "https://example.com/signup?grsf=referrer_id")!,
    provider: "adjust"
)
```

***

### Convert attribution parameters to strings

Use this before passing mixed provider callback payloads to the normalizer or SDK attribution methods. It converts nested values into a `[String: String]` dictionary without storing attribution.

```swift
GrowSurfAttributionNormalizer.stringParameters(from: parameters)
```

| Parameter        | Data Type       | Description                                                                                            |
| ---------------- | --------------- | ------------------------------------------------------------------------------------------------------ |
| **`parameters`** | `[String: Any]` | (Required) Provider callback payload. Nested dictionaries and arrays are flattened into string values. |

Returns `[String: String]`.

#### **Example use**

```swift
let stringParameters = GrowSurfAttributionNormalizer.stringParameters(
    from: providerPayload
)

try await growsurf.handleAttributionParameters(
    stringParameters,
    provider: "branch"
)
```


# Models and Errors

Models, callbacks, stores, and errors exposed by the GrowSurf iOS SDK.

This reference documents the models, callbacks, advanced protocols, stores, and errors exposed by the GrowSurf iOS SDK.

## Core models

### GrowSurfConfiguration

| Field        | Type     | Description              |
| ------------ | -------- | ------------------------ |
| `campaignId` | `String` | GrowSurf program ID.     |
| `publicKey`  | `String` | Mobile SDK public key.   |
| `baseURL`    | `URL`    | Mobile SDK API base URL. |

### GrowSurfAttribution

| Field        | Type      | Description                                                  |
| ------------ | --------- | ------------------------------------------------------------ |
| `referredBy` | `String?` | Referrer participant ID or vanity key.                       |
| `ref`        | `String?` | Referrer value mirrored for provider compatibility.          |
| `unique`     | `Bool?`   | Whether the attribution provider marked the click as unique. |
| `provider`   | `String?` | Attribution provider name.                                   |
| `clickId`    | `String?` | Provider click ID.                                           |

### GrowSurfParticipantInput

| Field         | Type                   | Description                                  |
| ------------- | ---------------------- | -------------------------------------------- |
| `email`       | `String`               | Participant email address.                   |
| `firstName`   | `String?`              | Participant first name.                      |
| `lastName`    | `String?`              | Participant last name.                       |
| `referredBy`  | `String?`              | Explicit referrer value.                     |
| `attribution` | `GrowSurfAttribution?` | Explicit attribution payload.                |
| `metadata`    | `[String: String]?`    | Custom metadata to store on the participant. |

{% hint style="info" %}
`mobileInstanceId` is generated and sent by the SDK automatically. It is not part of `GrowSurfParticipantInput`.
{% endhint %}

### GrowSurfParticipantUpdateInput

| Field       | Type                | Description         |
| ----------- | ------------------- | ------------------- |
| `firstName` | `String?`           | Updated first name. |
| `lastName`  | `String?`           | Updated last name.  |
| `metadata`  | `[String: String]?` | Updated metadata.   |

### GrowSurfCampaign

| Field              | Type                       |
| ------------------ | -------------------------- |
| `id`               | `String`                   |
| `name`             | `String?`                  |
| `type`             | `String?`                  |
| `referralCount`    | `Int?`                     |
| `participantCount` | `Int?`                     |
| `impressionCount`  | `Int?`                     |
| `inviteCount`      | `Int?`                     |
| `winnerCount`      | `Int?`                     |
| `currencyISO`      | `String?`                  |
| `status`           | `String?`                  |
| `rewards`          | `[GrowSurfCampaignReward]` |

### GrowSurfCampaignReward

| Field                   | Type      |
| ----------------------- | --------- |
| `id`                    | `String?` |
| `type`                  | `String?` |
| `title`                 | `String?` |
| `description`           | `String?` |
| `referralDescription`   | `String?` |
| `isUnlimited`           | `Bool?`   |
| `limit`                 | `Int?`    |
| `conversionsRequired`   | `Int?`    |
| `numberOfWinners`       | `Int?`    |
| `imageUrl`              | `String?` |
| `order`                 | `Int?`    |
| `limitDuration`         | `String?` |
| `nextMilestonePrefix`   | `String?` |
| `nextMilestoneSuffix`   | `String?` |
| `couponCode`            | `String?` |
| `referredRewardUpfront` | `Bool?`   |

### GrowSurfParticipant

| Field                      | Type        |
| -------------------------- | ----------- |
| `id`                       | `String`    |
| `email`                    | `String?`   |
| `firstName`                | `String?`   |
| `lastName`                 | `String?`   |
| `shareUrl`                 | `String?`   |
| `paypalEmailAddress`       | `String?`   |
| `referralCount`            | `Int?`      |
| `inviteCount`              | `Int?`      |
| `monthlyReferralCount`     | `Int?`      |
| `prevMonthlyReferralCount` | `Int?`      |
| `rank`                     | `Int?`      |
| `monthlyRank`              | `Int?`      |
| `prevMonthlyRank`          | `Int?`      |
| `vanityKeys`               | `[String]?` |
| `unreadCommissionsCount`   | `Int?`      |
| `unreadPayoutsCount`       | `Int?`      |

### GrowSurfCreateParticipantResponse

| Field                      | Type                      |
| -------------------------- | ------------------------- |
| `participantToken`         | `String?`                 |
| `expiresIn`                | `Int?`                    |
| `participant`              | `GrowSurfParticipant?`    |
| `isNew`                    | `Bool?`                   |
| `requiresParticipantToken` | `Bool?`                   |
| `window`                   | `GrowSurfWindowResponse?` |

### GrowSurfAddReferredParticipantResponse

| Field                      | Type                                            |
| -------------------------- | ----------------------------------------------- |
| `added`                    | `Bool`                                          |
| `validReferral`            | `Bool`                                          |
| `referredBy`               | `String?`                                       |
| `notAddedReason`           | `GrowSurfAddReferredParticipantNotAddedReason?` |
| `participantToken`         | `String?`                                       |
| `expiresIn`                | `Int?`                                          |
| `participant`              | `GrowSurfParticipant?`                          |
| `isNew`                    | `Bool?`                                         |
| `requiresParticipantToken` | `Bool?`                                         |

### GrowSurfAddReferredParticipantNotAddedReason

| Case                        | Raw value                    |
| --------------------------- | ---------------------------- |
| `.noReferrer`               | `no_referrer`                |
| `.invalidReferrer`          | `invalid_referrer`           |
| `.participantAlreadyExists` | `participant_already_exists` |

### Referral and reward models

| Model                              | Fields                                                                                                      |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `GrowSurfReferralsResponse`        | `referrals`, `limit`, `nextOffset`, `more`                                                                  |
| `GrowSurfReferral`                 | `id`, `email`, `referralStatus`, `createdAt`, `updatedAt`, `referralTriggeredAt`, `referralCreditExpiredAt` |
| `GrowSurfRewardsResponse`          | `rewards`, `limit`, `nextId`                                                                                |
| `GrowSurfReward`                   | `id`, `status`, `unread`, `approved`, `rewardId`, `isReferrer`, `title`, `description`                      |
| `GrowSurfSuccessResponse`          | `success`, `message`                                                                                        |
| `GrowSurfAttributionResponse`      | `success`, `valid`, `referredBy`                                                                            |
| `GrowSurfValidateReferrerResponse` | `success`, `valid`, `referredBy`                                                                            |
| `GrowSurfInviteResponse`           | `success`, `message`, `messageType`                                                                         |

## GrowSurf window models

### GrowSurfWindowIdentity

| Case                                           | Description                                                                                                                                                                                                           |
| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.anonymous`                                   | Loads the window without participant identity.                                                                                                                                                                        |
| `.participantFields(GrowSurfParticipantInput)` | Creates a new participant from fields before loading the window. Existing participants need a participant token; use `.existingParticipantToken(String)` with a token created by your backend or returned by the SDK. |
| `.existingParticipantToken(String)`            | Uses a participant token created by your backend or by the SDK.                                                                                                                                                       |

### GrowSurfWindowTheme

| Field               | Type                                    | Description                                         |
| ------------------- | --------------------------------------- | --------------------------------------------------- |
| `primaryColorHex`   | `String?`                               | Optional primary color override, such as `#13795B`. |
| `colorScheme`       | `GrowSurfWindowTheme.ColorScheme`       | `.system`, `.light`, or `.dark`.                    |
| `cornerRadius`      | `Double?`                               | Optional corner radius override.                    |
| `presentationStyle` | `GrowSurfWindowTheme.PresentationStyle` | `.automatic`, `.fullScreen`, or `.sheet`.           |

### GrowSurfWindowCallbacks

| Callback                   | Type                                     |
| -------------------------- | ---------------------------------------- |
| `onOpen`                   | `() -> Void`                             |
| `onClose`                  | `() -> Void`                             |
| `onParticipantCreated`     | `(GrowSurfParticipant, String?) -> Void` |
| `onShareTracked`           | `(String) -> Void`                       |
| `onInviteSent`             | `() -> Void`                             |
| `onPayoutOrSettingsAction` | `(String) -> Void`                       |
| `onError`                  | `(Error) -> Void`                        |

### GrowSurfWindowController

| Method    | Description                           |
| --------- | ------------------------------------- |
| `close()` | Closes the presented GrowSurf window. |

### GrowSurfWindowResponse

| Field              | Type                           |
| ------------------ | ------------------------------ |
| `version`          | `String?`                      |
| `campaign`         | `GrowSurfWindowCampaign?`      |
| `signup`           | `GrowSurfWindowSignup?`        |
| `visibleSections`  | `[String: Bool]`               |
| `share`            | `GrowSurfWindowShareConfig?`   |
| `participant`      | `GrowSurfParticipant?`         |
| `unreadCounts`     | `GrowSurfWindowUnreadCounts?`  |
| `payoutSettings`   | `GrowSurfPayoutSettings?`      |
| `content`          | `[String: GrowSurfJSONValue]?` |
| `referrals`        | `GrowSurfReferralsResponse?`   |
| `rewards`          | `GrowSurfRewardsResponse?`     |
| `leaderboard`      | `GrowSurfLeaderboardResponse?` |
| `referralSummary`  | `GrowSurfReferralSummary?`     |
| `affiliateSummary` | `GrowSurfAffiliateSummary?`    |
| `commissions`      | `GrowSurfCommissionsResponse?` |
| `payouts`          | `GrowSurfPayoutsResponse?`     |

### Additional window models

| Model                                  | Fields                                                                                                                                                                                                |
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GrowSurfWindowCampaign`               | `id`, `type`, `status`, `companyName`, `companyLogoImageUrl`, `goal`, `currencyISO`, `shouldDisplayPoweredBy`, `rewardTypes`, `rewards`, `design`                                                     |
| `GrowSurfWindowSignup`                 | `state`, `canCreateParticipant`                                                                                                                                                                       |
| `GrowSurfWindowShareConfig`            | `preferredUrl`, `fallbackUrl`, `nativeShare`, `channels`, `invite`                                                                                                                                    |
| `GrowSurfWindowShareChannel`           | `type`, `label`, `order`, `subject`, `message`, `nativePreferred`                                                                                                                                     |
| `GrowSurfWindowUnreadCounts`           | `commissions`, `payouts`                                                                                                                                                                              |
| `GrowSurfPayoutSettings`               | `provider`, `paypalEmailAddress`, `canRequestPaypalConfirmEmail`, `hostedActions`, `requiredActions`, `payoutInstructionsMode`, `taxInfo`                                                             |
| `GrowSurfTaxInfo`                      | `status`, `formType`, `residencyCountryCode`, `vatNumber`, `vatCountryCode`, `statusReason`, `payoutSettings`                                                                                         |
| `GrowSurfTaxInfoRefreshPayoutSettings` | `hostedActions`, `requiredActions`                                                                                                                                                                    |
| `GrowSurfTaxSessionResponse`           | `hostedUrl`, `status`                                                                                                                                                                                 |
| `GrowSurfTaxInfoSaveResponse`          | `success`, `taxInfo`                                                                                                                                                                                  |
| `GrowSurfLeaderboardResponse`          | `participants`, `offsetKey`, `nextKey`, `page`, `hasMore`                                                                                                                                             |
| `GrowSurfLeaderboardParticipant`       | `id`, `rank`, `monthlyRank`, `prevMonthlyRank`, `email`, `isWinner`, `referralCount`, `monthlyReferralCount`, `prevMonthlyReferralCount`, `pendingReferralCount`, `revenueAmount`, `commissionAmount` |
| `GrowSurfReferralSummary`              | `referrals`, `leads`, `expiredReferrals`, `clicks`, `rewardsEarned`, `pendingRewards`, `invitesSent`, `currencyISO`                                                                                   |
| `GrowSurfAffiliateSummary`             | `referralRevenue`, `totalPaidOut`, `upcomingPayout`, `referrals`, `leads`, `clicks`, `currencyISO`                                                                                                    |
| `GrowSurfCommissionsResponse`          | `commissions`, `totalCount`, `totalAmount`, `summary`, `nextId`                                                                                                                                       |
| `GrowSurfCommission`                   | `id`, `amount`, `currencyISO`, `status`, `holdDuration`, `createdAt`, `amountInCampaignCurrency`, `saleAmountInCampaignCurrency`, `campaignCurrencyISO`, `unread`                                     |
| `GrowSurfPayoutsResponse`              | `payouts`, `totalCount`, `totalAmount`, `summary`, `nextId`                                                                                                                                           |
| `GrowSurfPayout`                       | `id`, `amount`, `currencyISO`, `status`, `queuedAt`, `createdAt`, `amountInCampaignCurrency`, `campaignCurrencyISO`, `unread`                                                                         |
| `GrowSurfJSONValue`                    | `.string`, `.number`, `.bool`, `.object`, `.array`, `.null`                                                                                                                                           |

## Advanced protocols and stores

Use these APIs for tests or custom storage/transport integrations.

| Type                                        | Public methods                                                                                        |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `GrowSurfHTTPClient`                        | `data(for:)`                                                                                          |
| `GrowSurfTokenStore`                        | `sessionToken()`, `participantToken()`, `saveSessionToken(_:)`, `saveParticipantToken(_:)`, `clear()` |
| `GrowSurfAttributionStore`                  | `attribution()`, `saveAttribution(_:)`, `clearAttribution()`                                          |
| `GrowSurfMobileInstanceIdStore`             | `mobileInstanceId()`                                                                                  |
| `GrowSurfWindowCacheStore`                  | `windowData(cacheKey:now:)`, `saveWindowData(_:cacheKey:expiresAt:)`, `clear()`                       |
| `GrowSurfUserDefaultsAttributionStore`      | UserDefaults-backed attribution store.                                                                |
| `GrowSurfUserDefaultsMobileInstanceIdStore` | UserDefaults-backed mobile instance ID store.                                                         |
| `GrowSurfUserDefaultsWindowCacheStore`      | UserDefaults-backed window cache store.                                                               |
| `GrowSurfFileWindowCacheStore`              | File-backed window cache store used by default.                                                       |
| `GrowSurfKeychainTokenStore`                | Keychain-backed token store used by default.                                                          |

## Errors

`GrowSurfError` can be:

* `invalidURL`
* `missingSessionToken`
* `missingParticipantToken`
* `invalidResponse`
* `httpStatus(Int, String?)`


# Android SDK (Beta)

Install and use the GrowSurf Android SDK to capture referral attribution, create referred participants, and show a native referral window in your app.

{% hint style="info" %}
If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

## Install

The core library is lightweight, adding roughly \~1 MB to your Android app (attribution adapters add only tens of KB each).

Add the core SDK from Maven Central. Choose one install path.

{% tabs %}
{% tab title="Kotlin DSL" %}

```kotlin
repositories {
    mavenCentral()
}

dependencies {
    implementation("com.growsurf:growsurf-android-sdk:0.3.3")
}
```

{% endtab %}

{% tab title="Groovy" %}

```groovy
repositories {
    mavenCentral()
}

dependencies {
    implementation 'com.growsurf:growsurf-android-sdk:0.3.3'
}
```

{% endtab %}
{% endtabs %}

If you use Branch, Adjust, AppsFlyer, or Singular, add the matching GrowSurf adapter.

{% tabs %}
{% tab title="Kotlin DSL" %}

```kotlin
dependencies {
    implementation("com.growsurf:growsurf-android-sdk-attribution-branch:0.3.3")
    implementation("com.growsurf:growsurf-android-sdk-attribution-adjust:0.3.3")
    implementation("com.growsurf:growsurf-android-sdk-attribution-appsflyer:0.3.3")
    implementation("com.growsurf:growsurf-android-sdk-attribution-singular:0.3.3")
}
```

{% endtab %}

{% tab title="Groovy" %}

```groovy
dependencies {
    implementation 'com.growsurf:growsurf-android-sdk-attribution-branch:0.3.3'
    implementation 'com.growsurf:growsurf-android-sdk-attribution-adjust:0.3.3'
    implementation 'com.growsurf:growsurf-android-sdk-attribution-appsflyer:0.3.3'
    implementation 'com.growsurf:growsurf-android-sdk-attribution-singular:0.3.3'
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Keep your provider's SDK setup in your app. The GrowSurf adapter passes provider callback data into GrowSurf.
{% endhint %}

### Initialize

Enable Mobile SDK access in your GrowSurf program on the instructions page, then configure the SDK once when your app starts or before your first GrowSurf call.

* Find `campaignId` in your GrowSurf program dashboard. It is the 6-character program ID, such as `p9josq`.
* Find `publicKey` in *Program Editor > 5. Installation > Instructions page > Step 1. Android > Configure SDK*.

```kotlin
import com.growsurf.sdk.GrowSurfSdk

val growsurf = GrowSurfSdk.configure(
    context = context,
    campaignId = "p9josq",
    publicKey = "pk_mobile",
)
```

{% hint style="info" %}
Native apps use a public Mobile SDK key, which can safely be exposed. This is different than your REST API key on your backend, which you should always keep secret.
{% endhint %}

***

## Track referrals

Tracking referrals entails capturing attribution and creating new referred participants.

### Capture attribution

Capture referral attribution before you create the referred friend's participant record.

{% stepper %}
{% step %}
**For direct app links that open your installed app:**

```kotlin
intent.data?.let { uri ->
    growsurf.handleDeepLink(uri)
}
```

{% hint style="info" %}
**Already support deep links?** If you use an attribution provider (Branch, AppsFlyer, Adjust, Singular) or otherwise open your app from links, this is already set up — just forward the opened `Intent`'s URI to `handleDeepLink(uri)`.

**Starting from scratch?** Add a custom-scheme `<intent-filter>` (`android:scheme`) to your launch Activity in `AndroidManifest.xml` — the quickest path, no domain needed — and/or set up Android App Links (`android:autoVerify="true"` plus an `assetlinks.json` hosted on a domain you control) for verified `https` links. Then read `intent.data` in `onCreate`/`onNewIntent` and call `handleDeepLink(uri)` inside a coroutine scope.
{% endhint %}
{% endstep %}

{% step %}
**For deferred deep links from an attribution provider:**

View [Adapter docs](https://docs.growsurf.com/developer-tools/android-sdk/attribution-providers#adapters) for your specific provider setup instructions.

{% hint style="info" %}
For Google Play installs, [`addReferredParticipant()`](https://docs.growsurf.com/developer-tools/android-sdk/api-reference#add-referred-participant) checks Play Install Referrer once when no explicit or pending attribution exists. You can still call [`handleDeferredDeepLink()`](https://docs.growsurf.com/developer-tools/android-sdk/api-reference#handle-deferred-deep-link) yourself if you want to inspect attribution earlier:

```kotlin
lifecycleScope.launch {
    growsurf.handleDeferredDeepLink()
}
```

{% endhint %}
{% endstep %}
{% endstepper %}

### Create a referred participant

Use [`addReferredParticipant()`](https://docs.growsurf.com/developer-tools/android-sdk/api-reference#add-referred-participant) for referred signups. This is typically where new users sign up in your app.

The SDK validates saved, explicit, or Play Install Referrer attribution and only creates the participant when the referral code is valid.

```kotlin
// Only creates a referred participant if the referral code is valid
val created = growsurf.addReferredParticipant(
    GrowSurfParticipantInput(
        email = "person@example.com",
        firstName = "Ada",
        lastName = "Lovelace",
        metadata = mapOf("plan" to "pro"), // Optional, saved as participant metadata
        // The referral code and mobile instance ID (for anti-fraud) are passed automatically
    )
)

val participant = created.participant
```

***

## Generate referral links for your users

Generating referral links to users in your app entails generating a participant token by using the GrowSurf API, then opening the GrowSurf window.

### Generate a participant token

To allow authenticated access to your logged-in users, you must call the GrowSurf backend to generate a participant token.

{% stepper %}
{% step %}
**Call backend endpoint** [**create a mobile participant token.**](/developer-tools/rest-api/api-reference#post-campaign-id-mobile-participant-token)

Here is an example `cURL` command:

```bash
curl -X POST "https://api.growsurf.com/v2/campaign/YOUR_PROGRAM_ID/mobile-participant-token" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
   "email": "person@example.com",
   "firstName": "Ada",
   "lastName": "Lovelace",
   "mobileInstanceId": "5f7d0f4c-3e7c-4aa9-8c41-d81d998f0bb1",
   "ipAddress": "203.0.113.10",
   "metadata": {
      "plan": "pro"
   }
}'
```

Only `email` is required. `firstName`, `lastName`, `mobileInstanceId`, and `ipAddress` are optional but recommended for anti-fraud. `metadata` is optional and is not used by GrowSurf.

{% hint style="info" %}
Using TypeScript, Python, PHP, Ruby, or Java for your backend? Use an official [GrowSurf API Library](https://docs.growsurf.com/developer-tools/rest-api/api-libraries).
{% endhint %}

**Optional:** To get `mobileInstanceId`, which is used for anti-fraud purposes, use the SDK method [`getMobileInstanceId()`](https://docs.growsurf.com/developer-tools/android-sdk/api-reference#get-mobile-instance-id).

This will create a new participant or return an existing one, along with a participant token that allows authenticated calls.
{% endstep %}

{% step %}
**Pass it to the app, then store in the SDK via** [**`setParticipantToken()`**](https://docs.growsurf.com/developer-tools/android-sdk/api-reference#set-participant-token)**.**

Here is example SDK code:

```kotlin
// getMobileInstanceId() is a suspend function, so call it from a coroutine.
lifecycleScope.launch {
    val mobileInstanceId = growsurf.getMobileInstanceId() // Used for anti-fraud (optional)
    val backendResponse = api.createMobileParticipantToken(
        email = user.email,
        mobileInstanceId = mobileInstanceId,
    )
    val participantToken = backendResponse.participantToken

    growsurf.setParticipantToken(participantToken)
}
```

{% endstep %}
{% endstepper %}

### Show the GrowSurf window

<div align="left"><figure><img src="/files/ZZTs4QzmyOgwxxQvysUo" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/NAy8ur4aaGaODzNpZpFq" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/ppeQCsy9TG8m74eHK78T" alt="" width="188"><figcaption></figcaption></figure></div>

The GrowSurf window allows your participants to view/share their referral link and track the status of their referrals and rewards.

Call [`presentGrowSurfWindow()`](https://docs.growsurf.com/developer-tools/android-sdk/api-reference#present-growsurf-window) from your own button, menu item, or referral screen. Set the `identity` parameter to [`GrowSurfWindowIdentity.ExistingParticipantToken()`](https://docs.growsurf.com/developer-tools/android-sdk/models-and-errors#growsurfwindowidentity), which will use the participant token you generated above.

```kotlin
growsurf.presentGrowSurfWindow(
    activity = this,
    identity = GrowSurfWindowIdentity.ExistingParticipantToken(participantToken),
    theme = GrowSurfWindowTheme(
        primaryColor = 0xFF13795B,
        presentationStyle = GrowSurfWindowPresentationStyle.AUTOMATIC,
    ),
    callbacks = GrowSurfWindowCallbacks(
        onShareTracked = { type ->
            Log.d("GrowSurf", "Share tracked: $type")
        },
        onError = { error ->
            Log.e("GrowSurf", "GrowSurf window error", error)
        },
    ),
)
```

***

## \[Optional] Google Contacts invites <a href="#google-contacts" id="google-contacts"></a>

<div align="left"><figure><img src="/files/ZZTs4QzmyOgwxxQvysUo" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/L0tXmp3gdKjKK38P9P8T" alt="" width="187"><figcaption></figcaption></figure> <figure><img src="/files/kO25oflJgrA0x4CuMyc4" alt="" width="187"><figcaption></figcaption></figure></div>

Only needed when Google Contacts invites are enabled for your program. When a participant taps the Google Contacts button, the GrowSurf window takes them through Google's sign-in to grant access to their contacts (read-only) — the same experience as on iOS.

Unlike iOS, there is **no in-app code to add** on Android: the required Google Sign-In library is bundled with the SDK, and there is no URL scheme or URL forwarding to configure. The only requirement is a correctly configured Google Cloud OAuth client for your app.

{% stepper %}
{% step %}
**Create an Android OAuth client** as part of the [Google Cloud setup](https://support.growsurf.com/article/343-how-to-set-up-google-contacts-address-book). Set the application type to **Android** and register it with your app's **package name** and its **SHA-1 signing-certificate fingerprint**. Without this, the consent screen fails with a `DEVELOPER_ERROR`.
{% endstep %}

{% step %}
**Get your SHA-1 fingerprint.** The quickest way is the Gradle signing report, which prints the SHA-1 for every build variant:

```bash
./gradlew signingReport
```

Or read it directly from a keystore with `keytool`:

```bash
# Debug keystore (default location)
keytool -list -v \
  -keystore ~/.android/debug.keystore \
  -alias androiddebugkey -storepass android -keypass android

# Release keystore
keytool -list -v \
  -keystore /path/to/your/release.keystore \
  -alias your-key-alias
```

Register **both** your debug and release SHA-1 fingerprints so Google Contacts works in development and production.
{% endstep %}

{% step %}
**Using Google Play App Signing?** Register the SHA-1 of the **app signing key** shown in **Play Console → Test and release → App integrity → App signing key certificate** — not just your upload key. Otherwise the consent screen will fail in production even after the steps above.
{% endstep %}
{% endstepper %}

***

## Log out

If your user logs out of your app, call [`shutdown()`](https://docs.growsurf.com/developer-tools/android-sdk/api-reference#shutdown) to remove all participant data from the device:

```kotlin
growsurf.shutdown()
```

***

## Next steps

{% content-ref url="/pages/GhQfB3WsJlg97Hqpy7n9" %}
[Attribution Providers](/developer-tools/android-sdk/attribution-providers)
{% endcontent-ref %}

{% content-ref url="/pages/XLxytePFauV0nWRkLmv8" %}
[API Reference](/developer-tools/android-sdk/api-reference)
{% endcontent-ref %}

{% content-ref url="/pages/3NzBu6Jtu7Cvd7wWg7L1" %}
[Models and Errors](/developer-tools/android-sdk/models-and-errors)
{% endcontent-ref %}

{% content-ref url="/pages/exdoU1ymhoG3SfIjmIsO" %}
[Getting Started for Native Mobile](/getting-started-for-native-mobile)
{% endcontent-ref %}


# Attribution Providers

Configure direct deep links, Google Play Install Referrer, and attribution adapters for the GrowSurf Android SDK.

On Android, GrowSurf can capture referral attribution from direct deep links, Google Play Install Referrer, or provider callback payloads. Capture attribution before calling `addReferredParticipant()`.

***

## Direct deep links

Use `handleDeepLink(uri)` when the installed app opens from a link that already contains `grsf`, which contains the referral code.

```kotlin
intent.data?.let { uri ->
    val attribution = growsurf.handleDeepLink(uri)
}
```

{% hint style="info" %}
**Example accepted links:**

* `your-app://open?grsf=referrer_id`
* `https://example.com/app?grsf=referrer_id`
  {% endhint %}

{% hint style="info" %}
**Already support deep links?** If you use an attribution provider (Branch, AppsFlyer, Adjust, Singular) or otherwise open your app from links, this is already set up — just forward the opened `Intent`'s URI to `handleDeepLink(uri)`.

**Starting from scratch?** Add a custom-scheme `<intent-filter>` (`android:scheme`) to your launch Activity in `AndroidManifest.xml` — the quickest path, no domain needed — and/or set up Android App Links (`android:autoVerify="true"` plus an `assetlinks.json` hosted on a domain you control) for verified `https` links. Then read `intent.data` in `onCreate`/`onNewIntent` and call `handleDeepLink(uri)` inside a coroutine scope.

GrowSurf-hosted share links live on `grow.surf` (not your domain), so they can't open your app via App Links — use a custom scheme, your own domain with `grsf` appended, or an attribution provider.
{% endhint %}

***

## Google Play Install Referrer

When Android referral clicks route to Google Play with a Play Install Referrer payload, `addReferredParticipant(...)` checks the install referrer once when no explicit or pending attribution exists. You can also call `handleDeferredDeepLink()` yourself before signup when you want to inspect the attribution result.

```kotlin
lifecycleScope.launch {
    growsurf.handleDeferredDeepLink()
    val created = growsurf.addReferredParticipant(
        GrowSurfParticipantInput(email = "person@example.com")
    )
}
```

By default, the SDK checks the install referrer only once. Pass `forceRefresh = true` while testing if you need to query it again:

```kotlin
growsurf.handleDeferredDeepLink(forceRefresh = true)
```

***

## Adapters

GrowSurf provides adapters for popular attribution providers. Choose your provider below, or use **Other** to pass a dictionary of attribution values from any other provider.

{% tabs %}
{% tab title="Adjust" %}

## Adjust adapter

Add the adapter artifact:

{% tabs %}
{% tab title="Kotlin DSL" %}

```kotlin
dependencies {
    implementation("com.growsurf:growsurf-android-sdk-attribution-adjust:0.3.3")
}
```

{% endtab %}

{% tab title="Groovy" %}

```groovy
dependencies {
    implementation 'com.growsurf:growsurf-android-sdk-attribution-adjust:0.3.3'
}
```

{% endtab %}
{% endtabs %}

Then pass the Adjust deferred deep link into GrowSurf:

```kotlin
import com.growsurf.sdk.attribution.adjust.GrowSurfAdjustAttribution

GrowSurfAdjustAttribution.handle(adjustDeferredDeepLinkUri, growsurf)
```

The adapter accepts `Uri` and `String` deep link values.
{% endtab %}

{% tab title="AppsFlyer" %}

## AppsFlyer adapter

Add the adapter artifact:

{% tabs %}
{% tab title="Kotlin DSL" %}

```kotlin
dependencies {
    implementation("com.growsurf:growsurf-android-sdk-attribution-appsflyer:0.3.3")
}
```

{% endtab %}

{% tab title="Groovy" %}

```groovy
dependencies {
    implementation 'com.growsurf:growsurf-android-sdk-attribution-appsflyer:0.3.3'
}
```

{% endtab %}
{% endtabs %}

Then pass AppsFlyer conversion data into GrowSurf:

```kotlin
import com.growsurf.sdk.attribution.appsflyer.GrowSurfAppsFlyerAttribution

GrowSurfAppsFlyerAttribution.handle(appsFlyerConversionData, growsurf)
```

The adapter accepts `Map<String, *>` and `JSONObject` payloads.
{% endtab %}

{% tab title="Branch" %}

## Branch adapter

Add the adapter artifact:

{% tabs %}
{% tab title="Kotlin DSL" %}

```kotlin
dependencies {
    implementation("com.growsurf:growsurf-android-sdk-attribution-branch:0.3.3")
}
```

{% endtab %}

{% tab title="Groovy" %}

```groovy
dependencies {
    implementation 'com.growsurf:growsurf-android-sdk-attribution-branch:0.3.3'
}
```

{% endtab %}
{% endtabs %}

Then pass Branch callback data into GrowSurf:

```kotlin
import com.growsurf.sdk.attribution.branch.GrowSurfBranchAttribution

GrowSurfBranchAttribution.handle(branchParams, growsurf)
```

The adapter accepts `Map<String, *>` and `JSONObject` payloads.
{% endtab %}

{% tab title="Singular" %}

## Singular adapter

Add the adapter artifact:

{% tabs %}
{% tab title="Kotlin DSL" %}

```kotlin
dependencies {
    implementation("com.growsurf:growsurf-android-sdk-attribution-singular:0.3.3")
}
```

{% endtab %}

{% tab title="Groovy" %}

```groovy
dependencies {
    implementation 'com.growsurf:growsurf-android-sdk-attribution-singular:0.3.3'
}
```

{% endtab %}
{% endtabs %}

Then pass Singular callback data into GrowSurf:

```kotlin
import com.growsurf.sdk.attribution.singular.GrowSurfSingularAttribution

GrowSurfSingularAttribution.handle(singularParams, growsurf)
```

The adapter accepts `Map<String, *>`, `JSONObject`, `Uri`, and `String` payloads. It parses GrowSurf referral keys from Singular deep link, deferred deep link, and passthrough fields such as `_dl`, `_ddl`, and `_p`.
{% endtab %}

{% tab title="Other" %}

## Manual attribution parameters

Use `handleAttributionParameters(parameters, provider)` for any other provider that can return a dictionary of attribution values. No extra adapter install is required.

```kotlin
growsurf.handleAttributionParameters(
    mapOf(
        "grsf" to "referrer_id",
        "click_id" to "click_123",
    ),
    provider = "your-provider-name",
)
```

{% endtab %}
{% endtabs %}

***

## Accepted attribution keys

| Key          | Description                                                                                      |
| ------------ | ------------------------------------------------------------------------------------------------ |
| `grsf`       | Preferred GrowSurf referrer ID.                                                                  |
| `ref`        | Alternate referrer ID.                                                                           |
| `referredBy` | Alternate referrer ID.                                                                           |
| `provider`   | Attribution provider name. Ignored when the SDK method receives an explicit `provider` argument. |
| `clickId`    | Provider click ID metadata.                                                                      |
| `click_id`   | Provider click ID metadata.                                                                      |
| `unique`     | Optional boolean string: `true` or `false`.                                                      |

The SDK also parses values nested inside URL-like payload fields. For example, a provider value of `https://example.com/?grsf=referrer_id&click_id=click_123` can still produce GrowSurf attribution. If a provider returns a GrowSurf-hosted share URL such as `https://grow.surf/share/:campaignId/:referrerId`, the SDK uses the participant value from the path.


# API Reference

Public methods, Java callback overloads, attribution adapters, and models exposed by the GrowSurf Android SDK.

{% hint style="info" %}
If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

Use this page to look up individual GrowSurf Android SDK methods. Most SDK methods are Kotlin coroutine methods. Java examples are included where the SDK exposes callback overloads or synchronous/static methods.

{% hint style="warning" %}
Use the Mobile SDK public key in your app. Do not embed your secret REST API key in an Android app.
{% endhint %}

## SDK LIFECYCLE ↓

### Configure

Call this once before using GrowSurf. It connects the SDK to your GrowSurf campaign, Mobile SDK public key, and Android context.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
val growsurf = GrowSurfSdk.configure(
    context = context,
    campaignId = "abc123",
    publicKey = "pk_mobile",
)
```

{% endtab %}

{% tab title="Java" %}

```java
GrowSurfSdk growsurf = GrowSurfSdk.configure(
    context,
    "abc123",
    "pk_mobile",
    "https://api.growsurf.com/mobile/v2"
);
```

{% endtab %}
{% endtabs %}

| Parameter        | Data Type | Description                                                                                                                                     |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **`context`**    | `Context` | (Required) Android context used for encrypted token storage, attribution storage, mobile instance ID storage, and Play Install Referrer access. |
| **`campaignId`** | `String`  | (Required) Your GrowSurf program ID.                                                                                                            |
| **`publicKey`**  | `String`  | (Required) Your Mobile SDK public key.                                                                                                          |
| **`baseUrl`**    | `String`  | (Optional in Kotlin) Custom Mobile SDK API base URL. Defaults to `https://api.growsurf.com/mobile/v2`.                                          |

Returns a configured `GrowSurfSdk` instance.

Optionally, for advanced apps, initialize directly with explicit stores, transport, dispatcher, or install referrer client. Pass the production stores shown below (or your own conformances to the public store interfaces):

```kotlin
val growsurf = GrowSurfSdk(
    configuration = GrowSurfConfiguration(
        campaignId = "abc123",
        publicKey = "pk_mobile",
    ),
    tokenStore = EncryptedPreferencesGrowSurfTokenStore(context),
    attributionStore = PreferencesGrowSurfAttributionStore(context),
)
```

***

### Set participant token

Use this after your backend creates a mobile participant token for a signed-in user. It lets participant-scoped SDK calls load or update that participant's data.

```kotlin
growsurf.setParticipantToken(participantToken)
```

| Parameter   | Data Type | Description                                                                                         |
| ----------- | --------- | --------------------------------------------------------------------------------------------------- |
| **`token`** | `String`  | (Required) A mobile participant token returned by your backend or by a participant creation method. |

Returns `Unit`.

#### **Example use**

```kotlin
growsurf.setParticipantToken(participantToken)
```

{% hint style="info" %}
Use this method with tokens created by the REST API mobile participant token endpoint after a user is already signed in.
{% endhint %}

***

### Get participant token

Returns the participant token currently held by the SDK, or `null` if none is stored. Useful right after the GrowSurf window's `ParticipantFields` signup flow so your app can persist the freshly minted token for the user's next session.

```kotlin
growsurf.getParticipantToken()
```

Returns `String?`.

#### **Example use**

```kotlin
growsurf.getParticipantToken()?.let { token ->
    // Persist the token to your backend so the user stays signed in to GrowSurf.
}
```

{% hint style="info" %}
The default `EncryptedPreferencesGrowSurfTokenStore` can propagate KeyStore or EncryptedSharedPreferences errors. Wrap this call in `try`/`catch` and rethrow `CancellationException` to preserve structured concurrency.
{% endhint %}

***

### Get current participant ID

Returns the current participant's ID from the stored participant token, or `null` if none.

{% tabs %}
{% tab title="Kotlin coroutine" %}

```kotlin
val participantId = growsurf.getCurrentParticipantId()
```

{% endtab %}

{% tab title="Java callback" %}

```java
growsurf.getCurrentParticipantId(new GrowSurfCallback<String?>() {
    @Override
    public void onSuccess(String result) {
        Log.d("GrowSurf", "Current participant: " + result);
    }

    @Override
    public void onError(Throwable error) {
        Log.e("GrowSurf", "Current participant error", error);
    }
});
```

{% endtab %}
{% endtabs %}

Returns `String?`.

#### **Example use**

```kotlin
growsurf.getCurrentParticipantId()?.let { participantId ->
    Log.d("GrowSurf", "Current participant: $participantId")
}
```

***

### Get mobile instance ID

Returns the app-install ID the SDK sends with participant creation for mobile anti-fraud. You usually only need this if your backend creates mobile participant tokens and needs to pass the same ID to GrowSurf.

`getMobileInstanceId()` is a `suspend` function, so call it from a coroutine.

```kotlin
growsurf.getMobileInstanceId()
```

Returns a UUID `String`.

#### **Example use**

```kotlin
lifecycleScope.launch {
    val mobileInstanceId = growsurf.getMobileInstanceId()
}
```

{% hint style="info" %}
Participant creation methods send `mobileInstanceId` automatically. Read it manually only when your backend creates a mobile participant token and needs to pass `mobileInstanceId` to the REST API.
{% endhint %}

***

### Shutdown

Call this when a user signs out or you need to reset GrowSurf state on the device. It clears the stored session token, participant token, and pending attribution.

```kotlin
growsurf.shutdown()
```

Returns `Unit`.

#### **Example use**

```kotlin
growsurf.shutdown()
```

***

## CAMPAIGNS ↓

### Get campaign

Use this to read campaign details and rewards for the configured GrowSurf program. The SDK creates or uses a session token before calling GrowSurf.

```kotlin
growsurf.getCampaign()
```

Returns `GrowSurfCampaign`.

#### **Example use**

```kotlin
val campaign = growsurf.getCampaign()
Log.d("GrowSurf", campaign.id)
```

***

### Get leaderboard

Use this to show leaderboard rows in a custom referral screen. You can page through results with page or cursor parameters.

```kotlin
growsurf.getLeaderboard(
    limit = 20,
    page = 1,
    offsetKey = null,
    leaderboardType = null,
)
```

| Parameter             | Data Type | Description                                        |
| --------------------- | --------- | -------------------------------------------------- |
| **`limit`**           | `Int?`    | (Optional) Number of rows to return.               |
| **`page`**            | `Int?`    | (Optional) Page number.                            |
| **`offsetKey`**       | `String?` | (Optional) Cursor key for offset-based pagination. |
| **`leaderboardType`** | `String?` | (Optional) Leaderboard type filter.                |

Returns `GrowSurfLeaderboardResponse`.

#### **Example use**

```kotlin
val leaderboard = growsurf.getLeaderboard(limit = 10)
leaderboard.participants.forEach { row ->
    Log.d("GrowSurf", "Rank ${row.rank}: ${row.email}")
}
```

***

## GROWSURF WINDOW ↓

### Present GrowSurf window

Call this from your own button, menu item, or referral screen to open GrowSurf's native Compose referral window.

{% hint style="info" %}
The native GrowSurf window uses the GrowSurf window settings from your dashboard. This method is not a coroutine method.
{% endhint %}

```kotlin
growsurf.presentGrowSurfWindow(
    activity = activity,
    identity = GrowSurfWindowIdentity.ExistingParticipantToken(participantToken),
    theme = GrowSurfWindowTheme(),
    callbacks = GrowSurfWindowCallbacks(),
)
```

| Parameter       | Data Type                 | Description                                                                                                                                                          |
| --------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`activity`**  | `Activity`                | (Required) Activity that hosts the native window.                                                                                                                    |
| **`identity`**  | `GrowSurfWindowIdentity`  | (Optional) How the window should identify the current user. Defaults to `Anonymous`.                                                                                 |
| **`theme`**     | `GrowSurfWindowTheme`     | (Optional) Native presentation and theme overrides.                                                                                                                  |
| **`callbacks`** | `GrowSurfWindowCallbacks` | (Optional) Event callbacks for window open, close, participant creation (from the signup form), share tracking, invite sending, payout/settings actions, and errors. |

Returns `GrowSurfWindowController` — call `close()` on it to dismiss the window programmatically.

#### **Example use**

```kotlin
val controller = growsurf.presentGrowSurfWindow(
    activity = this,
    identity = GrowSurfWindowIdentity.ExistingParticipantToken(participantToken),
    theme = GrowSurfWindowTheme(
        primaryColor = 0xFF13795B,
        presentationStyle = GrowSurfWindowPresentationStyle.AUTOMATIC,
    ),
    callbacks = GrowSurfWindowCallbacks(
        onShareTracked = { type ->
            Log.d("GrowSurf", "Share tracked: $type")
        },
        onParticipantCreated = { participant, participantToken ->
            Log.d("GrowSurf", "Participant: ${participant.id}")
        },
        onError = { error ->
            Log.e("GrowSurf", "GrowSurf window error", error)
        },
    ),
)
```

***

### Get GrowSurf window

Use this when you are building your own referral screen instead of showing the native GrowSurf window. It returns the campaign, participant, share, reward, leaderboard, and affiliate data used by the window.

```kotlin
growsurf.getGrowSurfWindow(identity = GrowSurfWindowIdentity.Anonymous)
```

| Parameter      | Data Type                | Description                                          |
| -------------- | ------------------------ | ---------------------------------------------------- |
| **`identity`** | `GrowSurfWindowIdentity` | (Optional) Window identity. Defaults to `Anonymous`. |

Returns `GrowSurfWindowResponse`.

#### **Example use**

```kotlin
val window = growsurf.getGrowSurfWindow(
    identity = GrowSurfWindowIdentity.ExistingParticipantToken(participantToken),
)

val shareUrl = window.participant?.shareUrl ?: window.share?.preferredUrl ?: window.share?.fallbackUrl
```

{% hint style="info" %}
Use `participant.shareUrl` as the customer-facing referral link when a participant is available. Fall back to `share.preferredUrl` or `share.fallbackUrl` only for rendering.
{% endhint %}

***

## ATTRIBUTION ↓

### Handle deep link

Call this when your app opens from a referral deep link. If the URI contains `grsf`, `ref`, or `referredBy`, the SDK saves the attribution so you can apply it when the user signs up.

```kotlin
growsurf.handleDeepLink(uri)
```

| Parameter | Data Type | Description                                      |
| --------- | --------- | ------------------------------------------------ |
| **`uri`** | `Uri`     | (Required) The deep link URI opened by your app. |

Returns `GrowSurfAttribution?`. Returns `null` when no GrowSurf referral value is found.

#### **Example use**

```kotlin
intent.data?.let { uri ->
    val attribution = growsurf.handleDeepLink(uri)
    Log.d("GrowSurf", "Referrer: ${attribution?.referredBy}")
}
```

***

### Handle deferred deep link

Call this if you want to read Google Play Install Referrer before signup. `addReferredParticipant(...)` checks it automatically when no explicit or pending attribution exists.

```kotlin
growsurf.handleDeferredDeepLink(forceRefresh = false)
```

| Parameter          | Data Type | Description                                                                                                          |
| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------- |
| **`forceRefresh`** | `Boolean` | (Optional) When `true`, queries Play Install Referrer again even if the SDK already checked it. Defaults to `false`. |

Returns `GrowSurfAttribution?`. Returns `null` when no GrowSurf referral value is found.

#### **Example use**

```kotlin
val attribution = growsurf.handleDeferredDeepLink()
```

{% hint style="info" %}
`addReferredParticipant(...)` checks Play Install Referrer automatically when no explicit or pending attribution exists. Call this manually only when you want to inspect attribution earlier.
{% endhint %}

***

### Handle attribution parameters

Call this from an attribution provider callback, such as Branch, Adjust, AppsFlyer, or Singular. If the parameters include `grsf`, `ref`, or `referredBy` directly or inside URL-like values, the SDK saves the attribution for signup.

```kotlin
growsurf.handleAttributionParameters(parameters, provider = "branch")
```

| Parameter        | Data Type             | Description                                                                                                                                     |
| ---------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **`parameters`** | `Map<String, String>` | (Required) Provider callback parameters. The SDK recognizes direct values and nested URL-like values containing `grsf`, `ref`, or `referredBy`. |
| **`provider`**   | `String?`             | (Optional) Attribution provider name, such as `branch`, `adjust`, `appsflyer`, or `singular`.                                                   |

Returns `GrowSurfAttribution?`. Returns `null` when no GrowSurf referral value is found.

#### **Example use**

```kotlin
val attribution = growsurf.handleAttributionParameters(
    mapOf(
        "grsf" to "referrer_id",
        "click_id" to "click_123",
        "unique" to "true",
    ),
    provider = "branch",
)
```

***

### Get pending attribution

Use this to inspect referral attribution saved on this device before creating or signing in a participant.

```kotlin
growsurf.getPendingAttribution()
```

Returns `GrowSurfAttribution?`.

#### **Example use**

```kotlin
val attribution = growsurf.getPendingAttribution()
```

***

### Clear pending attribution

Clear saved referral attribution when it should no longer apply, such as after you handle it or when a different user signs in.

```kotlin
growsurf.clearPendingAttribution()
```

Returns `Unit`.

#### **Example use**

```kotlin
growsurf.clearPendingAttribution()
```

***

### Validate referrer

Use this to check whether a saved or supplied referrer is valid before you show a referred state or create a participant.

```kotlin
growsurf.validateReferrer(attribution)
```

| Parameter         | Data Type              | Description                                                                                           |
| ----------------- | ---------------------- | ----------------------------------------------------------------------------------------------------- |
| **`attribution`** | `GrowSurfAttribution?` | (Optional) Attribution to validate. If omitted, the SDK validates locally stored pending attribution. |

Returns `GrowSurfValidateReferrerResponse`.

#### **Example use**

{% tabs %}
{% tab title="Pending attribution" %}

```kotlin
val validation = growsurf.validateReferrer()

if (validation.valid) {
    Log.d("GrowSurf", "Valid referrer: ${validation.referredBy}")
}
```

{% endtab %}

{% tab title="Explicit referrer" %}

```kotlin
val validation = growsurf.validateReferrer("referrer_id")

if (validation.valid) {
    Log.d("GrowSurf", "Valid referrer")
}
```

{% endtab %}
{% endtabs %}

***

## PARTICIPANTS ↓

### Add referred participant

Use this for referred signups. The SDK looks for saved attribution, an explicit referrer, or Play Install Referrer attribution, validates it, and only creates the participant when the referral is valid.

{% tabs %}
{% tab title="Kotlin coroutine" %}

```kotlin
val result = growsurf.addReferredParticipant(
    GrowSurfParticipantInput(
        email = "person@example.com",
        firstName = "Ada",
        lastName = "Lovelace",
        metadata = mapOf("plan" to "pro"),
    ),
)

if (result.added) {
    Log.d("GrowSurf", "Referred participant: ${result.participant?.id}")
}
```

{% endtab %}

{% tab title="Java callback" %}

```java
Map<String, String> metadata = new HashMap<>();
metadata.put("plan", "pro");

GrowSurfParticipantInput input = new GrowSurfParticipantInput(
    "person@example.com",
    "Ada",
    "Lovelace",
    null,
    null,
    metadata
);

growsurf.addReferredParticipant(
    input,
    new GrowSurfCallback<GrowSurfAddReferredParticipantResponse>() {
        @Override
        public void onSuccess(GrowSurfAddReferredParticipantResponse result) {
            if (result.getAdded()) {
                GrowSurfParticipant participant = result.getParticipant();
            }
        }

        @Override
        public void onError(Throwable error) {
            Log.e("GrowSurf", "Add referred participant error", error);
        }
    }
);
```

{% endtab %}
{% endtabs %}

| Parameter      | Data Type                                                  | Description                                                                                                 |
| -------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| **`input`**    | `GrowSurfParticipantInput`                                 | (Required) Participant fields, optional explicit `referredBy`, optional attribution, and optional metadata. |
| **`callback`** | `GrowSurfCallback<GrowSurfAddReferredParticipantResponse>` | (Optional) Java-friendly callback overload.                                                                 |

Returns `GrowSurfAddReferredParticipantResponse`.

{% hint style="info" %}
If no participant is added, `notAddedReason` will be `NO_REFERRER`, `INVALID_REFERRER`, or `PARTICIPANT_ALREADY_EXISTS`.
{% endhint %}

***

### Add participant

Use this for public signup flows where the SDK can create a participant even without a referral. It sends pending attribution when available, stores the returned participant token when present, and includes the SDK-generated mobile instance ID for anti-fraud.

{% tabs %}
{% tab title="Kotlin coroutine" %}

```kotlin
val response = growsurf.addParticipant(
    GrowSurfParticipantInput(
        email = "person@example.com",
        firstName = "Ada",
        lastName = "Lovelace",
        metadata = mapOf("plan" to "pro"),
    ),
)

response.participant?.let { participant ->
    Log.d("GrowSurf", "Created participant: ${participant.id}")
}
```

{% endtab %}

{% tab title="Java callback" %}

```java
Map<String, String> metadata = new HashMap<>();
metadata.put("plan", "pro");

GrowSurfParticipantInput input = new GrowSurfParticipantInput(
    "person@example.com",
    "Ada",
    "Lovelace",
    null,
    null,
    metadata
);

growsurf.addParticipant(
    input,
    new GrowSurfCallback<GrowSurfCreateParticipantResponse>() {
        @Override
        public void onSuccess(GrowSurfCreateParticipantResponse result) {
            GrowSurfParticipant participant = result.getParticipant();
            if (participant != null) {
                Log.d("GrowSurf", "Created participant: " + participant.getId());
            }
        }

        @Override
        public void onError(Throwable error) {
            Log.e("GrowSurf", "Create participant error", error);
        }
    }
);
```

{% endtab %}
{% endtabs %}

| Parameter      | Data Type                                             | Description                                                                 |
| -------------- | ----------------------------------------------------- | --------------------------------------------------------------------------- |
| **`input`**    | `GrowSurfParticipantInput`                            | (Required) Participant fields, optional attribution, and optional metadata. |
| **`callback`** | `GrowSurfCallback<GrowSurfCreateParticipantResponse>` | (Optional) Java-friendly callback overload.                                 |

Returns `GrowSurfCreateParticipantResponse`.

{% hint style="info" %}
Use this method for public signup flows where the SDK should create a new participant. If the email already belongs to an existing participant, GrowSurf returns `requiresParticipantToken: true` and does not return a participant token. For signed-in or existing users, use an SDK-issued participant token you already have, or create a mobile participant token from your backend, then pass it to `setParticipantToken(...)` or `GrowSurfWindowIdentity.ExistingParticipantToken(...)`.
{% endhint %}

***

### Get participant

Use this after you have a participant token to load the participant's referral data, including their referral link and counts.

```kotlin
growsurf.getParticipant()
```

Returns `GrowSurfParticipant`.

#### **Example use**

```kotlin
val participant = growsurf.getParticipant()
Log.d("GrowSurf", participant.shareUrl.orEmpty())
```

***

### Update participant

Use this when your app lets a participant update profile fields, such as first name, last name, or metadata.

```kotlin
growsurf.updateParticipant(input)
```

| Parameter   | Data Type                        | Description                                                                   |
| ----------- | -------------------------------- | ----------------------------------------------------------------------------- |
| **`input`** | `GrowSurfParticipantUpdateInput` | (Required) Fields to update, such as `firstName`, `lastName`, and `metadata`. |

Returns `GrowSurfParticipant`.

#### **Example use**

```kotlin
val participant = growsurf.updateParticipant(
    GrowSurfParticipantUpdateInput(
        firstName = "Ada",
        lastName = "Lovelace",
        metadata = mapOf("plan" to "enterprise"),
    ),
)
```

***

### Update vanity links

Use this when your app lets a participant manage multiple custom referral link keys at once.

```kotlin
growsurf.updateVanityLinks(vanityKeys)
```

| Parameter        | Data Type      | Description                                               |
| ---------------- | -------------- | --------------------------------------------------------- |
| **`vanityKeys`** | `List<String>` | (Required) Vanity keys to associate with the participant. |

Returns `GrowSurfParticipant`.

#### **Example use**

```kotlin
val participant = growsurf.updateVanityLinks(
    vanityKeys = listOf("ada", "ada-pro"),
)
```

***

## REFERRALS AND INVITES ↓

### Get participant referrals

Use this to show who a participant has referred and the status of each referral.

```kotlin
growsurf.getParticipantReferrals(
    limit = 20,
    offset = 0,
)
```

| Parameter    | Data Type | Description                               |
| ------------ | --------- | ----------------------------------------- |
| **`limit`**  | `Int?`    | (Optional) Number of referrals to return. |
| **`offset`** | `Int?`    | (Optional) Offset for pagination.         |

Returns `GrowSurfReferralsResponse`.

#### **Example use**

```kotlin
val response = growsurf.getParticipantReferrals(
    limit = 20,
)

response.referrals.forEach { referral ->
    Log.d("GrowSurf", "${referral.email}: ${referral.referralStatus}")
}
```

***

### Send invites

Use this to send referral invite emails from a participant's referral screen.

```kotlin
growsurf.sendInvites(
    emailAddresses = listOf("friend@example.com"),
    messageText = "Join me on GrowSurf",
    subjectText = "You're invited",
)
```

| Parameter            | Data Type      | Description                           |
| -------------------- | -------------- | ------------------------------------- |
| **`emailAddresses`** | `List<String>` | (Required) Email addresses to invite. |
| **`messageText`**    | `String`       | (Required) Invite message body.       |
| **`subjectText`**    | `String?`      | (Optional) Invite email subject.      |

Returns `GrowSurfInviteResponse`.

#### **Example use**

```kotlin
val response = growsurf.sendInvites(
    emailAddresses = listOf("friend@example.com"),
    messageText = "Try this app with my referral link.",
    subjectText = "Join me",
)
```

***

### Track share

Call this after a participant shares their referral link from your UI. GrowSurf records the share type, such as `copy`, `email`, `sms`, or a social channel.

```kotlin
growsurf.trackShare(type)
```

| Parameter  | Data Type | Description                                                                                                               |
| ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------- |
| **`type`** | `String`  | (Required) Share type, such as `copy`, `email`, `sms`, or a social channel type returned by the GrowSurf window response. |

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```kotlin
growsurf.trackShare(
    type = "copy",
)
```

***

## REFERRAL PROGRAMS ↓

### Trigger referral

<mark style="color:orange;">Referral programs only</mark>

Use this when a referred participant completes the in-app action that should count as a referral conversion. For purchases or other high-trust events, trigger referral credit from your backend instead.

```kotlin
growsurf.triggerReferral()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```kotlin
val response = growsurf.triggerReferral()
```

{% hint style="warning" %}
For server-verified purchases, subscriptions, or other high-trust reward events, trigger referral credit from your backend using the REST API or a GrowSurf integration instead of from the app.
{% endhint %}

***

### Get participant rewards

<mark style="color:orange;">Referral programs only</mark>

Use this to show the rewards a participant has earned or can track inside your app.

```kotlin
growsurf.getParticipantRewards(
    limit = 20,
    nextId = null,
)
```

| Parameter    | Data Type | Description                             |
| ------------ | --------- | --------------------------------------- |
| **`limit`**  | `Int?`    | (Optional) Number of rewards to return. |
| **`nextId`** | `String?` | (Optional) Cursor ID for the next page. |

Returns `GrowSurfRewardsResponse`.

#### **Example use**

```kotlin
val rewards = growsurf.getParticipantRewards(
    limit = 20,
)
```

***

### Mark participant rewards read

<mark style="color:orange;">Referral programs only</mark>

Call this after showing reward notifications so GrowSurf can clear the participant's unread reward state.

```kotlin
growsurf.markParticipantRewardsRead()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```kotlin
growsurf.markParticipantRewardsRead()
```

***

### Get participant referral summary

<mark style="color:orange;">Referral programs only</mark>

Use this for referral programs to show a participant's high-level referral stats (referrals, leads, expired referrals, clicks, rewards earned, pending rewards, invites sent).

```kotlin
growsurf.getParticipantReferralSummary()
```

Returns `GrowSurfReferralSummary`.

#### **Example use**

```kotlin
val summary = growsurf.getParticipantReferralSummary()
Log.d("GrowSurf", "Referrals: ${summary.referrals}")
```

***

## AFFILIATE PROGRAMS ↓

### Get participant commissions

<mark style="color:orange;">Affiliate programs only</mark>

Use this for affiliate programs to show a participant's commission history.

```kotlin
growsurf.getParticipantCommissions(
    limit = 20,
    nextId = null,
)
```

| Parameter    | Data Type | Description                                 |
| ------------ | --------- | ------------------------------------------- |
| **`limit`**  | `Int?`    | (Optional) Number of commissions to return. |
| **`nextId`** | `String?` | (Optional) Cursor ID for the next page.     |

Returns `GrowSurfCommissionsResponse`.

#### **Example use**

```kotlin
val commissions = growsurf.getParticipantCommissions(
    limit = 20,
)
```

***

### Mark participant commissions read

<mark style="color:orange;">Affiliate programs only</mark>

Call this after showing commission notifications so GrowSurf can clear the participant's unread commission state.

```kotlin
growsurf.markParticipantCommissionsRead()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```kotlin
growsurf.markParticipantCommissionsRead()
```

***

### Get participant payouts

<mark style="color:orange;">Affiliate programs only</mark>

Use this for affiliate programs to show a participant's payout history.

```kotlin
growsurf.getParticipantPayouts(
    limit = 20,
    nextId = null,
)
```

| Parameter    | Data Type | Description                             |
| ------------ | --------- | --------------------------------------- |
| **`limit`**  | `Int?`    | (Optional) Number of payouts to return. |
| **`nextId`** | `String?` | (Optional) Cursor ID for the next page. |

Returns `GrowSurfPayoutsResponse`.

#### **Example use**

```kotlin
val payouts = growsurf.getParticipantPayouts(
    limit = 20,
)
```

***

### Mark participant payouts read

<mark style="color:orange;">Affiliate programs only</mark>

Call this after showing payout notifications so GrowSurf can clear the participant's unread payout state.

```kotlin
growsurf.markParticipantPayoutsRead()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```kotlin
growsurf.markParticipantPayoutsRead()
```

***

### Get participant affiliate summary

<mark style="color:orange;">Affiliate programs only</mark>

Use this for affiliate programs to show a participant's high-level affiliate stats, such as referral revenue, total paid out, and upcoming payout.

```kotlin
growsurf.getParticipantAffiliateSummary()
```

Returns `GrowSurfAffiliateSummary`.

#### **Example use**

```kotlin
val summary = growsurf.getParticipantAffiliateSummary()
Log.d("GrowSurf", "Upcoming payout: ${summary.upcomingPayout}")
```

***

### Request PayPal confirm email

<mark style="color:orange;">Affiliate programs only</mark>

Use this when your affiliate program needs the participant to confirm their PayPal email before payouts can continue.

```kotlin
growsurf.requestPaypalConfirmEmail()
```

Returns `GrowSurfSuccessResponse`.

#### **Example use**

```kotlin
val response = growsurf.requestPaypalConfirmEmail()
```

***

### Request tax info session

Use this when the campaign requires tax documentation and the participant needs to complete or resubmit their W-9 / W-8 form before rewards or payouts can continue. It starts a secure hosted tax-form session and returns the hosted URL to open (in a browser or Chrome Custom Tab) plus the participant's new tax status. The native GrowSurf window calls this automatically from its Tax Forms settings row; call it yourself only if you build a custom settings UI.

```kotlin
growsurf.requestTaxInfoSession()
```

Returns `GrowSurfTaxSessionResponse`.

#### **Example use**

```kotlin
val session = growsurf.requestTaxInfoSession()
session.hostedUrl?.let { url ->
    startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
}
```

{% hint style="info" %}
GrowSurf never stores participant tax IDs. The W-9 / W-8 is completed on a hosted page served by GrowSurf's IRS-authorized e-file partner.
{% endhint %}

***

## ATTRIBUTION ADAPTERS ↓

### Branch attribution adapter

Use this helper when Branch returns attribution data. It normalizes Branch payloads and can store the resulting GrowSurf attribution on the SDK.

```kotlin
GrowSurfBranchAttribution.normalize(parameters)
GrowSurfBranchAttribution.handle(parameters, growsurf)
```

| Method                                                     | Description                                                            |
| ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| **`normalize(parameters: Map<String, *>)`**                | Converts a mixed map, then parses attribution without storing it.      |
| **`normalize(json: JSONObject)`**                          | Parses JSON attribution without storing it.                            |
| **`handle(parameters: Map<String, *>, sdk: GrowSurfSdk)`** | Converts, parses, and stores attribution on the provided SDK instance. |
| **`handle(json: JSONObject, sdk: GrowSurfSdk)`**           | Parses and stores attribution on the provided SDK instance.            |

#### **Example use**

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import com.growsurf.sdk.attribution.branch.GrowSurfBranchAttribution

val attribution = GrowSurfBranchAttribution.handle(branchParams, growsurf)
```

{% endtab %}

{% tab title="Java normalize" %}

```java
GrowSurfAttribution attribution = GrowSurfBranchAttribution.normalize(branchJson);
```

{% endtab %}
{% endtabs %}

***

### Adjust attribution adapter

Use this helper when Adjust returns a deep link. It normalizes the URI or URL and can store the resulting GrowSurf attribution on the SDK.

```kotlin
GrowSurfAdjustAttribution.normalize(uri)
GrowSurfAdjustAttribution.handle(uri, growsurf)
```

| Method                                      | Description                                                         |
| ------------------------------------------- | ------------------------------------------------------------------- |
| **`normalize(uri: Uri)`**                   | Parses a URI and returns `GrowSurfAttribution?` without storing it. |
| **`normalize(url: String)`**                | Parses a URL string or encoded URL string without storing it.       |
| **`handle(uri: Uri, sdk: GrowSurfSdk)`**    | Parses and stores attribution on the provided SDK instance.         |
| **`handle(url: String, sdk: GrowSurfSdk)`** | Parses and stores attribution on the provided SDK instance.         |

#### **Example use**

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import com.growsurf.sdk.attribution.adjust.GrowSurfAdjustAttribution

val attribution = GrowSurfAdjustAttribution.handle(adjustDeepLink, growsurf)
```

{% endtab %}

{% tab title="Java normalize" %}

```java
GrowSurfAttribution attribution = GrowSurfAdjustAttribution.normalize(adjustUri);
```

{% endtab %}
{% endtabs %}

***

### AppsFlyer attribution adapter

Use this helper when AppsFlyer returns conversion or deep link data. It normalizes the payload and can store the resulting GrowSurf attribution on the SDK.

```kotlin
GrowSurfAppsFlyerAttribution.normalize(parameters)
GrowSurfAppsFlyerAttribution.handle(parameters, growsurf)
```

| Method                                                     | Description                                                            |
| ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| **`normalize(parameters: Map<String, *>)`**                | Converts a mixed map, then parses attribution without storing it.      |
| **`normalize(json: JSONObject)`**                          | Parses JSON attribution without storing it.                            |
| **`handle(parameters: Map<String, *>, sdk: GrowSurfSdk)`** | Converts, parses, and stores attribution on the provided SDK instance. |
| **`handle(json: JSONObject, sdk: GrowSurfSdk)`**           | Parses and stores attribution on the provided SDK instance.            |

#### **Example use**

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import com.growsurf.sdk.attribution.appsflyer.GrowSurfAppsFlyerAttribution

val attribution = GrowSurfAppsFlyerAttribution.handle(conversionData, growsurf)
```

{% endtab %}

{% tab title="Java normalize" %}

```java
GrowSurfAttribution attribution = GrowSurfAppsFlyerAttribution.normalize(conversionJson);
```

{% endtab %}
{% endtabs %}

***

### Singular attribution adapter

Use this helper when Singular returns callback parameters or deep link values. It normalizes the payload and can store the resulting GrowSurf attribution on the SDK.

```kotlin
GrowSurfSingularAttribution.normalize(parameters)
GrowSurfSingularAttribution.handle(parameters, growsurf)
```

| Method                                                     | Description                                                            |
| ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| **`normalize(parameters: Map<String, *>)`**                | Converts a mixed map, then parses attribution without storing it.      |
| **`normalize(json: JSONObject)`**                          | Parses JSON attribution without storing it.                            |
| **`normalize(uri: Uri)`**                                  | Parses a URI without storing it.                                       |
| **`normalize(url: String)`**                               | Parses a URL string or encoded URL string without storing it.          |
| **`handle(parameters: Map<String, *>, sdk: GrowSurfSdk)`** | Converts, parses, and stores attribution on the provided SDK instance. |
| **`handle(json: JSONObject, sdk: GrowSurfSdk)`**           | Parses and stores attribution on the provided SDK instance.            |
| **`handle(uri: Uri, sdk: GrowSurfSdk)`**                   | Parses and stores attribution on the provided SDK instance.            |
| **`handle(url: String, sdk: GrowSurfSdk)`**                | Parses and stores attribution on the provided SDK instance.            |

#### **Example use**

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import com.growsurf.sdk.attribution.singular.GrowSurfSingularAttribution

val attribution = GrowSurfSingularAttribution.handle(singularPayload, growsurf)
```

{% endtab %}

{% tab title="Java normalize" %}

```java
GrowSurfAttribution attribution = GrowSurfSingularAttribution.normalize(singularJson);
```

{% endtab %}
{% endtabs %}

***

## UTILITIES ↓

### Normalize attribution parameters

Use this when you need to read GrowSurf attribution from raw provider parameters without storing it. It looks for `grsf`, `ref`, or `referredBy` directly and inside URL-like values.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
val attribution = GrowSurfAttributionNormalizer.normalize(
    parameters = mapOf(
        "deep_link_value" to "https://example.com/signup?grsf=referrer_id",
        "click_id" to "click_123",
    ),
    provider = "appsflyer",
)
```

{% endtab %}

{% tab title="Java" %}

```java
Map<String, String> parameters = new HashMap<>();
parameters.put("deep_link_value", "https://example.com/signup?grsf=referrer_id");
parameters.put("click_id", "click_123");

GrowSurfAttribution attribution = GrowSurfAttributionNormalizer.normalize(
    parameters,
    "appsflyer"
);
```

{% endtab %}
{% endtabs %}

| Parameter        | Data Type             | Description                                                                                |
| ---------------- | --------------------- | ------------------------------------------------------------------------------------------ |
| **`parameters`** | `Map<String, String>` | (Required) Raw parameters. The normalizer checks direct fields and URL-like nested values. |
| **`provider`**   | `String?`             | (Optional) Provider name to attach to the attribution result.                              |

Returns `GrowSurfAttribution?`.

***

### Normalize attribution URI

Use this when you need to parse a URI for `grsf`, `ref`, or `referredBy` without storing attribution on the SDK.

```kotlin
GrowSurfAttributionNormalizer.normalize(uri, provider = "adjust")
```

| Parameter      | Data Type | Description                                                   |
| -------------- | --------- | ------------------------------------------------------------- |
| **`uri`**      | `Uri`     | (Required) URI to parse.                                      |
| **`provider`** | `String?` | (Optional) Provider name to attach to the attribution result. |

Returns `GrowSurfAttribution?`.

#### **Example use**

```kotlin
val attribution = GrowSurfAttributionNormalizer.normalize(
    Uri.parse("https://example.com/signup?grsf=referrer_id"),
    provider = "adjust",
)
```

***

### Normalize attribution JSON

Use this when a provider gives you a JSON payload and you need to find `grsf`, `ref`, or `referredBy` without storing attribution on the SDK.

```kotlin
GrowSurfAttributionNormalizer.normalize(json, provider = "branch")
```

| Parameter      | Data Type    | Description                                                   |
| -------------- | ------------ | ------------------------------------------------------------- |
| **`json`**     | `JSONObject` | (Required) JSON provider payload.                             |
| **`provider`** | `String?`    | (Optional) Provider name to attach to the attribution result. |

Returns `GrowSurfAttribution?`.

#### **Example use**

```kotlin
val attribution = GrowSurfAttributionNormalizer.normalize(
    JSONObject().put("~referring_link", "https://example.com?grsf=referrer_id"),
    provider = "branch",
)
```

***

### Convert attribution parameters to strings

Use this before passing mixed provider callback payloads to the normalizer or SDK attribution methods. It converts nested values into a `Map<String, String>` without storing attribution.

```kotlin
GrowSurfAttributionNormalizer.stringParameters(parameters)
```

| Parameter        | Data Type                        | Description                                                                           |
| ---------------- | -------------------------------- | ------------------------------------------------------------------------------------- |
| **`parameters`** | `Map<String, *>` or `JSONObject` | (Required) Provider callback payload. Nested values are flattened into string values. |

Returns `Map<String, String>`.

#### **Example use**

```kotlin
val stringParameters = GrowSurfAttributionNormalizer.stringParameters(providerPayload)

growsurf.handleAttributionParameters(
    stringParameters,
    provider = "branch",
)
```


# Models and Errors

Models, callbacks, stores, interfaces, and errors exposed by the GrowSurf Android SDK.

This reference documents the models, callbacks, advanced interfaces, stores, and errors exposed by the GrowSurf Android SDK.

## Core models

### GrowSurfConfiguration

| Field        | Type     | Description              |
| ------------ | -------- | ------------------------ |
| `campaignId` | `String` | GrowSurf program ID.     |
| `publicKey`  | `String` | Mobile SDK public key.   |
| `baseUrl`    | `String` | Mobile SDK API base URL. |

### GrowSurfAttribution

| Field        | Type       | Description                                                  |
| ------------ | ---------- | ------------------------------------------------------------ |
| `referredBy` | `String?`  | Referrer participant ID or vanity key.                       |
| `ref`        | `String?`  | Referrer value mirrored for provider compatibility.          |
| `unique`     | `Boolean?` | Whether the attribution provider marked the click as unique. |
| `provider`   | `String?`  | Attribution provider name.                                   |
| `clickId`    | `String?`  | Provider click ID.                                           |

### GrowSurfParticipantInput

| Field         | Type                   | Description                                  |
| ------------- | ---------------------- | -------------------------------------------- |
| `email`       | `String`               | Participant email address.                   |
| `firstName`   | `String?`              | Participant first name.                      |
| `lastName`    | `String?`              | Participant last name.                       |
| `referredBy`  | `String?`              | Explicit referrer value.                     |
| `attribution` | `GrowSurfAttribution?` | Explicit attribution payload.                |
| `metadata`    | `Map<String, String>?` | Custom metadata to store on the participant. |

{% hint style="info" %}
`mobileInstanceId` is generated and sent by the SDK automatically. It is not part of `GrowSurfParticipantInput`.
{% endhint %}

### GrowSurfParticipantUpdateInput

| Field       | Type                   | Description         |
| ----------- | ---------------------- | ------------------- |
| `firstName` | `String?`              | Updated first name. |
| `lastName`  | `String?`              | Updated last name.  |
| `metadata`  | `Map<String, String>?` | Updated metadata.   |

### GrowSurfCampaign

| Field              | Type                           |
| ------------------ | ------------------------------ |
| `id`               | `String`                       |
| `name`             | `String?`                      |
| `type`             | `String?`                      |
| `referralCount`    | `Int?`                         |
| `participantCount` | `Int?`                         |
| `impressionCount`  | `Int?`                         |
| `inviteCount`      | `Int?`                         |
| `winnerCount`      | `Int?`                         |
| `currencyISO`      | `String?`                      |
| `status`           | `String?`                      |
| `rewards`          | `List<GrowSurfCampaignReward>` |

### GrowSurfCampaignReward

| Field                   | Type       |
| ----------------------- | ---------- |
| `id`                    | `String?`  |
| `type`                  | `String?`  |
| `title`                 | `String?`  |
| `description`           | `String?`  |
| `referralDescription`   | `String?`  |
| `isUnlimited`           | `Boolean?` |
| `limit`                 | `Int?`     |
| `conversionsRequired`   | `Int?`     |
| `numberOfWinners`       | `Int?`     |
| `imageUrl`              | `String?`  |
| `order`                 | `Int?`     |
| `limitDuration`         | `String?`  |
| `nextMilestonePrefix`   | `String?`  |
| `nextMilestoneSuffix`   | `String?`  |
| `couponCode`            | `String?`  |
| `referredRewardUpfront` | `Boolean?` |

### GrowSurfParticipant

| Field                      | Type           |
| -------------------------- | -------------- |
| `id`                       | `String`       |
| `email`                    | `String?`      |
| `firstName`                | `String?`      |
| `lastName`                 | `String?`      |
| `shareUrl`                 | `String?`      |
| `paypalEmailAddress`       | `String?`      |
| `referralCount`            | `Int?`         |
| `inviteCount`              | `Int?`         |
| `monthlyReferralCount`     | `Int?`         |
| `prevMonthlyReferralCount` | `Int?`         |
| `rank`                     | `Int?`         |
| `monthlyRank`              | `Int?`         |
| `prevMonthlyRank`          | `Int?`         |
| `vanityKeys`               | `List<String>` |
| `unreadCommissionsCount`   | `Int?`         |
| `unreadPayoutsCount`       | `Int?`         |

### GrowSurfCreateParticipantResponse

| Field                      | Type                      |
| -------------------------- | ------------------------- |
| `participantToken`         | `String?`                 |
| `expiresIn`                | `Int?`                    |
| `participant`              | `GrowSurfParticipant?`    |
| `isNew`                    | `Boolean?`                |
| `requiresParticipantToken` | `Boolean?`                |
| `window`                   | `GrowSurfWindowResponse?` |

### GrowSurfAddReferredParticipantResponse

| Field                      | Type                                            |
| -------------------------- | ----------------------------------------------- |
| `added`                    | `Boolean`                                       |
| `validReferral`            | `Boolean`                                       |
| `referredBy`               | `String?`                                       |
| `notAddedReason`           | `GrowSurfAddReferredParticipantNotAddedReason?` |
| `participantToken`         | `String?`                                       |
| `expiresIn`                | `Int?`                                          |
| `participant`              | `GrowSurfParticipant?`                          |
| `isNew`                    | `Boolean?`                                      |
| `requiresParticipantToken` | `Boolean?`                                      |

### GrowSurfAddReferredParticipantNotAddedReason

| Case                         | Value                        |
| ---------------------------- | ---------------------------- |
| `NO_REFERRER`                | `no_referrer`                |
| `INVALID_REFERRER`           | `invalid_referrer`           |
| `PARTICIPANT_ALREADY_EXISTS` | `participant_already_exists` |

### Referral and reward models

| Model                              | Fields                                                                                                      |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `GrowSurfReferralsResponse`        | `referrals`, `limit`, `nextOffset`, `more`                                                                  |
| `GrowSurfReferral`                 | `id`, `email`, `referralStatus`, `createdAt`, `updatedAt`, `referralTriggeredAt`, `referralCreditExpiredAt` |
| `GrowSurfRewardsResponse`          | `rewards`, `limit`, `nextId`                                                                                |
| `GrowSurfReward`                   | `id`, `status`, `unread`, `approved`, `rewardId`, `title`, `description`, `isReferrer`                      |
| `GrowSurfSuccessResponse`          | `success`, `message`                                                                                        |
| `GrowSurfAttributionResponse`      | `success`, `valid`, `referredBy`                                                                            |
| `GrowSurfValidateReferrerResponse` | `success`, `valid`, `referredBy`                                                                            |
| `GrowSurfInviteResponse`           | `success`, `message`, `messageType`                                                                         |

## GrowSurf window models

### GrowSurfWindowIdentity

| Case                                          | Description                                                                                                                                                                                                          |
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Anonymous`                                   | Loads the window without participant identity.                                                                                                                                                                       |
| `ParticipantFields(GrowSurfParticipantInput)` | Creates a new participant from fields before loading the window. Existing participants need a participant token; use `ExistingParticipantToken(String)` with a token created by your backend or returned by the SDK. |
| `ExistingParticipantToken(String)`            | Uses a participant token created by your backend or by the SDK.                                                                                                                                                      |

### GrowSurfWindowTheme

| Field               | Type                              | Description                                                 |
| ------------------- | --------------------------------- | ----------------------------------------------------------- |
| `primaryColor`      | `Long?`                           | Optional ARGB primary color override, such as `0xFF13795B`. |
| `colorScheme`       | `GrowSurfWindowColorScheme`       | `SYSTEM`, `LIGHT`, or `DARK`.                               |
| `cornerRadiusDp`    | `Float?`                          | Optional corner radius override in dp.                      |
| `presentationStyle` | `GrowSurfWindowPresentationStyle` | `AUTOMATIC`, `FULL_SCREEN`, or `SHEET`.                     |

### GrowSurfWindowCallbacks

| Callback                   | Type                                     |
| -------------------------- | ---------------------------------------- |
| `onOpen`                   | `() -> Unit`                             |
| `onClose`                  | `() -> Unit`                             |
| `onParticipantCreated`     | `(GrowSurfParticipant, String?) -> Unit` |
| `onShareTracked`           | `(String) -> Unit`                       |
| `onInviteSent`             | `() -> Unit`                             |
| `onPayoutOrSettingsAction` | `(String) -> Unit`                       |
| `onError`                  | `(Throwable) -> Unit`                    |

### GrowSurfWindowController

| Method    | Description                           |
| --------- | ------------------------------------- |
| `close()` | Closes the presented GrowSurf window. |

### GrowSurfWindowResponse

| Field              | Type                           |
| ------------------ | ------------------------------ |
| `version`          | `String?`                      |
| `campaign`         | `GrowSurfWindowCampaign?`      |
| `signup`           | `GrowSurfWindowSignup?`        |
| `visibleSections`  | `Map<String, Boolean>`         |
| `share`            | `GrowSurfWindowShareConfig?`   |
| `participant`      | `GrowSurfParticipant?`         |
| `unreadCounts`     | `GrowSurfWindowUnreadCounts?`  |
| `payoutSettings`   | `GrowSurfPayoutSettings?`      |
| `content`          | `Map<String, Any?>`            |
| `referrals`        | `GrowSurfReferralsResponse?`   |
| `rewards`          | `GrowSurfRewardsResponse?`     |
| `leaderboard`      | `GrowSurfLeaderboardResponse?` |
| `referralSummary`  | `GrowSurfReferralSummary?`     |
| `affiliateSummary` | `GrowSurfAffiliateSummary?`    |
| `commissions`      | `GrowSurfCommissionsResponse?` |
| `payouts`          | `GrowSurfPayoutsResponse?`     |

### Additional window models

| Model                            | Fields                                                                                                                                                                                                |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GrowSurfWindowCampaign`         | `id`, `type`, `status`, `companyName`, `companyLogoImageUrl`, `goal`, `currencyISO`, `shouldDisplayPoweredBy`, `rewardTypes`, `rewards`, `design`                                                     |
| `GrowSurfWindowSignup`           | `state`, `canCreateParticipant`                                                                                                                                                                       |
| `GrowSurfWindowShareConfig`      | `preferredUrl`, `fallbackUrl`, `nativeShare`, `channels`, `invite`                                                                                                                                    |
| `GrowSurfWindowShareChannel`     | `type`, `label`, `order`, `subject`, `message`, `nativePreferred`                                                                                                                                     |
| `GrowSurfWindowUnreadCounts`     | `commissions`, `payouts`                                                                                                                                                                              |
| `GrowSurfPayoutSettings`         | `provider`, `paypalEmailAddress`, `canRequestPaypalConfirmEmail`, `hostedActions`, `requiredActions`, `payoutInstructionsMode`, `taxInfo`                                                             |
| `GrowSurfTaxInfo`                | `status`, `formType`, `residencyCountryCode`, `vatNumber`, `vatCountryCode`, `statusReason`, `payoutSettings`                                                                                         |
| `GrowSurfTaxSessionResponse`     | `hostedUrl`, `status`                                                                                                                                                                                 |
| `GrowSurfTaxInfoSaveResponse`    | `success`, `taxInfo`                                                                                                                                                                                  |
| `GrowSurfLeaderboardResponse`    | `participants`, `offsetKey`, `nextKey`, `page`, `hasMore`                                                                                                                                             |
| `GrowSurfLeaderboardParticipant` | `id`, `rank`, `monthlyRank`, `prevMonthlyRank`, `email`, `isWinner`, `referralCount`, `monthlyReferralCount`, `prevMonthlyReferralCount`, `pendingReferralCount`, `revenueAmount`, `commissionAmount` |
| `GrowSurfReferralSummary`        | `referrals`, `leads`, `expiredReferrals`, `clicks`, `rewardsEarned`, `pendingRewards`, `invitesSent`, `currencyISO`                                                                                   |
| `GrowSurfAffiliateSummary`       | `referralRevenue`, `totalPaidOut`, `upcomingPayout`, `referrals`, `leads`, `clicks`, `currencyISO`                                                                                                    |
| `GrowSurfCommissionsResponse`    | `commissions`, `totalCount`, `totalAmount`, `summary`, `nextId`                                                                                                                                       |
| `GrowSurfCommission`             | `id`, `amount`, `currencyISO`, `status`, `holdDuration`, `createdAt`, `amountInCampaignCurrency`, `saleAmountInCampaignCurrency`, `campaignCurrencyISO`, `unread`                                     |
| `GrowSurfPayoutsResponse`        | `payouts`, `totalCount`, `totalAmount`, `summary`, `nextId`                                                                                                                                           |
| `GrowSurfPayout`                 | `id`, `amount`, `currencyISO`, `status`, `queuedAt`, `createdAt`, `amountInCampaignCurrency`, `campaignCurrencyISO`, `unread`                                                                         |

## Advanced interfaces and stores

Use these APIs for tests or custom storage/transport integrations.

| Type                                           | Public methods                                                                                                                            |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `GrowSurfCallback<T>`                          | `onSuccess(result)`, `onError(error)`                                                                                                     |
| `GrowSurfTokenStore`                           | `getSessionToken()`, `getParticipantToken()`, `saveSessionToken(token)`, `saveParticipantToken(token)`, `clear()`                         |
| `GrowSurfAttributionStore`                     | `getAttribution()`, `saveAttribution(attribution)`, `clearAttribution()`, `hasCheckedDeferredDeepLink()`, `markDeferredDeepLinkChecked()` |
| `GrowSurfMobileInstanceIdStore`                | `getMobileInstanceId()`                                                                                                                   |
| `GrowSurfWindowCacheStore`                     | `getWindow(cacheKey, nowMillis)`, `saveWindow(cacheKey, windowJson, expiresAtMillis)`, `clear()`                                          |
| `GrowSurfInstallReferrerClient`                | `getInstallReferrer()`                                                                                                                    |
| `GrowSurfHttpTransport`                        | `execute(request)`                                                                                                                        |
| `GrowSurfHttpRequest`                          | `method`, `url`, `headers`, `body`, `timeoutMillis`                                                                                       |
| `GrowSurfHttpResponse`                         | `statusCode`, `body`                                                                                                                      |
| `EncryptedPreferencesGrowSurfTokenStore`       | EncryptedSharedPreferences-backed token store used by default.                                                                            |
| `PreferencesGrowSurfAttributionStore`          | SharedPreferences-backed attribution store used by default.                                                                               |
| `PreferencesGrowSurfMobileInstanceIdStore`     | SharedPreferences-backed mobile instance ID store used by default.                                                                        |
| `PreferencesGrowSurfWindowCacheStore`          | SharedPreferences-backed window cache store.                                                                                              |
| `EncryptedPreferencesGrowSurfWindowCacheStore` | EncryptedSharedPreferences-backed window cache store used by default.                                                                     |
| `UrlConnectionGrowSurfHttpTransport`           | Default HTTP transport.                                                                                                                   |
| `PlayStoreGrowSurfInstallReferrerClient`       | Default Google Play Install Referrer client.                                                                                              |

## Errors

The SDK throws:

* `GrowSurfException` for SDK state errors such as missing participant tokens.
* `GrowSurfHttpException` for non-2xx HTTP responses. Exposes a `statusCode: Int` property and the response body as the exception message.


# REST API

Use the REST API to create and manage your GrowSurf programs, participants, referrals, rewards, webhooks, and team settings from a secure server-side environment.

{% hint style="info" %}

* **Using AI?** If you're using an AI tool such as Cursor, Claude Code, Antigravity, or Codex to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
* **Using TypeScript, Python, PHP, Ruby, or Java?** Use an official GrowSurf API library. [Learn more](https://docs.growsurf.com/developer-tools/rest-api/api-libraries).
* **Building a native iOS or Android app?** Use the [iOS SDK](/developer-tools/ios-sdk) or [Android SDK](/developer-tools/android-sdk) for mobile attribution, participant creation, sharing, and referral portal data. Use the REST API from your backend for secure server-side actions.
  {% endhint %}

## Getting started

{% hint style="info" %}
**Note:** The GrowSurf REST API is available to the following types of programs (campaigns):

* **Referral programs:** Users on a GrowSurf paid subscription plan
* **Affiliate programs:** Users who have a valid payment method on file
  {% endhint %}

### Step 1: Get your API key

1. Go to [API Keys in GrowSurf Settings](https://app.growsurf.com/settings#api-keys).
2. Create an API key.
3. Copy the new key when GrowSurf shows it. For security, the full key is shown only once.

{% hint style="warning" %}
**Important Tips:**

* Your API key holds many privileges, so keep it secure. Do not share your API key in publicly accessible areas such as GitHub, Bitbucket, web browsers, or frontend client code.
* Do not use the RESTful API in browser applications. Exposing your secret API key within front end code exposes it to security risks. Anybody with a bit of programming knowledge could potentially hijack your API key and begin making requests on your behalf.
* Do not embed your REST API key in native mobile apps. Native iOS and Android apps should use the Mobile SDKs with a public Mobile SDK key. Keep REST API calls on your backend, especially for purchase, subscription, or other server-verified referral qualification events.
  {% endhint %}

***

### Step 2: Set up authentication

The GrowSurf REST API uses your API key to authenticate requests:

1. Set a plain text header named `Authorization` with the contents `Bearer <YOUR_API_ACCESS_KEY>`, where `<YOUR_API_ACCESS_KEY>` is your API key.

#### Example Authenticated Request

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X "GET" "https://api.growsurf.com/v2/campaign/4pdlhb" -H "Authorization: Bearer <YOUR_API_ACCESS_KEY>"
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.growsurf.com/v2/campaign/4pdlhb")
  .get()
  .addHeader("Authorization", "Bearer <YOUR_API_ACCESS_KEY>")
  .build();

Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const request = require("request");

const options = {
  method: 'GET',
  url: 'https://api.growsurf.com/v2/campaign/4pdlhb',
  headers: {
    Authorization: 'Bearer <YOUR_API_ACCESS_KEY>'
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);
  console.log(body);
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.growsurf.com/v2/campaign/4pdlhb"
headers = {
    'Authorization': "Bearer <YOUR_API_ACCESS_KEY>"
    }
response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.growsurf.com/v2/campaign/4pdlhb');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Authorization' => 'Bearer <YOUR_API_ACCESS_KEY>'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {
	url := "https://api.growsurf.com/v2/campaign/4pdlhb"
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Add("Authorization", "Bearer <YOUR_API_ACCESS_KEY>")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)
	fmt.Println(res)
	fmt.Println(string(body))

}
```

{% endtab %}
{% endtabs %}

#### Scoped Access

If a scoped key does not include the required scope or program access for a request, the API returns `403`. You can change API key scopes from your [Settings](https://app.growsurf.com/settings#api-keys) page. Choose only the access that your API key needs:

| Scope                | Access                                                                                                 |
| -------------------- | ------------------------------------------------------------------------------------------------------ |
| `team:read`          | Read the selected team's name and GrowSurf verification state.                                         |
| `team:write`         | Update the team name, request team verification, or resend the team owner verification email.          |
| `api_key:rotate`     | Rotate the API key making the direct REST/SDK request. This scope and action are not available in MCP. |
| `program:read`       | Read programs, reward configuration, emails, installation, options, design, and webhooks.              |
| `program:write`      | Create, clone, and update programs; create, update, or delete reward configuration and webhooks.       |
| `participant:read`   | Read participants, referrals, leaderboards, and participant activity.                                  |
| `participant:write`  | Create and update participants, trigger or cancel referrals, and send participant emails or invites.   |
| `participant:delete` | Delete participants in one request or in bulk.                                                         |
| `reward:read`        | Read issued rewards, commissions, and payouts.                                                         |
| `reward:write`       | Record or refund sales and approve commissions or rewards without fulfilling them.                     |
| `reward:delete`      | Delete issued rewards or commissions.                                                                  |
| `reward:fulfill`     | Fulfill an issued reward. This is separate because fulfillment may deliver something of value.         |
| `analytics:read`     | Read aggregate program and participant analytics.                                                      |

Approving a reward requires `reward:write`. Approving and fulfilling it in the same request requires both `reward:write` and `reward:fulfill`.

***

## Base URL

All endpoints for the GrowSurf REST API start with the same base URL:

```
https://api.growsurf.com/v2
```

***

## **Next steps**

* [View Tutorials](/developer-tools/rest-api/tutorials)
* [View Objects](/developer-tools/rest-api/api-objects)
* [View API Reference](/developer-tools/rest-api/api-reference)


# Tutorials

How to implement the GrowSurf REST API in common use-case scenarios.

{% hint style="success" %}

#### Customer Example: How Bolt.new Powered Their Viral Referral Program with GrowSurf’s API

See our in-depth technical [blog post](https://growsurf.com/blog/how-boltnew-powered-their-viral-referral-program-with-growsurfs-api) on how a GrowSurf customer implemented the API, webhooks, and reward metadata to scale their referral program to millions of users.
{% endhint %}

## Table of contents

The following examples use **Node.js**.

| Scenario                                                                                                                                                                                 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Example 1: Trigger a referral on qualifying action (e.g, on conversion, purchase or upgrade)](#example-1-trigger-a-referral-on-qualifying-action-e.g-on-conversion-purchase-or-upgrade) |
| [Example 2: Trigger a referral on signup event](#example-2-trigger-a-referral-on-signup-event)                                                                                           |
| [Example 3: Get a participant's details](#example-3-get-a-participants-details)                                                                                                          |
| [Example 4: Delete a list of participants](#example-4-delete-a-list-of-participants)                                                                                                     |

## Example 1: Trigger a referral on qualifying action (e.g, on conversion, purchase or upgrade)

{% hint style="info" %}
**Airbnb as an example**

> ***"**&#x53;end a friend $40 in Airbnb credit. You’ll get $20 when they travel and $75 when they host."*

Follow this tutorial if your program's [referral trigger](https://support.growsurf.com/article/188-what-triggers-a-referral) is *Qualifying Action,* where a referrer only receives credit when the person they referred signs up AND performs a certain qualifying action.
{% endhint %}

This requires two API calls to GrowSurf.

### [Step 1: Make sure you have authentication set up](/developer-tools/rest-api#getting-started)

### Step 2: Add the participant

{% hint style="warning" %}
**Important Note:** If your program is configured to add participants automatically through a form on your website ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), skip this ste&#x70;**.**
{% endhint %}

First, in the code where you capture the new user's email, add them to your GrowSurf program as a participant with the [**`POST`** `Add participant`](/developer-tools/rest-api/api-reference#post-campaign-id-participant) method. Alternatively, you can use the JavaScript method [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant) instead to add participants.

The example below is what that code could look like when using the REST API.

**Code Example**

{% code title="signup.js" %}

```javascript
const request = require("request");

let options = {
  method: 'POST',
  url: 'https://api.growsurf.com/v2/campaign/4pdlhb/participant',
  headers: {
    Authorization: 'Bearer <YOUR_API_KEY>'
  },
  json: true
};

const signUp = user => {
    // Set the body of the GrowSurf API request
    options.body = user;

    // Send the API request to add the user as a new participant in your GrowSurf program
    request(options, (error, response, body) => {
      if (error) {
        throw new Error(error);
      }
      const growsurfId = body.id;
      // Save the new user to your database (optional)
      saveUser(user, growsurfId);
    });
};
```

{% endcode %}

**At line 21,** we set the GrowSurf participant ID as a variable called `growsurfId`.

**At line 23**, `saveUser(user, growsurfId)` is an example function you would use to save the GrowSurf participant ID to the new user in your database. We will use this `growsurfId` value later for triggering a referral.

{% hint style="info" %}
**Don't want to save the `growsurfId` to your database?**

The participant's`email` can be used instead of the `growsurfId` to trigger a referral later. If you have access to the participant's email then there is no need to persist the `growsurfId` into your database.
{% endhint %}

**At line 11**, the `user` argument passed into `signUp(user)` is an Object that looks like this:

```javascript
{
  email: 'sally_mayweathers9448@gmail.com',
  firstName: 'Sally', // Optional, but recommended for anti-fraud purposes
  lastName: 'Mayweathers', // Optional, but recommended for anti-fraud purposes
  ipAddress: 1.2.1.827, // Optional, but recommended for anti-fraud purposes
  fingerprint: 'dwah12iu3hi1u2h', // Optional, but recommended for anti-fraud purposes
  referredBy: '1cca8d', // The referrer's unique GrowSurf ID. Can also be the referrer's unique email address
  metadata: {
    phoneNumber: '+1 415-123-4567',
    country: 'USA',
    zipCode: '94303'
  }
}
```

* **At lines 2 and 3,** we pass in `firstName` and `lastName`. These will be used for anti-fraud purposes, as well as in referred friend motivator elements, if enabled.
* **At line 4**, we pass in the user's IP address, which will be used for anti-fraud purposes.
* **At line 5**, we pass in the user's browser fingerprint, which will be used for anti-fraud purposes. You can use a library like [fingerprintjs](https://github.com/fingerprintjs/fingerprintjs) to get this value.
* **At line 6**, we use `referredBy` to associate this new user with a referrer. This value can be the referrer's email address or unique GrowSurf ID (you may want to use [`growsurf.getReferrerId()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-referrer-id) to retrieve the referrer ID).
* **At line 7**, we save a shallow `metadata` Object to the GrowSurf Participant. This is optional, but is useful for viewing specific participant information in your GrowSurf dashboard ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LfiWyhm5z0L0AN3V1o_%2F-Lficu90C8YEPgrdhKyA%2FScreen%20Shot%20on%202019-05-25%20at%2018%3A56%3A33.png?alt=media\&token=1d3a352f-652e-4d13-83bd-aab4aa7ae369)).

### **Step 3: Trigger the referral**

{% hint style="warning" %}
**Important Note:** Make sure your program's referral trigger is set to *Sign Up + Qualifying Action* ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LnvqQyyEju4bLT4R5PC%2F-LnvsusHI0xFY2PJcJzB%2FScreen%20Shot%202019-09-04%20at%206.42.06%20PM.png?alt=media\&token=21db3d41-f20b-4887-833c-8109205cbc89)). If the referral trigger is set to *Sign Up*, triggering referrals will not work since referral credit has already been provided.
{% endhint %}

Now at any future date [within the referral credit window](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LfTU5fPPuEimujYPBlL%2F-LfTUYdelF4Itf1vXW9T%2FScreen%20Shot%20on%202019-05-22%20at%2015%3A42%3A38.png?alt=media\&token=b1bd5196-2825-4229-b280-0c1240b0b30e), if this new participant performs the goal event, then referral credit will be awarded to their referrer. To trigger the referral, use the [**`POST`** `Trigger referral by participant ID`](/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail-ref) method.

The example below is what that code could look like.

**Code Example**

{% code title="purchase.js" %}

```javascript
const request = require("request");

let options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <YOUR_API_KEY>'
  },
  json: true
};

const purchase = growsurfId => {
    // ...code that makes the purchase...

    // Set the GrowSurf API request URL with the participant's ID
    options.url = `https://api.growsurf.com/v2/campaign/4pdlhb/participant/${growsurfId}/ref`;

    // Send the API request to trigger the referral
    request(options, (error, response, body) => {
      if (error) {
        throw new Error(error);
      }
      // Check to see if the referral was triggered successfully
      const { success, message } = body.success;
      if(success) {
        console.log('Referral trigger success!');
      } else {
        console.log('Referral trigger failed :( ', message);
      }
    });
};
```

{% endcode %}

**At line 11**, we passed a `growsurfId` argument, which is the GrowSurf participant's unique ID and is required in the API call. If you do not have access to the `growsurfId` of the participant, the participant `email` can be used instead.

{% hint style="info" %}

### **Want to honor a refund or cancellation window?**

You can hold the referral credit for a set number of days before it is awarded by including an optional `delayInDays` value (an integer between `1` and `90`) in the request body of the [`POST` `Trigger referral`](/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail-ref) call. If the purchase is refunded during that window, cancel the pending trigger with the [`DELETE` `Cancel delayed referral trigger`](/developer-tools/rest-api/api-reference#delete-campaign-id-participant-participantidoremail-ref) method before the credit is awarded.
{% endhint %}

{% hint style="info" %}
**Remember to set up reward fulfillment automation**

Make sure you have [Webhooks](/developer-tools/webhooks) or [Zapier](/integrations/zapier) set up so that rewards automatically get fulfilled to the participant once they reach a reward goal.
{% endhint %}

## Example 2: Trigger a referral on signup event

{% hint style="info" %}
**Dropbox as an example**

> ***"**&#x46;or every friend you refer, you’ll both receive an extra 250MB in cloud storage."*

Follow this tutorial if your program's [referral trigger](https://support.growsurf.com/article/188-what-triggers-a-referral) is *Signup Event*, where a referrer receives credit when the person they referred signs up with their email address.
{% endhint %}

This requires just one API call to GrowSurf.

### [Step 1: Make sure you have authentication set up](/developer-tools/rest-api#getting-started)

### Step 2: Add the participant (and trigger the referral at the same time)

{% hint style="warning" %}
**Important Notes:**

* If your program is configured to add participants automatically through a form on your website ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), skip this ste&#x70;**.**
* Make sure your program's referral trigger is set to *Signup Event* ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-Lnvt7uOcb1oD4xpY-jJ%2F-Lnvtjtp4i_3zpP2Yag7%2FScreen%20Shot%202019-09-04%20at%206.40.09%20PM.png?alt=media\&token=58dea9be-eb47-42c0-b1af-cb392c246e6b)).
  {% endhint %}

In the code where you capture the new user's email, add them to your GrowSurf program as a participant with the [**`POST`** `Add participant`](/developer-tools/rest-api/api-reference#post-campaign-id-participant) method.

The example below is what that code could look like.

**Code Example**

{% code title="signup.js" %}

```javascript
const request = require("request");

let options = {
  method: 'POST',
  url: 'https://api.growsurf.com/v2/campaign/4pdlhb/participant',
  headers: {
    Authorization: 'Bearer <YOUR_API_KEY>'
  },
  json: true
};

const signUp = user => {
    // Set the body of the GrowSurf API request
    options.body = user;

    // Send the API request to add the user as a new participant in your GrowSurf program
    request(options, (error, response, body) => {
      if (error) {
        throw new Error(error);
      }

      // Save the new user to your database (Optional)
      saveUser();
    });
};
```

{% endcode %}

**At line 12**, the `user` argument passed into `signUp(user)` is an Object that looks like this:

```javascript
{
  email: 'sally_mayweathers9448@gmail.com',
  firstName: 'Sally', // Optional, but recommended for anti-fraud purposes
  lastName: 'Mayweathers', // Optional, but recommended for anti-fraud purposes
  ipAddress: 1.2.1.827, // Optional, but recommended for anti-fraud purposes
  fingerprint: 'dwah12iu3hi1u2h', // Optional, but recommended for anti-fraud purposes
  referredBy: '1cca8d', // The referrer's unique GrowSurf ID. Can also be the referrer's unique email address
  referralStatus: 'CREDIT_AWARDED',
  metadata: {
    phoneNumber: '+1 415-123-4567',
    country: 'USA',
    zipCode: '94303'
  }
}
```

* **At lines 2 and 3,** we pass in `firstName` and `lastName`. These will be used for anti-fraud purposes, as well as in referred friend motivator elements, if enabled.
* **At line 4**, we pass in the user's IP address, which will be used for anti-fraud purposes.
* **At line 5**, we pass in the user's browser fingerprint, which will be used for anti-fraud purposes. You can use a library like [fingerprintjs](https://github.com/fingerprintjs/fingerprintjs) to get this value.
* **At line 6**, we use `referredBy` to associate this new user with a referrer. This value can be the referrer's email address or unique GrowSurf ID (you may want to use [`growsurf.getReferrerId()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-referrer-id) to retrieve the referrer ID)
* **At line 7**, we set `referralStatus` to be `CREDIT_AWARDED`. This triggers the referral credit at the same time that this new participant is added (and it overrides the program referral trigger ([what's a referral trigger?](https://support.growsurf.com/article/188-what-triggers-a-referral)) that was set from the *Installation* step of the *Program Editor* ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LfU6JzlO17UzeyVOQcZ%2F-LfU6SW-uc8zI2uuzeah%2FScreen%20Shot%20on%202019-05-22%20at%2018%3A36%3A23.png?alt=media\&token=6204ba21-12b5-4630-90e3-f6117230d7f9)).
  * **Note:** `referralStatus` must be used with `referredBy`, or else it will be ignored.
* **At line 8**, we save a shallow `metadata` Object to the GrowSurf Participant. This is optional, but is useful for viewing specific participant information in your GrowSurf dashboard ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LfiWyhm5z0L0AN3V1o_%2F-Lficu90C8YEPgrdhKyA%2FScreen%20Shot%20on%202019-05-25%20at%2018%3A56%3A33.png?alt=media\&token=1d3a352f-652e-4d13-83bd-aab4aa7ae369)).

{% hint style="info" %}
**Remember to set up reward fulfillment automation**

Make sure you have [Webhooks](/developer-tools/webhooks) or [Zapier](/integrations/zapier) set up so that rewards automatically get fulfilled to the participant once they reach a reward goal.
{% endhint %}

## Example 3: Get a participant's details

Let's say you want to display a participant's referral progress/stats/rewards in your website or mobile app. With the REST API, you can fetch [`Participant`](/developer-tools/rest-api/api-objects#participant)s and [`ParticipantReward`](/developer-tools/rest-api/api-objects#reward)s by using either of the following API methods:

* [**`GET`** `Get participant by email`](/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail)
* [**`GET`** `Get participant by ID`](/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail)

### [Step 1: Make sure you have authentication set up](/developer-tools/rest-api#getting-started)

### Step 2: Retrieve a participant by email

Let's say your server calls your database to retrieve user details and in that same call you want to send their participant information by using their unique email.

The example below is what that code could look like.

**Code Example**

```javascript
const request = require("request");

let options = {
	method: 'GET',
	headers: {
  		Authorization: 'Bearer <YOUR_API_KEY>'
  	}
};

const getUserDetails = userEmail => {
	// ...Call your database to get user details...
	// ...code here...

	// Get the GrowSurf participant's details
	request(options, (error, response, body) => {
		options.url = `https://api.growsurf.com/v2/campaign/4pdlhb/participant/${userEmail}`;
	 	if (error) {
			throw new Error(error);
		}
		console.log(body);
	});
};
```

**At line 10**, we passed `userEmail` so we could set it in the GrowSurf API URL at line 16.

**At line 20**, `console.log` would print something like this:

```javascript
{
    "id": "f8g9nl",
    "firstName": "Gavin",
    "lastName": "Belson",
    "referralCount": 2,
    "shareUrl": "https://piedpiper.com?grsf=f8g9nl",
    "email": "gavin@hoolie.com",
    "createdAt": 1552404738928,
    "fraudRiskLevel": "LOW",
    "fraudReasonCode": "UNIQUE_IDENTIY",
    "isWinner": true,
    "shareCount": {
        "email": 10,
        "facebook": 1,
        "pinterest": 1,
        "twitter": 11
    },
    "impressionCount": 2,
    "referrals": [
        "i9g2bh",
        "xua4sq"
    ],
    "referralSource": "PARTICIPANT",
    "referralStatus": "CREDIT_AWARDED",
    "referrer": {
        "id": "h8kp6l",
        "firstName": "Richard",
        "lastName": "Hendricks",
        "referralCount": 5,
        "shareUrl": "https://piedpiper.com?grsf=h8kp6l",
        "email": "richard@piedpiper.com",
        "createdAt": 1552402661449,
        "referralSource": "DIRECT",
        "fraudRiskLevel": "LOW",
        "fraudReasonCode": "UNIQUE_IDENTIY",
        "isWinner": true,
        "shareCount": {
            "email": 20,
            "facebook": 11,
            "linkedin": 0,
            "pinterest": 3,
            "twitter": 12
        },
        "impressionCount": 14,
        "referrals": [
            "0dveu7",
            "f8g9nl",
            "j0hbym",
            "m5xm9l",
            "w01fil"
        ]
    }
}
```

## Example 4: Delete a list of participants

To remove many participants at once, send them to the [**`POST`** `Bulk delete participants`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participants-bulk-delete) endpoint. One request deletes up to `200` participants, and each entry can be a participant ID or an email address. The response returns a per-row `status` for every entry, so you can see exactly which ones were removed.

{% hint style="warning" %}
Deleting a participant is permanent. It also removes that participant's referrals, rewards, commissions, and payout records.
{% endhint %}

**Code Example (Node.js)**

This example reads emails from a CSV, splits them into batches of `200`, and deletes each batch. Follow the steps below:

1. Replace `API_KEY` and `CAMPAIGN_ID` at lines 1 and 2 in the `script.js` file.
2. Replace the email addresses in the `emails.csv` file with your own list of participants to delete (keep the column header labeled `Email`).
3. Run `npm install csv-parser` to install the one dependency. The script uses the built-in `fetch`, so you need Node.js 18 or newer.
4. Run `node script.js` to run the script.

{% tabs %}
{% tab title="script.js" %}
{% code title="script.js" lineNumbers="true" %}

```javascript
const API_KEY = "ABC123FS9GM2FBJFZ68T7JNAMRCZ" // Replace with your own API key
const CAMPAIGN_ID = "2x3b5c";                  // Replace with your campaign ID

const csv = require("csv-parser");
const fs = require("fs");

const BATCH_SIZE = 200; // Max entries the bulk-delete endpoint accepts per request

// Reads emails.csv and returns the list of email addresses.
async function readEmails() {
  const emails = [];
  const reader = fs.createReadStream("emails.csv").pipe(csv());
  for await (const row of reader) {
    if (row["Email"]) {
      emails.push(row["Email"].trim());
    }
  }
  return emails;
}

// Deletes one batch of up to 200 participants and returns the API's report.
async function deleteBatch(participants) {
  const url = `https://api.growsurf.com/v2/campaign/${CAMPAIGN_ID}/participants/bulk-delete`;
  const response = await fetch(url, {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ participants })
  });
  const body = await response.json();
  if (!response.ok) {
    throw new Error(`Request failed (${response.status}): ${body.message || "unknown error"}`);
  }
  return body;
}

async function main() {
  const emails = await readEmails();
  console.log(`Deleting ${emails.length} participant(s) in batches of ${BATCH_SIZE}...`);

  for (let i = 0; i < emails.length; i += BATCH_SIZE) {
    const batch = emails.slice(i, i + BATCH_SIZE);
    const { summary, results } = await deleteBatch(batch);

    for (const row of results) {
      if (row.status === "DELETED") {
        console.log(`✅ ${row.identifier} deleted`);
      } else {
        console.log(`⚠️  ${row.identifier} (${row.status}): ${row.message}`);
      }
    }
    console.log(
      `Batch done: ${summary.deletedCount} deleted, ${summary.notFoundCount} not found, ` +
      `${summary.duplicateCount} duplicate, ${summary.errorCount} error`
    );
  }
}

main();
```

{% endcode %}
{% endtab %}

{% tab title="emails.csv" %}
{% code title="emails.csv" lineNumbers="true" %}

```csv
Email
person1@company.com
person2@company.com
person3@company.com
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Some other notes:**

* Each request replaces up to `200` individual delete calls, so you are far less likely to hit the [rate limit](https://docs.growsurf.com/developer-tools/rest-api/api-guidelines#rate-limits). For very large lists, add a short pause between batches.
* A `200` response does not mean every row was deleted. Check each row's `status`: `DELETED`, `NOT_FOUND` (no participant matched the ID or email), `DUPLICATE` (the entry resolves to the same participant as an earlier one in the batch), or `ERROR` (the lookup or deletion failed). The `summary` object totals each outcome.
* A single request can mix participant IDs and email addresses.


# Objects

## Team

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"components":{"schemas":{"Team":{"type":"object","description":"The team bound to the API key or OAuth connection.","required":["name","verificationStatus","verificationRequestedAt"],"properties":{"name":{"description":"The team's display name.","type":"string"},"verificationStatus":{"type":"string","enum":["NOT_REQUESTED","REQUESTED","VERIFIED"],"readOnly":true,"description":"GrowSurf team verification state. `VERIFIED` is required before a program can send participant emails."},"verificationRequestedAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"description":"When team verification was last requested, as a Unix timestamp in milliseconds."}}}}}}
```

***

## Campaign

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"components":{"schemas":{"Campaign":{"type":"object","description":"Detailed information about a GrowSurf program.","required":["id","name","type","referralCount","participantCount","impressionCount","inviteCount","winnerCount","status","rewards"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the program."},"name":{"type":"string","description":"The program name (internal only, never exposed to participants)."},"type":{"$ref":"#/components/schemas/CampaignType","description":"The program type."},"referralCount":{"type":"integer","readOnly":true,"description":"The total referral count."},"participantCount":{"type":"integer","readOnly":true,"description":"The total participant count."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions — the collective number of times participants' unique referral links have been viewed."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites sent by participants."},"winnerCount":{"type":"integer","readOnly":true,"description":"The total number of winners — all participants with at least one approved reward (includes referrers and referred friends)."},"currencyISO":{"type":["string","null"],"minLength":3,"maxLength":3,"description":"The program currency as an [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) code (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CampaignStatus","description":"The program status."},"rewards":{"type":"array","items":{"$ref":"#/components/schemas/Reward"},"description":"The list of rewards associated with the program."}}},"CampaignType":{"type":"string","enum":["REFERRAL","AFFILIATE"]},"CampaignStatus":{"type":"string","enum":["DRAFT","IN_PROGRESS","COMPLETE","DELETED"]},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}}}}}
```

***

## Reward

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"components":{"schemas":{"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}}}}}
```

***

## Webhook

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"components":{"schemas":{"Webhook":{"type":"object","description":"A program webhook's configuration (payload URL, subscribed events, enabled state) plus read-only delivery-health fields.","required":["id","events","isEnabled","autoDisabledDueToFailures","failureCount"],"properties":{"id":{"type":"string","readOnly":true,"description":"The webhook id (`primary` for the program's primary webhook)."},"payloadUrl":{"type":"string","nullable":true,"description":"The URL that receives webhook deliveries."},"events":{"description":"Webhook events this endpoint is subscribed to.","type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"isEnabled":{"description":"Whether deliveries to this webhook are enabled.","type":"boolean"},"autoDisabledDueToFailures":{"type":"boolean","readOnly":true,"description":"Read-only. Whether GrowSurf auto-disabled this webhook after repeated delivery failures."},"failureCount":{"type":"integer","readOnly":true,"description":"Read-only. Consecutive delivery failures."},"lastFailureAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"description":"Read-only. When the last delivery failure occurred, as a Unix timestamp in milliseconds."}}},"WebhookEvent":{"type":"string","description":"A webhook event name (the events GrowSurf delivers to subscribed webhooks).","enum":["PARTICIPANT_REACHED_A_GOAL","NEW_PARTICIPANT_ADDED","CAMPAIGN_ENDED","PARTICIPANT_FRAUD_STATUS_UPDATED","NEW_COMMISSION_ADDED","COMMISSION_ADJUSTED","NEW_PAYOUT_ISSUED"]}}}}
```

***

## Participant

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"components":{"schemas":{"Participant":{"type":"object","description":"Detailed information about a program participant.","required":["id","referralCount","monthlyReferralCount","rank","monthlyRank","shareUrl","rewards","email"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant."},"firstName":{"type":["string","null"],"description":"The first name of the participant."},"lastName":{"type":["string","null"],"description":"The last name of the participant."},"email":{"type":"string","description":"The email of the participant."},"paypalEmailAddress":{"type":"string","format":"email","description":"The PayPal email address on file for the participant, used for affiliate or PayPal reward payouts."},"referralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made by the participant."},"monthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made this month by the participant (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made the previous month by the participant."},"rank":{"type":"integer","readOnly":true,"description":"The rank of the participant."},"monthlyRank":{"type":"integer","readOnly":true,"description":"The monthly rank of the participant. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","readOnly":true,"description":"The previous monthly rank of the participant. Not returned if the participant did not exist in your program during the previous month."},"shareUrl":{"type":"string","readOnly":true,"description":"The unique share URL of the participant."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"The date the participant was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","readOnly":true,"description":"The source of how the participant joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the participant was referred, the referrer's status in receiving the referral credit. Only applicable if the participant was referred into the program."},"referredBy":{"type":"string","description":"The ID of the referrer. Only applicable if the participant was referred into the program."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","readOnly":true,"description":"A value that represents the integrity of the participant."},"fraudReasonCode":{"type":"string","readOnly":true,"description":"The reason for the participant's `fraudRiskLevel`:\n\n- `UNIQUE_IDENTITY` — They have a unique identity (no other participant has the same identity).\n- `DUPLICATE_EMAIL` — Their email is not unique and is identical to another participant's email (e.g., gavin@hooli.com = gavin+1@hooli.com).\n- `DUPLICATE_IDENTITY` — Their identity (fingerprint or mobile instance ID) is not unique and matches another participant's.\n- `DUPLICATE_IDENTITY_EXCESSIVE` — Within a small window of time, they had an excessive number of referred participants who also shared the same IP address.\n- `EMAIL_FRAUD` — Their email was found to match another participant's when updated in a connected billing or payment integration.\n- `SIMILAR_EMAIL` — Their browser fingerprint matches another participant's and their email looks suspiciously similar.\n- `SIMILAR_FIRST_NAME` — Their browser fingerprint matches another participant's and their first name looks suspiciously similar.\n- `SIMILAR_LAST_NAME` — Their browser fingerprint matches another participant's and their last name looks suspiciously similar.\n- `REFERRAL_EMAIL_PATTERN` — (Status for a referred person) Their email matched a similar pattern to their referrer's email.\n- `REFERRAL_CHAIN_FRAUD` — (Status for a referrer or referred person) Their characteristics matched a pattern with other referrals the referrer made, indicating a fraud ring.\n- `REFERRAL_VELOCITY_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals in a short period of time.\n- `DOMAIN_CLUSTERING_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals sharing the same suspicious domain in a short period of time.\n- `MANUAL_UPDATE` — They were manually marked as a fraudster from the GrowSurf dashboard.\n- `WHITELISTED` — They were allowed to join the program because one of their properties matched an allowed value.\n- `BLACKLIST_MATCH` — They were not allowed to join the program because one of their properties matched a blocked value.\n- `BLOCKED_IP` — They were not allowed to join the program because their IP address was recently blocked by antifraud IP throttling.\n- `REFERRER_HIGH_RISK` — They were not allowed to join the program because their referrer was a high-risk fraudster."},"isWinner":{"type":"boolean","readOnly":true,"description":"`true` if the participant has earned one or more rewards."},"shareCount":{"type":"object","readOnly":true,"additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the participant has shared their referral link, keyed by channel. Standard web channels include `email`, `facebook`, and `twitter`; SDK/native-share channels include `iosNativeShare` and `androidNativeShare`."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions the participant has made."},"uniqueImpressionCount":{"type":"integer","readOnly":true,"description":"The total number of unique impressions the participant has made."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites the participant has sent."},"referrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the participant. Limited to the 100 most recently referred friends."},"monthlyReferrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the participant this month (resets at the end of the month). Limited to the 100 most recent."},"referrer":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/ParticipantReferrer"},{"type":"null"}],"description":"An object containing the participant's referrer information. Only applicable if the participant was referred into the program."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the participant, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the participant, used for anti-fraud matching."},"mobileInstanceId":{"type":["string","null"],"description":"App-install scoped mobile identifier used for anti-fraud matching when provided by native mobile apps. The official mobile SDKs generate this as a lowercase UUID. Not stored when strict GDPR/CCPA mode is enabled."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data, useful for saving additional data for the participant (e.g., `company`, `companySize`). Metadata is never used by GrowSurf and usage is optional. Metadata is returned only in REST API calls, and never in JavaScript Web API calls. See [API Guidelines](https://docs.growsurf.com/developer-tools/rest-api/api-guidelines)."},"notes":{"type":["string","null"],"description":"Internal notes about the participant, added via the [GrowSurf Dashboard](https://growsurf.com/dashboard)."},"unsubscribed":{"type":"boolean","description":"`true` if the participant has unsubscribed from program emails."},"rewards":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/ParticipantReward"},"description":"A list of the rewards the participant has earned."},"vanityKeys":{"type":"array","items":{"type":"string"},"description":"The list of vanity keys that the participant has."},"unreadCommissionsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of commissions the participant has not yet viewed."},"unreadPayoutsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of payouts the participant has not yet viewed."},"isNew":{"type":"boolean","readOnly":true,"description":"Whether this participant was newly created by the request. Returned by participant creation calls; `false` when the participant already existed."},"allMatchingFraudsters":{"type":"array","readOnly":true,"items":{"type":"object","additionalProperties":true},"description":"A list of other participants flagged as matching this participant during anti-fraud checks."},"payoutSettings":{"type":"object","readOnly":true,"description":"Payout-related actions the participant must complete before a payout can be released (e.g. confirming a PayPal email or submitting a W-9/W-8 tax form). Always present; the requiredActions array is empty when no action is required.","properties":{"requiredActions":{"description":"Actions the participant must complete before payouts can be sent.","type":"array","readOnly":true,"items":{"type":"string","enum":["PAYPAL_EMAIL","TAX_INFO"]}}}}}},"ReferralSource":{"type":"string","enum":["DIRECT","PARTICIPANT"]},"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"FraudRiskLevel":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"ParticipantReferrer":{"type":"object","description":"Summary information about a participant's referrer, returned within the `referrer` field of a `Participant`.","properties":{"id":{"type":"string","description":"The unique identifier of the referrer."},"firstName":{"type":["string","null"],"description":"The first name of the referrer."},"lastName":{"type":["string","null"],"description":"The last name of the referrer."},"email":{"type":"string","description":"The email of the referrer."},"referralCount":{"type":"integer","description":"The total number of referrals made by the referrer."},"monthlyReferralCount":{"type":"integer","description":"The total number of referrals made this month by the referrer (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","description":"The total number of referrals made the previous month by the referrer."},"rank":{"type":"integer","description":"The rank of the referrer."},"monthlyRank":{"type":"integer","description":"The monthly rank of the referrer. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","description":"The previous monthly rank of the referrer."},"shareUrl":{"type":"string","description":"The unique share URL of the referrer."},"createdAt":{"type":"integer","format":"int64","description":"The date the referrer was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","description":"The source of how the referrer joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the referrer was themselves referred, their referrer's status in receiving the referral credit."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","description":"A value that represents the integrity of the referrer."},"fraudReasonCode":{"type":"string","description":"The reason for the referrer's `fraudRiskLevel`. See `Participant.fraudReasonCode` for the list of possible values."},"isWinner":{"type":"boolean","description":"`true` if the referrer has earned one or more rewards."},"shareCount":{"type":"object","additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the referrer has shared their referral link, keyed by channel."},"impressionCount":{"type":"integer","description":"The total number of impressions the referrer has made."},"uniqueImpressionCount":{"type":"integer","description":"The total number of unique impressions the referrer has made."},"inviteCount":{"type":"integer","description":"The total number of invites the referrer has sent."},"referrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the referrer. Limited to the 100 most recent."},"monthlyReferrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the referrer this month (resets at the end of the month). Limited to the 100 most recent."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the referrer, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the referrer, used for anti-fraud matching."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data for the referrer."},"unsubscribed":{"type":"boolean","description":"`true` if the referrer has unsubscribed from program emails."}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"ParticipantReward":{"type":"object","description":"A reward that a participant has earned. This is different from a program `Reward` Object and contains information pertinent only to the participant that earned the reward.","required":["id","rewardId","status"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant's reward. This is different for every new reward the participant earns."},"rewardId":{"type":"string","readOnly":true,"description":"The ID of the program `Reward` (`CampaignReward`) that this participant has earned."},"status":{"$ref":"#/components/schemas/RewardStatus","readOnly":true,"description":"The status of the participant's reward."},"unread":{"type":"boolean","readOnly":true,"description":"`true` if the participant has not yet seen the reward in a GrowSurf window."},"approved":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been approved."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was approved for this participant (UTC milliseconds). `null` for unapproved rewards."},"fulfilledAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was fulfilled for this participant (UTC milliseconds). `null` for unapproved or unfulfilled rewards."},"isReferrer":{"type":"boolean","readOnly":true,"description":"`true` if the participant earned the reward as the referrer; `false` if they earned it as the referred friend (only applicable for double-sided reward types)."},"isAvailable":{"type":"boolean","readOnly":true,"description":"`true` if the reward is available for the participant to claim or redeem."},"isFulfilled":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been fulfilled."},"referredId":{"type":"string","readOnly":true,"description":"The ID of the friend that was referred."},"referrerId":{"type":"string","readOnly":true,"description":"The ID of the participant that made the referral."},"commissionStructure":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The commission structure associated with this reward. Present only for affiliate programs."}}},"RewardStatus":{"type":"string","enum":["PENDING","FULFILLED"]},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false}}}}
```

***

## ParticipantCommission

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"components":{"schemas":{"ParticipantCommission":{"type":"object","description":"**Affiliate programs only.** A commission generated for a (referrer) participant in an affiliate program.","required":["id","referrerId","referredId","amount","saleAmount","currencyISO","status","createdAt"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant commission."},"referrerId":{"type":"string","readOnly":true,"description":"The participant ID of the referrer who earned the commission."},"referredId":{"type":"string","readOnly":true,"description":"The participant ID of the referred friend (the conversion that triggered the commission)."},"amount":{"type":["integer","null"],"readOnly":true,"description":"Commission amount (what the affiliate earned) in the currency's smallest denomination (e.g., `100` cents equals $1.00 USD, and `100` equals ¥100 for a zero-decimal currency). Always non-negative when present; `null` if it could not be computed."},"saleAmount":{"type":["integer","null"],"readOnly":true,"description":"The sale amount from the transaction the referral paid, in the currency's smallest denomination. Always non-negative when present; `null` for commissions whose provider does not report a sale amount."},"currencyISO":{"type":"string","readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the commission (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CommissionStatus","readOnly":true,"description":"Current lifecycle state of the commission."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was approved. `null` until the commission transitions to `APPROVED`."},"paidAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was sent in a payout. `null` until the commission transitions to `PAID`."},"reversedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was reversed (for example, due to a refund or chargeback). `null` unless the commission transitions to `REVERSED`."},"holdDuration":{"type":["integer","null"],"readOnly":true,"description":"Number of days the commission must age before it can be processed for payout. Defaults to `0` (no hold)."},"payoutQueuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was queued for payout. `null` if it has not been scheduled."},"provider":{"type":["string","null"],"readOnly":true,"description":"Origin of the commission event. For example, `stripe` or `api`."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission record was created."},"amountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"Commission amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the commission is still pending FX conversion."},"saleAmountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"The sale amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the commission is still pending FX conversion."},"exchangeRate":{"type":["number","null"],"readOnly":true,"description":"The currency exchange rate used for conversion. `null` if the commission is still pending FX conversion."},"campaignCurrencyISO":{"type":["string","null"],"readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the program used in currency conversion (e.g., `USD`, `GBP`). `null` if the commission is still pending FX conversion."},"exchangeRateAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the currency exchange rate was received. `null` if the commission is still pending FX conversion."},"fxError":{"type":["string","null"],"readOnly":true,"description":"If there was an error with FX conversion, the specific details. `null` if conversion was successful."}}},"CommissionStatus":{"type":"string","enum":["PENDING","APPROVED","PAID","REVERSED","DELETED"]}}}}
```

{% hint style="success" %}
**Currency Exchange Note:**

If the referral makes a payment in a currency different from your program's currency (`Campaign.currencyISO`), the following foreign currency exchange-related fields can be used to normalize commission data for accounting/reporting purposes: `amountInCampaignCurrency`, `saleAmountInCampaignCurrency`, `exchangeRate`, `campaignCurrencyISO`, and `exchangeRateAt`.\
\
For example, if your campaign's currency is set to `USD` but a referral makes a payment in `CAD`, the generated commission will have `amountInCampaignCurrency` as the `USD` equivalent of the `CAD` payment.
{% endhint %}

***

## ParticipantPayout

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"components":{"schemas":{"ParticipantPayout":{"type":"object","description":"**Affiliate programs only.** A payout generated for a participant in an affiliate program. All payouts start with a status of `UPCOMING`, which represents an aggregation of the participant's `ParticipantCommission` amounts, and is adjusted in real time as commissions change.","required":["id","participantId","commissionIds","amount","currencyISO","status","createdAt"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant payout."},"participantId":{"type":"string","readOnly":true,"description":"The participant ID of the referrer who earned the payout."},"commissionIds":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"The IDs of the associated `ParticipantCommission`s."},"amount":{"type":"integer","readOnly":true,"description":"Payout amount in the currency's smallest denomination (e.g., `100` cents equals $1.00 USD, and `100` equals ¥100 for a zero-decimal currency). Always non-negative."},"currencyISO":{"type":"string","readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the payout (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/PayoutStatus","readOnly":true,"description":"Current lifecycle state of the payout."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout record was created."},"queuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout was queued for processing (status `QUEUED`). `null` until the payout is queued."},"issuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout was issued. `null` if the payout was not successfully issued."},"failedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout failed to be issued. `null` if the payout did not fail to be issued."},"provider":{"type":["string","null"],"readOnly":true,"description":"The payment provider used to issue the payout (e.g., `paypal`). `null` for payouts with a status of `UPCOMING`."},"amountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"Payout amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"campaignCurrencyISO":{"type":["string","null"],"readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the program used in currency conversion (e.g., `USD`, `GBP`). `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"exchangeRateAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the currency exchange rate was received. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"exchangeRate":{"type":["number","null"],"readOnly":true,"description":"The currency exchange rate used for conversion. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"fxError":{"type":["string","null"],"readOnly":true,"description":"If there was an error with FX conversion, the specific details. `null` if the payout status is `UPCOMING` or if the FX conversion was successful."}}},"PayoutStatus":{"type":"string","enum":["UPCOMING","QUEUED","ISSUED","FAILED"]}}}}
```


# API Reference

This reference documents the GrowSurf REST API, including all available public methods and examples of each.

{% hint style="info" %}

* **Using AI?** If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
* **Using TypeScript, Python, PHP, Ruby, or Java?** Use an official GrowSurf API library. [Learn more](https://docs.growsurf.com/developer-tools/rest-api/api-libraries).
* **Building a native iOS or Android app?** Use the [iOS SDK](/developer-tools/ios-sdk) or [Android SDK](/developer-tools/android-sdk) for mobile attribution, participant creation, sharing, and referral portal data. Use this REST API from your backend for secure server-side actions.
  {% endhint %}

{% hint style="warning" %}
Do not embed your REST API key in native mobile apps. The iOS and Android SDKs use a separate Mobile SDK API and public Mobile SDK key. This REST API remains the right place for backend-only operations, including server-verified purchase or subscription referral qualification.
{% endhint %}

## INDEX ↓

| Section                                                                                                         | Endpoints                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Accounts](https://docs.growsurf.com/developer-tools/rest-api/api-reference#accounts)                           | [Create account](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-accounts)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Teams](https://docs.growsurf.com/developer-tools/rest-api/api-reference#teams)                                 | [Retrieve team](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-team) · [Update team](https://docs.growsurf.com/developer-tools/rest-api/api-reference#patch-team) · [Request team verification](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-team-verification-request) · [Resend team owner verification email](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-team-owner-verification-email) · [Rotate API key](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-api-key-rotate)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Campaigns](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaigns)                         | [List campaigns](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaigns) · [Retrieve a campaign](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id) · [Create a campaign](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaigns) · [Update a campaign](https://docs.growsurf.com/developer-tools/rest-api/api-reference#patch-campaign-id) · [Clone a campaign](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-clone)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Campaign Rewards](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-rewards)           | [List campaign rewards](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-reward-configs) · [Create a campaign reward](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-reward-configs) · [Update a campaign reward](https://docs.growsurf.com/developer-tools/rest-api/api-reference#patch-campaign-id-reward-configs-campaignrewardid) · [Delete a campaign reward](https://docs.growsurf.com/developer-tools/rest-api/api-reference#delete-campaign-id-reward-configs-campaignrewardid)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Campaign Design](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-design)             | [Retrieve campaign design](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-design) · [Update campaign design](https://docs.growsurf.com/developer-tools/rest-api/api-reference#patch-campaign-id-design)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Campaign Emails](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-emails)             | [Retrieve campaign emails](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-emails) · [Update campaign emails](https://docs.growsurf.com/developer-tools/rest-api/api-reference#patch-campaign-id-emails)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Campaign Options](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-options)           | [Retrieve campaign options](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-options) · [Update campaign options](https://docs.growsurf.com/developer-tools/rest-api/api-reference#patch-campaign-id-options)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Campaign Installation](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-installation) | [Retrieve campaign installation](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-installation) · [Update campaign installation](https://docs.growsurf.com/developer-tools/rest-api/api-reference#patch-campaign-id-installation)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Campaign Webhooks](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-webhooks)         | [List webhooks](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-webhooks) · [Create webhook](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-webhooks) · [Update webhook](https://docs.growsurf.com/developer-tools/rest-api/api-reference#patch-campaign-id-webhooks-webhookid) · [Delete webhook](https://docs.growsurf.com/developer-tools/rest-api/api-reference#delete-campaign-id-webhooks-webhookid) · [Test webhook](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-webhooks-webhookid-test)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Participants](https://docs.growsurf.com/developer-tools/rest-api/api-reference#participants)                   | [List participants](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participants) · [List leaderboard participants](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-leaderboard) · [Add participant](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant) · [Retrieve participant](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail) · [Update participant](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail) · [Delete participant](https://docs.growsurf.com/developer-tools/rest-api/api-reference#delete-campaign-id-participant-participantidoremail) · [Bulk delete participants](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participants-bulk-delete) · [Trigger referral](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail-ref) · [Cancel delayed referral trigger](https://docs.growsurf.com/developer-tools/rest-api/api-reference#delete-campaign-id-participant-participantidoremail-ref) · [Create mobile participant token](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-mobile-participant-token) · [Email participant](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail-email) · [Retrieve participant analytics](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail-analytics) · [List participant activity logs](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail-activity-logs) |
| [Participant Rewards](https://docs.growsurf.com/developer-tools/rest-api/api-reference#participant-rewards)     | [List participant rewards](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail-rewards) · [Approve participant reward](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-reward-rewardid-approve) · [Fulfill participant reward](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-reward-rewardid-fulfill) · [Delete participant reward](https://docs.growsurf.com/developer-tools/rest-api/api-reference#delete-campaign-id-reward-rewardid)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Referrals and Invites](https://docs.growsurf.com/developer-tools/rest-api/api-reference#referrals-and-invites) | [List referrals and invites](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-referrals) · [List participant referrals and invites](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail-referrals) · [Send participant invites](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail-invites)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Analytics](https://docs.growsurf.com/developer-tools/rest-api/api-reference#analytics)                         | [Retrieve campaign analytics](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-analytics)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Affiliate Programs](https://docs.growsurf.com/developer-tools/rest-api/api-reference#affiliate-programs)       | [Record affiliate transaction](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail-transaction) · [Refund or amend affiliate transaction](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail-transaction-refund) · [List participant commissions](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-commissions) · [List commissions for a participant](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail-commissions) · [Approve participant commission](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-commission-commissionid-approve) · [Delete participant commission](https://docs.growsurf.com/developer-tools/rest-api/api-reference#delete-campaign-id-commission-commissionid) · [List participant payouts](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-payouts) · [List payouts for a participant](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail-payouts)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

***

## ACCOUNTS ↓

{% hint style="info" %}
Create a GrowSurf account and receive its first API key.
{% endhint %}

## Create account

> Creates a new GrowSurf account. This is the only endpoint that does not require an API key. The response includes an API key for the new account, shown once in the response. The key is locked until the team owner's email address is verified: authenticated program and resource endpoints return a \`403\` with error code \`EMAIL\_NOT\_VERIFIED\_ERROR\` until then (resend the email via \`POST /team/owner/verification-email\`, then retry). A welcome email is sent to the address with the verification link and a set-password link for dashboard access. Accounts whose email is never verified are deleted automatically after 7 days. For security, the API key is rotated the first time the account owner signs in to the GrowSurf dashboard. Some actions (such as emailing participants) additionally require GrowSurf to verify the team first. By creating an account you agree, on behalf of the account holder, to GrowSurf's \[Terms of Service]\(<https://growsurf.com/terms>) and \[Privacy Policy]\(<https://growsurf.com/privacy>).

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Accounts","description":"Create a GrowSurf account and its initial API key."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[],"paths":{"/accounts":{"post":{"tags":["Accounts"],"operationId":"createAccount","summary":"Create account","description":"Creates a new GrowSurf account. This is the only endpoint that does not require an API key. The response includes an API key for the new account, shown once in the response. The key is locked until the team owner's email address is verified: authenticated program and resource endpoints return a `403` with error code `EMAIL_NOT_VERIFIED_ERROR` until then (resend the email via `POST /team/owner/verification-email`, then retry). A welcome email is sent to the address with the verification link and a set-password link for dashboard access. Accounts whose email is never verified are deleted automatically after 7 days. For security, the API key is rotated the first time the account owner signs in to the GrowSurf dashboard. Some actions (such as emailing participants) additionally require GrowSurf to verify the team first. By creating an account you agree, on behalf of the account holder, to GrowSurf's [Terms of Service](https://growsurf.com/terms) and [Privacy Policy](https://growsurf.com/privacy).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRequest"}}}},"responses":{"200":{"description":"Account created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"schemas":{"CreateAccountRequest":{"type":"object","required":["email"],"additionalProperties":false,"properties":{"email":{"type":"string","format":"email","description":"The email address for the new GrowSurf account. Personal emails and disposable email addresses are not accepted."},"firstName":{"description":"First name for the new account owner.","type":"string","maxLength":255},"lastName":{"description":"Last name for the new account owner.","type":"string","maxLength":255},"company":{"description":"Company name for the new account.","type":"string","maxLength":255}}},"CreateAccountResponse":{"type":"object","required":["email","apiKey","verificationStatus"],"properties":{"email":{"description":"Email address for the new account.","type":"string","format":"email"},"apiKey":{"type":"string","description":"An API key for the new account. Use it as the `Bearer` token on subsequent requests. It is shown once, locked (`403` `EMAIL_NOT_VERIFIED_ERROR`) until the account's email is verified, and rotated when the account owner first signs in to the GrowSurf dashboard."},"verificationStatus":{"type":"string","enum":["NOT_REQUESTED","REQUESTED","VERIFIED"],"description":"GrowSurf team verification state. `VERIFIED` is required before a program can send participant emails."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Conflicting duplicate request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```

***

## TEAMS ↓

{% hint style="info" %}
Read or update the team bound to your API key or OAuth connection, request GrowSurf verification, resend the team owner's verification email, or rotate the API key making a direct API request. New API keys and OAuth connections act on one team. API key rotation is not available through MCP.
{% endhint %}

## Retrieve team

> Retrieves the team bound to the API key or OAuth connection. \`verificationStatus\` is \`VERIFIED\` once GrowSurf has verified the team, which is required before a program can send participant emails.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Teams","description":"The team bound to an API key or OAuth connection."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"schemas":{"Team":{"type":"object","description":"The team bound to the API key or OAuth connection.","required":["name","verificationStatus","verificationRequestedAt"],"properties":{"name":{"description":"The team's display name.","type":"string"},"verificationStatus":{"type":"string","enum":["NOT_REQUESTED","REQUESTED","VERIFIED"],"readOnly":true,"description":"GrowSurf team verification state. `VERIFIED` is required before a program can send participant emails."},"verificationRequestedAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"description":"When team verification was last requested, as a Unix timestamp in milliseconds."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/team":{"get":{"tags":["Teams"],"operationId":"getTeam","summary":"Retrieve team","description":"Retrieves the team bound to the API key or OAuth connection. `verificationStatus` is `VERIFIED` once GrowSurf has verified the team, which is required before a program can send participant emails.","responses":{"200":{"description":"Team returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update team

> Updates the name of the team bound to the API key or OAuth connection. Any other property is rejected with a \`400\`. Personal profiles, billing, and team ownership are not editable here.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Teams","description":"The team bound to an API key or OAuth connection."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"schemas":{"UpdateTeamRequest":{"type":"object","description":"The Team fields you can update. Any property not listed here is rejected with a `400`.","additionalProperties":false,"required":["name"],"properties":{"name":{"description":"The team's display name.","type":"string","minLength":1,"maxLength":255}}},"Team":{"type":"object","description":"The team bound to the API key or OAuth connection.","required":["name","verificationStatus","verificationRequestedAt"],"properties":{"name":{"description":"The team's display name.","type":"string"},"verificationStatus":{"type":"string","enum":["NOT_REQUESTED","REQUESTED","VERIFIED"],"readOnly":true,"description":"GrowSurf team verification state. `VERIFIED` is required before a program can send participant emails."},"verificationRequestedAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"description":"When team verification was last requested, as a Unix timestamp in milliseconds."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/team":{"patch":{"tags":["Teams"],"operationId":"updateTeam","summary":"Update team","description":"Updates the name of the team bound to the API key or OAuth connection. Any other property is rejected with a `400`. Personal profiles, billing, and team ownership are not editable here.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamRequest"}}}},"responses":{"200":{"description":"Updated team returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Request team verification

> Requests GrowSurf to verify the bound team (required before a program can email its participants). Idempotent — calling it again while a request is pending does not create a duplicate. Returns the team with its updated \`verificationStatus\`.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Teams","description":"The team bound to an API key or OAuth connection."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"schemas":{"Team":{"type":"object","description":"The team bound to the API key or OAuth connection.","required":["name","verificationStatus","verificationRequestedAt"],"properties":{"name":{"description":"The team's display name.","type":"string"},"verificationStatus":{"type":"string","enum":["NOT_REQUESTED","REQUESTED","VERIFIED"],"readOnly":true,"description":"GrowSurf team verification state. `VERIFIED` is required before a program can send participant emails."},"verificationRequestedAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"description":"When team verification was last requested, as a Unix timestamp in milliseconds."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/team/verification-request":{"post":{"tags":["Teams"],"operationId":"requestTeamVerification","summary":"Request team verification","description":"Requests GrowSurf to verify the bound team (required before a program can email its participants). Idempotent — calling it again while a request is pending does not create a duplicate. Returns the team with its updated `verificationStatus`.","responses":{"200":{"description":"Verification request recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Resend team owner verification email

> Resends the email-verification message to the bound team's owner. The response never reveals the owner's email address. A \`200\` with \`status: SENT\` is returned only when an email was actually dispatched. Returns \`400\` if the email is already verified, and \`429\` if a verification email was sent too recently — wait a moment, then retry.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Teams","description":"The team bound to an API key or OAuth connection."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"schemas":{"VerificationEmailResponse":{"type":"object","required":["success","status"],"properties":{"success":{"description":"Whether the verification email request was accepted.","type":"boolean"},"status":{"description":"Status of the verification email request.","type":"string","enum":["SENT"]}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/team/owner/verification-email":{"post":{"tags":["Teams"],"operationId":"resendTeamOwnerVerificationEmail","summary":"Resend team owner verification email","description":"Resends the email-verification message to the bound team's owner. The response never reveals the owner's email address. A `200` with `status: SENT` is returned only when an email was actually dispatched. Returns `400` if the email is already verified, and `429` if a verification email was sent too recently — wait a moment, then retry.","responses":{"200":{"description":"Verification email sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationEmailResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Rotate API key

> Generates a new API key and makes the key used on this request stop working when rotation succeeds. Send a unique, random \`Idempotency-Key\`. If the response is interrupted, immediately retry with the original API key and the same \`Idempotency-Key\` to receive the same new key. Update every integration that used the old key. The team owner is notified by email whenever the key is rotated. GrowSurf SDKs generate the idempotency key automatically. This endpoint accepts an API key with \`api\_key:rotate\`. If this scope is unavailable, rotate the key in the authenticated dashboard instead. This operation is available only through the REST API or a GrowSurf API SDK, not through MCP.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Teams","description":"The team bound to an API key or OAuth connection."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"schemas":{"RotateApiKeyResponse":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"type":"string","description":"The new API key. Store it now; the key used for rotation stops working immediately."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api-key/rotate":{"post":{"tags":["Teams"],"operationId":"rotateApiKey","summary":"Rotate API key","description":"Generates a new API key and makes the key used on this request stop working when rotation succeeds. Send a unique, random `Idempotency-Key`. If the response is interrupted, immediately retry with the original API key and the same `Idempotency-Key` to receive the same new key. Update every integration that used the old key. The team owner is notified by email whenever the key is rotated. GrowSurf SDKs generate the idempotency key automatically. This endpoint accepts an API key with `api_key:rotate`. If this scope is unavailable, rotate the key in the authenticated dashboard instead. This operation is available only through the REST API or a GrowSurf API SDK, not through MCP.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique, random value for this rotation request. Reuse this value only when retrying the same request with the original API key.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[A-Za-z0-9._:-]+$"}}],"responses":{"200":{"description":"The new API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateApiKeyResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## CAMPAIGNS ↓

{% hint style="info" %}
Create and update a program's identity and lifecycle here (`name`, `companyName`, `companyLogoImageUrl`, `status`, and — on create — `type`, `currencyISO`, and inline `rewards`). A program's currency (`currencyISO`) is chosen when the program is created (defaults to `USD`) and can't be changed afterward — sending it to the update endpoint returns a `400`. A program's design, emails, options, and installation are **not** accepted on create or update and will return a `400`. Edit those — and the program's rewards — through the [Campaign Rewards](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-rewards), [Campaign Design](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-design), [Campaign Emails](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-emails), [Campaign Options](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-options), and [Campaign Installation](https://docs.growsurf.com/developer-tools/rest-api/api-reference#campaign-installation) API endpoints.
{% endhint %}

## List campaigns

> Retrieves a list of your programs. Deleted programs are not returned.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"schemas":{"CampaignListResponse":{"type":"object","required":["campaigns"],"properties":{"campaigns":{"description":"Programs returned for the API key's bound team.","type":"array","items":{"$ref":"#/components/schemas/Campaign"}}}},"Campaign":{"type":"object","description":"Detailed information about a GrowSurf program.","required":["id","name","type","referralCount","participantCount","impressionCount","inviteCount","winnerCount","status","rewards"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the program."},"name":{"type":"string","description":"The program name (internal only, never exposed to participants)."},"type":{"$ref":"#/components/schemas/CampaignType","description":"The program type."},"referralCount":{"type":"integer","readOnly":true,"description":"The total referral count."},"participantCount":{"type":"integer","readOnly":true,"description":"The total participant count."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions — the collective number of times participants' unique referral links have been viewed."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites sent by participants."},"winnerCount":{"type":"integer","readOnly":true,"description":"The total number of winners — all participants with at least one approved reward (includes referrers and referred friends)."},"currencyISO":{"type":["string","null"],"minLength":3,"maxLength":3,"description":"The program currency as an [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) code (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CampaignStatus","description":"The program status."},"rewards":{"type":"array","items":{"$ref":"#/components/schemas/Reward"},"description":"The list of rewards associated with the program."}}},"CampaignType":{"type":"string","enum":["REFERRAL","AFFILIATE"]},"CampaignStatus":{"type":"string","enum":["DRAFT","IN_PROGRESS","COMPLETE","DELETED"]},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaigns":{"get":{"tags":["Campaigns"],"operationId":"listCampaigns","summary":"List campaigns","description":"Retrieves a list of your programs. Deleted programs are not returned.","responses":{"200":{"description":"Campaigns returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignListResponse"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Retrieve a campaign

> Retrieves a program for the given program ID.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"Campaign":{"type":"object","description":"Detailed information about a GrowSurf program.","required":["id","name","type","referralCount","participantCount","impressionCount","inviteCount","winnerCount","status","rewards"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the program."},"name":{"type":"string","description":"The program name (internal only, never exposed to participants)."},"type":{"$ref":"#/components/schemas/CampaignType","description":"The program type."},"referralCount":{"type":"integer","readOnly":true,"description":"The total referral count."},"participantCount":{"type":"integer","readOnly":true,"description":"The total participant count."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions — the collective number of times participants' unique referral links have been viewed."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites sent by participants."},"winnerCount":{"type":"integer","readOnly":true,"description":"The total number of winners — all participants with at least one approved reward (includes referrers and referred friends)."},"currencyISO":{"type":["string","null"],"minLength":3,"maxLength":3,"description":"The program currency as an [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) code (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CampaignStatus","description":"The program status."},"rewards":{"type":"array","items":{"$ref":"#/components/schemas/Reward"},"description":"The list of rewards associated with the program."}}},"CampaignType":{"type":"string","enum":["REFERRAL","AFFILIATE"]},"CampaignStatus":{"type":"string","enum":["DRAFT","IN_PROGRESS","COMPLETE","DELETED"]},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}":{"get":{"tags":["Campaigns"],"operationId":"retrieveCampaign","summary":"Retrieve a campaign","description":"Retrieves a program for the given program ID.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Campaign returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Create a campaign

> Creates a new program, plus any optional program rewards. The new program is created in \`DRAFT\` status and owned by the API key's bound team.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"schemas":{"CampaignCreateRequest":{"type":"object","description":"Request body for creating a program. Only `type` is required; everything else is server-defaulted. Editor-tab configuration (design, emails, options, installation) is NOT accepted here — configure it via the config sub-resources (e.g. `PATCH /campaign/{id}/options`) after the program is created.","required":["type"],"properties":{"type":{"type":"string","enum":["REFERRAL","AFFILIATE"],"description":"The program type. Immutable after creation."},"name":{"type":"string","description":"The program name (internal only, never exposed to participants). Defaults to a generated name (a friendly label plus the creation date) that you can rename at any time."},"companyName":{"type":"string","description":"The company name shown to participants across the program's emails and referral portal. When omitted, it defaults to the `company` name set when the account was created (see `POST /accounts`), with common legal suffixes removed."},"companyLogoImageUrl":{"type":"string","description":"URL of the company logo shown to participants. When omitted, it is auto-populated from your company's domain (and the program theme is seeded with your brand colors). Pass a value to override the logo; the returned campaign reflects a GrowSurf-hosted URL that may differ from the one you supplied."},"currencyISO":{"type":"string","default":"USD","description":"ISO 4217 currency code. Defaults to `USD`. Chosen when the program is created and immutable afterward — it cannot be changed on update."},"rewards":{"type":"array","items":{"$ref":"#/components/schemas/RewardCreateRequest"},"description":"Optional inline rewards to create with the program."}}},"RewardCreateRequest":{"type":"object","description":"Request body for creating a campaign reward. `type` is required and must be compatible with the program type. AFFILIATE rewards additionally require `commissionStructure` (with `amount` for a `FIXED` commission or `percent` for a `PERCENT` commission).","required":["type"],"allOf":[{"$ref":"#/components/schemas/RewardWritableFields"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type. Immutable after creation."}}}]},"RewardWritableFields":{"type":"object","description":"The writable fields shared by the create and update campaign reward requests.","properties":{"title":{"type":"string","description":"The reward title (internal only, never exposed to participants)."},"description":{"type":"string","description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (double-sided rewards only)."},"imageUrl":{"type":["string","null"],"description":"An image URL for the reward."},"isVisible":{"type":"boolean","default":true,"description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"isUnlimited":{"type":"boolean","default":true,"description":"Whether the reward can be earned an unlimited number of times. Defaults to `true`, except `MILESTONE` rewards, which can only be earned once."},"referredRewardUpfront":{"type":"boolean","default":false,"description":"For double-sided rewards, deliver the referred friend's reward upfront as a discount."},"limit":{"type":"integer","minimum":0,"default":1,"description":"The number of times a participant can earn the reward (overridden by `isUnlimited`)."},"conversionsRequired":{"type":"integer","minimum":1,"default":1,"description":"The number of referrals required to earn the reward."},"numberOfWinners":{"type":"integer","minimum":0,"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total. A `LEADERBOARD` reward that omits it defaults to `3`."},"order":{"type":"integer","description":"The display order of the reward."},"limitDuration":{"type":"string","enum":["IN_TOTAL","PER_MONTH","PER_YEAR"],"default":"IN_TOTAL","description":"The window over which `limit` applies."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text shown before a participant's referral count in milestone progress copy (e.g. `You are only`). Applies to `MILESTONE` rewards."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text shown after a participant's referral count in milestone progress copy (e.g. `referrals away from your next reward!`). Applies to `MILESTONE` rewards."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook when this reward is earned. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same behavior and caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"Custom key/value metadata (single-level; keys are camelCased on save; values are stored as strings). Sending `metadata` REPLACES the stored object. Campaign copy can reference a key via `{{campaignReward['<rewardId>']['<key>']}}` tokens: renaming a key (same value, new key) automatically rewrites those references; removing a key that campaign copy still references returns a `409` listing the referencing fields."},"commissionStructure":{"$ref":"#/components/schemas/CommissionStructure","description":"The affiliate commission structure (AFFILIATE rewards only). REQUIRED when creating an AFFILIATE reward — include `amount` (and optionally `amountISO`) for a `FIXED` commission, or `percent` for a `PERCENT` commission."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). Used by tax documentation / 1099 reporting. `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. Defaults to not tax-reportable (a purchase rebate). `null` when no valuation is set."}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Campaign":{"type":"object","description":"Detailed information about a GrowSurf program.","required":["id","name","type","referralCount","participantCount","impressionCount","inviteCount","winnerCount","status","rewards"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the program."},"name":{"type":"string","description":"The program name (internal only, never exposed to participants)."},"type":{"$ref":"#/components/schemas/CampaignType","description":"The program type."},"referralCount":{"type":"integer","readOnly":true,"description":"The total referral count."},"participantCount":{"type":"integer","readOnly":true,"description":"The total participant count."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions — the collective number of times participants' unique referral links have been viewed."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites sent by participants."},"winnerCount":{"type":"integer","readOnly":true,"description":"The total number of winners — all participants with at least one approved reward (includes referrers and referred friends)."},"currencyISO":{"type":["string","null"],"minLength":3,"maxLength":3,"description":"The program currency as an [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) code (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CampaignStatus","description":"The program status."},"rewards":{"type":"array","items":{"$ref":"#/components/schemas/Reward"},"description":"The list of rewards associated with the program."}}},"CampaignType":{"type":"string","enum":["REFERRAL","AFFILIATE"]},"CampaignStatus":{"type":"string","enum":["DRAFT","IN_PROGRESS","COMPLETE","DELETED"]},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaigns":{"post":{"tags":["Campaigns"],"operationId":"createCampaign","summary":"Create a campaign","description":"Creates a new program, plus any optional program rewards. The new program is created in `DRAFT` status and owned by the API key's bound team.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreateRequest"}}}},"responses":{"200":{"description":"Campaign created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"description":"This action isn't available for your account yet (it needs an active subscription or a payment method on file), or the program limit was reached."},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update a campaign

> Updates a program's identity and lifecycle. Only the fields you send are changed. \`type\`, \`urlId\`, and \`currencyISO\` are immutable. Editor-tab configuration (design, emails, options, installation) is edited via the dedicated config sub-resources, not here. The program cannot be deleted via this endpoint.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignUpdateRequest":{"type":"object","description":"Request body for updating a program's identity and lifecycle. Only the fields you send are changed. `type`, `urlId`, and `currencyISO` are immutable — currency is chosen once when the program is created and cannot be changed here (sending it returns a `400`). Editor-tab configuration (design, emails, options, installation) is edited via the dedicated config sub-resources (e.g. `PATCH /campaign/{id}/emails`), not here.","properties":{"name":{"type":"string","description":"The program name (internal only, never exposed to participants)."},"companyName":{"type":"string","description":"The company name shown to participants across the program's emails and referral portal."},"companyLogoImageUrl":{"type":"string","description":"URL of the company logo shown to participants. The returned campaign reflects a GrowSurf-hosted URL that may differ from the one you supplied."},"status":{"type":"string","enum":["IN_PROGRESS","COMPLETE"],"description":"The requested program status. Only the dashboard's lifecycle moves are accepted: `IN_PROGRESS` publishes a `DRAFT` program or resumes a `COMPLETE`/`CANCELLED` one; `COMPLETE` ends an `IN_PROGRESS` program. Any other target (including `DRAFT`, `PENDING`, `CANCELLED`, and `DELETED`) returns a `400`."}}},"Campaign":{"type":"object","description":"Detailed information about a GrowSurf program.","required":["id","name","type","referralCount","participantCount","impressionCount","inviteCount","winnerCount","status","rewards"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the program."},"name":{"type":"string","description":"The program name (internal only, never exposed to participants)."},"type":{"$ref":"#/components/schemas/CampaignType","description":"The program type."},"referralCount":{"type":"integer","readOnly":true,"description":"The total referral count."},"participantCount":{"type":"integer","readOnly":true,"description":"The total participant count."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions — the collective number of times participants' unique referral links have been viewed."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites sent by participants."},"winnerCount":{"type":"integer","readOnly":true,"description":"The total number of winners — all participants with at least one approved reward (includes referrers and referred friends)."},"currencyISO":{"type":["string","null"],"minLength":3,"maxLength":3,"description":"The program currency as an [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) code (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CampaignStatus","description":"The program status."},"rewards":{"type":"array","items":{"$ref":"#/components/schemas/Reward"},"description":"The list of rewards associated with the program."}}},"CampaignType":{"type":"string","enum":["REFERRAL","AFFILIATE"]},"CampaignStatus":{"type":"string","enum":["DRAFT","IN_PROGRESS","COMPLETE","DELETED"]},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}":{"patch":{"tags":["Campaigns"],"operationId":"updateCampaign","summary":"Update a campaign","description":"Updates a program's identity and lifecycle. Only the fields you send are changed. `type`, `urlId`, and `currencyISO` are immutable. Editor-tab configuration (design, emails, options, installation) is edited via the dedicated config sub-resources, not here. The program cannot be deleted via this endpoint.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdateRequest"}}}},"responses":{"200":{"description":"Campaign updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Clone a campaign

> Clones an existing program into a new \`DRAFT\` program. Integrations and credentials are not copied; active rewards are cloned.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"Campaign":{"type":"object","description":"Detailed information about a GrowSurf program.","required":["id","name","type","referralCount","participantCount","impressionCount","inviteCount","winnerCount","status","rewards"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the program."},"name":{"type":"string","description":"The program name (internal only, never exposed to participants)."},"type":{"$ref":"#/components/schemas/CampaignType","description":"The program type."},"referralCount":{"type":"integer","readOnly":true,"description":"The total referral count."},"participantCount":{"type":"integer","readOnly":true,"description":"The total participant count."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions — the collective number of times participants' unique referral links have been viewed."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites sent by participants."},"winnerCount":{"type":"integer","readOnly":true,"description":"The total number of winners — all participants with at least one approved reward (includes referrers and referred friends)."},"currencyISO":{"type":["string","null"],"minLength":3,"maxLength":3,"description":"The program currency as an [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) code (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CampaignStatus","description":"The program status."},"rewards":{"type":"array","items":{"$ref":"#/components/schemas/Reward"},"description":"The list of rewards associated with the program."}}},"CampaignType":{"type":"string","enum":["REFERRAL","AFFILIATE"]},"CampaignStatus":{"type":"string","enum":["DRAFT","IN_PROGRESS","COMPLETE","DELETED"]},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/clone":{"post":{"tags":["Campaigns"],"operationId":"cloneCampaign","summary":"Clone a campaign","description":"Clones an existing program into a new `DRAFT` program. Integrations and credentials are not copied; active rewards are cloned.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Campaign cloned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## CAMPAIGN REWARDS ↓

{% hint style="info" %}
Read or update a program's **Rewards** tab. Available fields depend on the program type (referral or affiliate); `PATCH` is a partial merge (send only what you want to change).
{% endhint %}

## List campaign rewards

> Retrieves the list of a program's configured rewards (\`CampaignReward\`s) — the same set embedded in the \`rewards\` array of the campaign response. Delete a reward with \`DELETE /campaign/{id}/reward-configs/{campaignRewardId}\`.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignRewardListResponse":{"type":"object","description":"The list of a program's configured rewards.","required":["rewards"],"properties":{"rewards":{"type":"array","items":{"$ref":"#/components/schemas/Reward"},"description":"The program's active, visible, and enabled reward configs."}}},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/reward-configs":{"get":{"tags":["Campaigns"],"operationId":"listCampaignRewards","summary":"List campaign rewards","description":"Retrieves the list of a program's configured rewards (`CampaignReward`s) — the same set embedded in the `rewards` array of the campaign response. Delete a reward with `DELETE /campaign/{id}/reward-configs/{campaignRewardId}`.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Campaign rewards returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignRewardListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Create a campaign reward

> Creates a new campaign reward (\`CampaignReward\`) with a GrowSurf-assigned ID. The reward type must be compatible with the program type (affiliate programs support only \`AFFILIATE\` rewards; referral programs support all other types). Enabling an active reward of a type automatically enables that reward type on the program.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"RewardCreateRequest":{"type":"object","description":"Request body for creating a campaign reward. `type` is required and must be compatible with the program type. AFFILIATE rewards additionally require `commissionStructure` (with `amount` for a `FIXED` commission or `percent` for a `PERCENT` commission).","required":["type"],"allOf":[{"$ref":"#/components/schemas/RewardWritableFields"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type. Immutable after creation."}}}]},"RewardWritableFields":{"type":"object","description":"The writable fields shared by the create and update campaign reward requests.","properties":{"title":{"type":"string","description":"The reward title (internal only, never exposed to participants)."},"description":{"type":"string","description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (double-sided rewards only)."},"imageUrl":{"type":["string","null"],"description":"An image URL for the reward."},"isVisible":{"type":"boolean","default":true,"description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"isUnlimited":{"type":"boolean","default":true,"description":"Whether the reward can be earned an unlimited number of times. Defaults to `true`, except `MILESTONE` rewards, which can only be earned once."},"referredRewardUpfront":{"type":"boolean","default":false,"description":"For double-sided rewards, deliver the referred friend's reward upfront as a discount."},"limit":{"type":"integer","minimum":0,"default":1,"description":"The number of times a participant can earn the reward (overridden by `isUnlimited`)."},"conversionsRequired":{"type":"integer","minimum":1,"default":1,"description":"The number of referrals required to earn the reward."},"numberOfWinners":{"type":"integer","minimum":0,"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total. A `LEADERBOARD` reward that omits it defaults to `3`."},"order":{"type":"integer","description":"The display order of the reward."},"limitDuration":{"type":"string","enum":["IN_TOTAL","PER_MONTH","PER_YEAR"],"default":"IN_TOTAL","description":"The window over which `limit` applies."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text shown before a participant's referral count in milestone progress copy (e.g. `You are only`). Applies to `MILESTONE` rewards."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text shown after a participant's referral count in milestone progress copy (e.g. `referrals away from your next reward!`). Applies to `MILESTONE` rewards."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook when this reward is earned. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same behavior and caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"Custom key/value metadata (single-level; keys are camelCased on save; values are stored as strings). Sending `metadata` REPLACES the stored object. Campaign copy can reference a key via `{{campaignReward['<rewardId>']['<key>']}}` tokens: renaming a key (same value, new key) automatically rewrites those references; removing a key that campaign copy still references returns a `409` listing the referencing fields."},"commissionStructure":{"$ref":"#/components/schemas/CommissionStructure","description":"The affiliate commission structure (AFFILIATE rewards only). REQUIRED when creating an AFFILIATE reward — include `amount` (and optionally `amountISO`) for a `FIXED` commission, or `percent` for a `PERCENT` commission."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). Used by tax documentation / 1099 reporting. `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. Defaults to not tax-reportable (a purchase rebate). `null` when no valuation is set."}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/reward-configs":{"post":{"tags":["Campaigns"],"operationId":"createCampaignReward","summary":"Create a campaign reward","description":"Creates a new campaign reward (`CampaignReward`) with a GrowSurf-assigned ID. The reward type must be compatible with the program type (affiliate programs support only `AFFILIATE` rewards; referral programs support all other types). Enabling an active reward of a type automatically enables that reward type on the program.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewardCreateRequest"}}}},"responses":{"200":{"description":"Campaign reward created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reward"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update a campaign reward

> Updates an existing campaign reward (\`CampaignReward\`). The reward \`type\` is immutable and cannot be changed. When the update replaces \`metadata\`, renamed keys automatically rewrite any \`{{campaignReward\[…]}}\` references in campaign copy; removing a key that campaign copy still references returns a \`409\` listing the referencing fields.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"CampaignRewardId":{"name":"campaignRewardId","in":"path","required":true,"description":"Campaign reward (`CampaignReward`) ID.","schema":{"type":"string"}}},"schemas":{"RewardUpdateRequest":{"allOf":[{"$ref":"#/components/schemas/RewardWritableFields"}],"description":"Request body for updating a campaign reward. All fields are optional; `type` is immutable and must not be supplied."},"RewardWritableFields":{"type":"object","description":"The writable fields shared by the create and update campaign reward requests.","properties":{"title":{"type":"string","description":"The reward title (internal only, never exposed to participants)."},"description":{"type":"string","description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (double-sided rewards only)."},"imageUrl":{"type":["string","null"],"description":"An image URL for the reward."},"isVisible":{"type":"boolean","default":true,"description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"isUnlimited":{"type":"boolean","default":true,"description":"Whether the reward can be earned an unlimited number of times. Defaults to `true`, except `MILESTONE` rewards, which can only be earned once."},"referredRewardUpfront":{"type":"boolean","default":false,"description":"For double-sided rewards, deliver the referred friend's reward upfront as a discount."},"limit":{"type":"integer","minimum":0,"default":1,"description":"The number of times a participant can earn the reward (overridden by `isUnlimited`)."},"conversionsRequired":{"type":"integer","minimum":1,"default":1,"description":"The number of referrals required to earn the reward."},"numberOfWinners":{"type":"integer","minimum":0,"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total. A `LEADERBOARD` reward that omits it defaults to `3`."},"order":{"type":"integer","description":"The display order of the reward."},"limitDuration":{"type":"string","enum":["IN_TOTAL","PER_MONTH","PER_YEAR"],"default":"IN_TOTAL","description":"The window over which `limit` applies."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text shown before a participant's referral count in milestone progress copy (e.g. `You are only`). Applies to `MILESTONE` rewards."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text shown after a participant's referral count in milestone progress copy (e.g. `referrals away from your next reward!`). Applies to `MILESTONE` rewards."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook when this reward is earned. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same behavior and caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"Custom key/value metadata (single-level; keys are camelCased on save; values are stored as strings). Sending `metadata` REPLACES the stored object. Campaign copy can reference a key via `{{campaignReward['<rewardId>']['<key>']}}` tokens: renaming a key (same value, new key) automatically rewrites those references; removing a key that campaign copy still references returns a `409` listing the referencing fields."},"commissionStructure":{"$ref":"#/components/schemas/CommissionStructure","description":"The affiliate commission structure (AFFILIATE rewards only). REQUIRED when creating an AFFILIATE reward — include `amount` (and optionally `amountISO`) for a `FIXED` commission, or `percent` for a `PERCENT` commission."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). Used by tax documentation / 1099 reporting. `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. Defaults to not tax-reportable (a purchase rebate). `null` when no valuation is set."}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"RewardTaxValuation":{"type":"object","description":"Tax valuation settings for a reward. Only relevant when the program collects tax documentation.","properties":{"fairMarketValueUSD":{"type":["number","null"],"minimum":0,"description":"Manual fair-market value in USD (major units) used as the fallback when the reward value cannot be resolved automatically. `null` = no manual value."},"isTaxReportable":{"type":["boolean","null"],"description":"Whether the reward's value counts toward 1099 thresholds/totals. `null` = use the smart default for the reward's source."}}},"Reward":{"type":"object","description":"A single campaign reward (also known as a `CampaignReward`). This is different from a `ParticipantReward`, which is a reward earned by a participant.","required":["id","type","isUnlimited","metadata"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the campaign reward. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward."},"type":{"$ref":"#/components/schemas/RewardType","description":"The reward type."},"title":{"type":["string","null"],"description":"The reward title (internal only, never exposed to participants)."},"isVisible":{"type":"boolean","description":"Whether the reward is enabled. When `false`, the reward is disabled: it is no longer awarded, and it is hidden from participants, including those who already earned it. Set `true` for the reward to be visible and awardable."},"description":{"type":["string","null"],"description":"The reward description shown to the referrer."},"referralDescription":{"type":["string","null"],"description":"The reward description shown to the referred friend (only applicable for double-sided reward types)."},"referredRewardUpfront":{"type":"boolean","description":"Only applies to double-sided rewards. When `true`, the referred friend's reward is delivered upfront as a discount and no `ParticipantReward` is created for them when the referral triggers."},"isUnlimited":{"type":"boolean","description":"`true` if this reward can be earned by a single participant an unlimited number of times."},"limit":{"type":["integer","null"],"description":"The number of times a participant can earn this reward (overridden when `isUnlimited` is `true`). `-1` represents an unlimited reward in REST responses."},"conversionsRequired":{"type":["integer","null"],"description":"The number of referrals a participant must make to earn this reward."},"numberOfWinners":{"type":["integer","null"],"description":"The maximum number of winners. Only applies to `LEADERBOARD` rewards. When `limitDuration` is `PER_MONTH`, this many top referrers win each month; otherwise this many win in total."},"limitDuration":{"type":["string","null"],"enum":["IN_TOTAL","PER_MONTH","PER_YEAR",null],"description":"Whether the reward can be earned in total, on a monthly basis, or on a yearly basis."},"imageUrl":{"type":["string","null"],"description":"The reward image URL."},"couponCode":{"type":["string","null"],"description":"A static coupon code shown to the referrer in the reward-won email and webhook. Display text only; GrowSurf does not create or validate it in any billing system. If the program has a connected billing integration (Stripe, Chargebee, or Recurly) that issues a coupon for the referral, that issued code is shown instead."},"order":{"type":["integer","null"],"description":"If there are multiple rewards, the order in which the reward should be displayed. `null` by default until set within the Design step of the program editor."},"nextMilestonePrefix":{"type":["string","null"],"description":"Text displayed in front of a participant's referral count for UI purposes (e.g., \"You are only\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"nextMilestoneSuffix":{"type":["string","null"],"description":"Text displayed after a participant's referral count for UI purposes (e.g., \"referrals away from receiving a nice reward!\"). Applicable for milestone rewards (when `type` is `MILESTONE`)."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"The reward metadata."},"commissionStructure":{"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The reward commission structure. Present only for affiliate programs."},"referralCouponCode":{"type":["string","null"],"description":"A static coupon code shown to the referred friend in the reward-won email and webhook (double-sided rewards). Same caveats as `couponCode`: display text only, not created or validated in any billing system, and superseded by a connected billing integration's issued coupon when one exists."},"value":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the reward (the referrer's side of a double-sided reward). `null` when no valuation is set."},"referredValue":{"oneOf":[{"$ref":"#/components/schemas/RewardTaxValuation"},{"type":"null"}],"description":"Tax valuation for the referred friend's side of a double-sided reward. `null` when no valuation is set."}}},"RewardType":{"type":"string","enum":["SINGLE_SIDED","DOUBLE_SIDED","MILESTONE","LEADERBOARD","AFFILIATE"]},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Conflicting duplicate request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/reward-configs/{campaignRewardId}":{"patch":{"tags":["Campaigns"],"operationId":"updateCampaignReward","summary":"Update a campaign reward","description":"Updates an existing campaign reward (`CampaignReward`). The reward `type` is immutable and cannot be changed. When the update replaces `metadata`, renamed keys automatically rewrite any `{{campaignReward[…]}}` references in campaign copy; removing a key that campaign copy still references returns a `409` listing the referencing fields.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/CampaignRewardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewardUpdateRequest"}}}},"responses":{"200":{"description":"Campaign reward updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reward"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Delete a campaign reward

> Deletes a campaign reward (\`CampaignReward\`). The reward is deactivated, removed from the program's reward set, and any connected upfront-discount coupons are cleaned up. If campaign copy still references any of the reward's metadata keys via \`{{campaignReward\[…]}}\` tokens, the delete returns a \`409\` listing the referencing fields — update those fields first.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"CampaignRewardId":{"name":"campaignRewardId","in":"path","required":true,"description":"Campaign reward (`CampaignReward`) ID.","schema":{"type":"string"}}},"schemas":{"DeleteRewardResponse":{"type":"object","required":["id","success"],"properties":{"id":{"type":"string","description":"The deleted reward ID."},"success":{"description":"Whether the campaign reward was deleted.","type":"boolean"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Conflicting duplicate request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/reward-configs/{campaignRewardId}":{"delete":{"tags":["Campaigns"],"operationId":"deleteCampaignReward","summary":"Delete a campaign reward","description":"Deletes a campaign reward (`CampaignReward`). The reward is deactivated, removed from the program's reward set, and any connected upfront-discount coupons are cleaned up. If campaign copy still references any of the reward's metadata keys via `{{campaignReward[…]}}` tokens, the delete returns a `409` listing the referencing fields — update those fields first.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/CampaignRewardId"}],"responses":{"200":{"description":"Campaign reward deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRewardResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## CAMPAIGN DESIGN ↓

{% hint style="info" %}
Read or update a program's **Design** tab — the GrowSurf window layout, header, share channels, signup form, portal/landing pages, and theme styling. This is a large, deeply nested object whose available fields depend on the program type (referral or affiliate); `PATCH` is a partial merge (send only what you want to change). Portal/landing-page custom code/JS is not editable via the API.
{% endhint %}

## Retrieve campaign design

> Retrieves a program's design configuration — the same surface as the dashboard Program Editor's \*\*Design\*\* tab: the GrowSurf window layout, header, share channels + invite, signup form, portal/landing pages, theme styling, and the referral/affiliate summary + status sections. This is a large object whose available fields depend on the program type; the response includes every field and its current value, which is the same shape you send back on \`PATCH\`.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignDesign":{"type":"object","description":"A program's design configuration (the dashboard Program Editor's Design tab). This is a large, nested object organized by section; each section holds the design fields for that part of the GrowSurf window and landing pages. The exact fields available depend on the program type (e.g. `referralSummary` is referral-only; `affiliateSummary`, `commissions`, `payouts`, and `participantSettings` are affiliate-only). To see the full object with every field and its current value, `GET` this resource, then `PATCH` back only the sections or fields you want to change (arrays like `signup.fields` replace wholesale).","properties":{"window":{"type":"object","description":"How the sections inside the GrowSurf window are laid out. `navigationMode` chooses between a tabbed layout (`TABS`) and a single scrolling list (`LIST`)."},"header":{"type":"object","description":"Header content for participants (`postText`) and non-participants (`preText`)."},"stats":{"type":"object","description":"The stats panel a participant sees at the top of the GrowSurf window, summarizing their own referral progress. Only its heading text (`title`) is editable here."},"share":{"type":"object","description":"Share channels (`type.<channel>.{isVisible,buttonText,message,order}`), invite settings, and share-button styling."},"signup":{"type":"object","description":"Signup form (`fields[]`, GDPR consent, button and login text)."},"referralStatus":{"type":"object","description":"The Referral Status section, which lists the people a participant has invited and each one's progress (invite sent, pending, awarded, or expired). Controls its title, icon, column and status labels, empty-state text, and whether invited emails are masked."},"leaderboard":{"type":"object","description":"The Leaderboard section that ranks participants against each other. Controls its title, icon, column labels, which time-period and ranking selectors appear, empty-state text, and how other participants' names are masked."},"referredExperience":{"type":"object","description":"The banner and headline shown to someone who arrives on your site through a referral link (for example, \"You were referred by Jane\"). Controls the banner and heading text, where they appear, whether they link to signup, and how the referrer's name is formatted."},"referralSummary":{"type":"object","description":"Referral programs only. The row of summary tiles a participant sees (clicks, leads, referrals, invites sent, rewards earned, and more). Controls each tile's label, tooltip, and visibility, plus the section's title and icon."},"affiliateSummary":{"type":"object","description":"Affiliate programs only. The row of summary tiles an affiliate sees (clicks, leads, referrals, referral revenue, upcoming payout, and total paid out). Controls each tile's label, tooltip, and visibility, plus the section's title and icon."},"commissions":{"type":"object","description":"Affiliate programs only. The Commissions section of the participant portal, which lists an affiliate's earned commissions and their status (pending, approved, paid, or reversed). Controls its title, icon, column labels, status labels and tooltips, and empty-state text."},"payouts":{"type":"object","description":"Affiliate programs only. The Payouts section of the participant portal, which lists an affiliate's payouts and their status (upcoming, queued, issued, or failed). Controls its title, icon, column labels, status labels and tooltips, and empty-state text."},"rewards":{"type":"object","description":"The heading, icon, and empty-state text of the rewards panel shown to participants. Which rewards appear, and the order they appear in, are managed through the campaign rewards endpoints, not here."},"participantSettings":{"type":"object","description":"The participant's account settings area in the portal. Controls the labels and messages for logging out, managing a PayPal payout email, and completing tax details (country of residency, VAT, and tax-form status). Applies to affiliate programs, and to referral programs that collect tax information or pay participants through PayPal."},"landingPages":{"type":"object","description":"Portal and landing pages — company info, `content` (FAQ/terms/labels), `styles` (fonts), third-party script IDs (GA/GTM/Facebook/HubSpot), and SEO meta tags. Custom code, CSS, and JS are not editable via the API."},"theme":{"type":"object","description":"Visual theme styling (colors, shadows, and similar)."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/design":{"get":{"tags":["Campaigns"],"operationId":"retrieveCampaignDesign","summary":"Retrieve campaign design","description":"Retrieves a program's design configuration — the same surface as the dashboard Program Editor's **Design** tab: the GrowSurf window layout, header, share channels + invite, signup form, portal/landing pages, theme styling, and the referral/affiliate summary + status sections. This is a large object whose available fields depend on the program type; the response includes every field and its current value, which is the same shape you send back on `PATCH`.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Campaign design returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDesign"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update campaign design

> Updates a program's design configuration. Only the fields you send are changed; anything you leave out is untouched (arrays such as \`signup.fields\` replace wholesale). Unknown fields, fields not available for the program type, and invalid values return a \`400\`. Landing-page custom code and JavaScript are not editable via the API.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignDesign":{"type":"object","description":"A program's design configuration (the dashboard Program Editor's Design tab). This is a large, nested object organized by section; each section holds the design fields for that part of the GrowSurf window and landing pages. The exact fields available depend on the program type (e.g. `referralSummary` is referral-only; `affiliateSummary`, `commissions`, `payouts`, and `participantSettings` are affiliate-only). To see the full object with every field and its current value, `GET` this resource, then `PATCH` back only the sections or fields you want to change (arrays like `signup.fields` replace wholesale).","properties":{"window":{"type":"object","description":"How the sections inside the GrowSurf window are laid out. `navigationMode` chooses between a tabbed layout (`TABS`) and a single scrolling list (`LIST`)."},"header":{"type":"object","description":"Header content for participants (`postText`) and non-participants (`preText`)."},"stats":{"type":"object","description":"The stats panel a participant sees at the top of the GrowSurf window, summarizing their own referral progress. Only its heading text (`title`) is editable here."},"share":{"type":"object","description":"Share channels (`type.<channel>.{isVisible,buttonText,message,order}`), invite settings, and share-button styling."},"signup":{"type":"object","description":"Signup form (`fields[]`, GDPR consent, button and login text)."},"referralStatus":{"type":"object","description":"The Referral Status section, which lists the people a participant has invited and each one's progress (invite sent, pending, awarded, or expired). Controls its title, icon, column and status labels, empty-state text, and whether invited emails are masked."},"leaderboard":{"type":"object","description":"The Leaderboard section that ranks participants against each other. Controls its title, icon, column labels, which time-period and ranking selectors appear, empty-state text, and how other participants' names are masked."},"referredExperience":{"type":"object","description":"The banner and headline shown to someone who arrives on your site through a referral link (for example, \"You were referred by Jane\"). Controls the banner and heading text, where they appear, whether they link to signup, and how the referrer's name is formatted."},"referralSummary":{"type":"object","description":"Referral programs only. The row of summary tiles a participant sees (clicks, leads, referrals, invites sent, rewards earned, and more). Controls each tile's label, tooltip, and visibility, plus the section's title and icon."},"affiliateSummary":{"type":"object","description":"Affiliate programs only. The row of summary tiles an affiliate sees (clicks, leads, referrals, referral revenue, upcoming payout, and total paid out). Controls each tile's label, tooltip, and visibility, plus the section's title and icon."},"commissions":{"type":"object","description":"Affiliate programs only. The Commissions section of the participant portal, which lists an affiliate's earned commissions and their status (pending, approved, paid, or reversed). Controls its title, icon, column labels, status labels and tooltips, and empty-state text."},"payouts":{"type":"object","description":"Affiliate programs only. The Payouts section of the participant portal, which lists an affiliate's payouts and their status (upcoming, queued, issued, or failed). Controls its title, icon, column labels, status labels and tooltips, and empty-state text."},"rewards":{"type":"object","description":"The heading, icon, and empty-state text of the rewards panel shown to participants. Which rewards appear, and the order they appear in, are managed through the campaign rewards endpoints, not here."},"participantSettings":{"type":"object","description":"The participant's account settings area in the portal. Controls the labels and messages for logging out, managing a PayPal payout email, and completing tax details (country of residency, VAT, and tax-form status). Applies to affiliate programs, and to referral programs that collect tax information or pay participants through PayPal."},"landingPages":{"type":"object","description":"Portal and landing pages — company info, `content` (FAQ/terms/labels), `styles` (fonts), third-party script IDs (GA/GTM/Facebook/HubSpot), and SEO meta tags. Custom code, CSS, and JS are not editable via the API."},"theme":{"type":"object","description":"Visual theme styling (colors, shadows, and similar)."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/design":{"patch":{"tags":["Campaigns"],"operationId":"updateCampaignDesign","summary":"Update campaign design","description":"Updates a program's design configuration. Only the fields you send are changed; anything you leave out is untouched (arrays such as `signup.fields` replace wholesale). Unknown fields, fields not available for the program type, and invalid values return a `400`. Landing-page custom code and JavaScript are not editable via the API.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDesign"}}}},"responses":{"200":{"description":"Campaign design updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDesign"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## CAMPAIGN EMAILS ↓

{% hint style="info" %}
Read or update a program's **Emails** tab — each editable email template (`subject`, `preheader`, `body`, `isEnabled`) plus the shared `settings` block (sender, contact, and design). The set of templates depends on the program type (referral or affiliate). `PATCH` is a partial merge (send only what you want to change); writing a template that is not available for the program type (referral or affiliate) returns a `400`, and the custom sender `fromEmail` is read-only (it requires dashboard domain verification).
{% endhint %}

## Retrieve campaign emails

> Retrieves a program's email configuration — the same surface as the dashboard Program Editor's \*\*Emails\*\* tab. Returns each editable email template (\`subject\`, \`preheader\`, \`body\`, \`isEnabled\`) plus the \`settings\` block (sender, contact, and design). The set of email templates returned depends on the program type (referral vs affiliate).

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignEmails":{"type":"object","description":"A program's email configuration (the dashboard Program Editor's Emails tab). Each property is an editable email template; the set of templates available depends on the program type (referral vs affiliate), and writing a template that is not available for the program type returns a `400`. The `settings` object holds sender, contact, and design settings. To see the full object with every template and its current values, `GET` this resource, then `PATCH` back only the fields you want to change.","properties":{"welcomeNonReferred":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Welcome email sent to a participant who joins on their own, without being referred. Available for both referral and affiliate programs."},"welcomeReferred":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Welcome email sent to someone who signs up through another participant's referral link (also covers referrals you add from the dashboard). Referral programs only."},"referralLinkViewedFirstTime":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to a participant the first time their referral link is viewed. It goes out only once. Available for both referral and affiliate programs."},"referralLinkUsed":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to a referrer when they earn referral credit because someone they referred completed the qualifying action. Most useful when a reward needs more than one referral to unlock. Labeled \"Referral Credit Received\" in the Program Editor. Referral programs only."},"referredSignup":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to a referrer each time someone signs up using their referral link. Labeled \"Referral Link Used\" in the Program Editor. Available for both referral and affiliate programs."},"goalAchieved":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to a participant when they unlock a reward (and to the referred friend as well, for double-sided rewards). Labeled \"Reward Unlocked\" in the Program Editor. Referral programs only."},"campaignEndedWinners":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to every participant who unlocked at least one reward, once the program ends. Referral programs only."},"campaignEndedNonWinners":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to every participant who did not unlock a reward, once the program ends. Referral programs only."},"progressUpdateMonthly":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"A month-end summary emailed to participants recapping how they are doing in the program. Available for both referral and affiliate programs."},"commissionGenerated":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to an affiliate when they earn a new commission, for example when a customer they referred makes a purchase. Affiliate programs only."},"commissionAdjusted":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to an affiliate when one of their commissions is adjusted because of a full refund, partial refund, or chargeback. Affiliate programs only."},"payoutPending":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to an affiliate when a batch payment is started and they have a payout on the way. Affiliate programs only."},"payoutSentSuccess":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to an affiliate when their payout completes successfully. Labeled \"Payout Sent Successfully\" in the Program Editor. Affiliate programs only."},"invite":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"The invitation email a participant sends to friends. Applies only when the program sends invites on the company's behalf (Design > Share > Invite, with your company as the sender). Its `useCompanyReplyTo` field sets whether replies go to your company or to the participant who sent the invite. Available for both referral and affiliate programs."},"loginLink":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"The one-time sign-in link emailed to returning participants. Applies when participant sign-in is required (in Options). Labeled \"One-Time Login Link\" in the Program Editor. This is a transactional email, so its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"paypalEmailConfirmation":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Asks a participant to set or confirm the PayPal email address where they will receive payouts. Applies when the confirm-email setting is on in the PayPal integration. This is a transactional email, so its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"taxInfoMissing":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Asks a participant to submit the tax information required before they can be paid. Sends only when the program collects tax information. Its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"taxInfoReceived":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Confirms to a participant that the tax information they submitted was received. Its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"taxInfoApproved":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Tells a participant that their tax form is complete and approved. Labeled \"Tax Form Complete\" in the Program Editor. Its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"taxInfoRejected":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Tells a participant that their tax information was rejected and needs to be resubmitted. Its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"settings":{"$ref":"#/components/schemas/CampaignEmailSettings","description":"Sender, contact, and design settings for the program's emails (the Emails > Settings sub-page)."}}},"CampaignEmailTemplate":{"type":"object","description":"A single editable email template. `subject` and `preheader` are capped at 255 characters; `body` is HTML capped at 150000 characters.","properties":{"subject":{"type":"string","maxLength":255,"description":"The email's subject line. Supports dynamic text (`{{...}}` tokens), the same as the body."},"preheader":{"type":"string","maxLength":255,"description":"The preview text shown after the subject line in most inboxes."},"body":{"type":"string","maxLength":150000,"description":"The email body as HTML. You can personalize it with dynamic text, inserting `{{...}}` tokens like `{{firstName}}` or `{{shareUrl}}` to tailor each email to its recipient. See [Guide to using dynamic text in GrowSurf emails](https://support.growsurf.com/article/213-guide-to-using-dynamic-text-in-growsurf-emails)."},"isEnabled":{"type":"boolean","description":"Whether this email is enabled. Read-only for transactional and invite emails (only promotional emails can be toggled) — sending it for those emails returns a `400`."},"useCompanyReplyTo":{"type":"boolean","description":"Only applicable to the `invite` email. When `true`, replies go to your company's reply-to address instead of the referring participant, which keeps the participant's email address private (it is never exposed to the people they invite). When `false`, replies go to the referring participant."}}},"CampaignEmailSettings":{"type":"object","description":"Email sender, contact, and design settings (the Emails → Settings sub-page).","properties":{"sender":{"description":"Sender name and reply-to settings for program emails.","$ref":"#/components/schemas/CampaignEmailSenderSettings"},"contact":{"$ref":"#/components/schemas/CampaignEmailContactSettings"},"design":{"description":"Design settings shared across program emails.","$ref":"#/components/schemas/CampaignEmailDesignSettings"}}},"CampaignEmailSenderSettings":{"type":"object","properties":{"fromName":{"type":"string","maxLength":100,"description":"The email sender name. Required; cannot be an email address."},"replyToEmail":{"type":"string","maxLength":100,"description":"The reply-to email address. Required; must be a valid email address."},"fromEmail":{"type":"string","readOnly":true,"description":"The from email address. Read-only — setting a custom from-address requires domain verification in the dashboard."}}},"CampaignEmailContactSettings":{"type":"object","description":"The physical mailing address shown in your email footers (required by anti-spam laws such as the US CAN-SPAM Act).","properties":{"companyName":{"type":"string","maxLength":255,"description":"Required."},"addressLine1":{"type":"string","maxLength":255,"description":"Required."},"addressLine2":{"description":"Second address line shown in email footers.","type":["string","null"],"maxLength":255},"city":{"type":"string","maxLength":255,"description":"Required."},"state":{"description":"State, province, or region shown in email footers.","type":["string","null"],"maxLength":255},"postalCode":{"description":"Postal or ZIP code shown in email footers.","type":["string","null"],"maxLength":100},"country":{"type":["string","null"],"maxLength":100,"description":"Free-text country (not validated as an ISO code)."}}},"CampaignEmailDesignSettings":{"type":"object","properties":{"header":{"type":["string","null"],"maxLength":150000,"description":"Email header HTML."},"footer":{"type":["string","null"],"maxLength":150000,"description":"Email footer HTML."},"unsubscribePromotional":{"type":"string","maxLength":150000,"description":"Unsubscribe footer for promotional emails. Must contain the tokens `{{unsubscribeLink}}`, `{{companyName}}`, and `{{address}}`."},"unsubscribeInvite":{"type":"string","maxLength":150000,"description":"Unsubscribe footer for invite emails. Must contain the tokens `{{unsubscribeLink}}`, `{{companyName}}`, and `{{address}}`."},"unsubscribeTransactional":{"type":"string","maxLength":150000,"description":"Footer for transactional emails. Must contain the tokens `{{companyName}}` and `{{address}}`."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/emails":{"get":{"tags":["Campaigns"],"operationId":"retrieveCampaignEmails","summary":"Retrieve campaign emails","description":"Retrieves a program's email configuration — the same surface as the dashboard Program Editor's **Emails** tab. Returns each editable email template (`subject`, `preheader`, `body`, `isEnabled`) plus the `settings` block (sender, contact, and design). The set of email templates returned depends on the program type (referral vs affiliate).","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Campaign emails configuration returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignEmails"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update campaign emails

> Updates a program's email configuration. Only the fields you send are changed; omitted fields are left untouched. You may only write the email templates the dashboard exposes for the program type — writing a template that is not available for the program type returns a \`400\`. Some fields are read-only (\`settings.sender.fromEmail\`, whose custom value requires dashboard domain verification).

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignEmails":{"type":"object","description":"A program's email configuration (the dashboard Program Editor's Emails tab). Each property is an editable email template; the set of templates available depends on the program type (referral vs affiliate), and writing a template that is not available for the program type returns a `400`. The `settings` object holds sender, contact, and design settings. To see the full object with every template and its current values, `GET` this resource, then `PATCH` back only the fields you want to change.","properties":{"welcomeNonReferred":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Welcome email sent to a participant who joins on their own, without being referred. Available for both referral and affiliate programs."},"welcomeReferred":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Welcome email sent to someone who signs up through another participant's referral link (also covers referrals you add from the dashboard). Referral programs only."},"referralLinkViewedFirstTime":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to a participant the first time their referral link is viewed. It goes out only once. Available for both referral and affiliate programs."},"referralLinkUsed":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to a referrer when they earn referral credit because someone they referred completed the qualifying action. Most useful when a reward needs more than one referral to unlock. Labeled \"Referral Credit Received\" in the Program Editor. Referral programs only."},"referredSignup":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to a referrer each time someone signs up using their referral link. Labeled \"Referral Link Used\" in the Program Editor. Available for both referral and affiliate programs."},"goalAchieved":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to a participant when they unlock a reward (and to the referred friend as well, for double-sided rewards). Labeled \"Reward Unlocked\" in the Program Editor. Referral programs only."},"campaignEndedWinners":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to every participant who unlocked at least one reward, once the program ends. Referral programs only."},"campaignEndedNonWinners":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to every participant who did not unlock a reward, once the program ends. Referral programs only."},"progressUpdateMonthly":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"A month-end summary emailed to participants recapping how they are doing in the program. Available for both referral and affiliate programs."},"commissionGenerated":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to an affiliate when they earn a new commission, for example when a customer they referred makes a purchase. Affiliate programs only."},"commissionAdjusted":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to an affiliate when one of their commissions is adjusted because of a full refund, partial refund, or chargeback. Affiliate programs only."},"payoutPending":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to an affiliate when a batch payment is started and they have a payout on the way. Affiliate programs only."},"payoutSentSuccess":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Sent to an affiliate when their payout completes successfully. Labeled \"Payout Sent Successfully\" in the Program Editor. Affiliate programs only."},"invite":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"The invitation email a participant sends to friends. Applies only when the program sends invites on the company's behalf (Design > Share > Invite, with your company as the sender). Its `useCompanyReplyTo` field sets whether replies go to your company or to the participant who sent the invite. Available for both referral and affiliate programs."},"loginLink":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"The one-time sign-in link emailed to returning participants. Applies when participant sign-in is required (in Options). Labeled \"One-Time Login Link\" in the Program Editor. This is a transactional email, so its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"paypalEmailConfirmation":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Asks a participant to set or confirm the PayPal email address where they will receive payouts. Applies when the confirm-email setting is on in the PayPal integration. This is a transactional email, so its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"taxInfoMissing":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Asks a participant to submit the tax information required before they can be paid. Sends only when the program collects tax information. Its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"taxInfoReceived":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Confirms to a participant that the tax information they submitted was received. Its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"taxInfoApproved":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Tells a participant that their tax form is complete and approved. Labeled \"Tax Form Complete\" in the Program Editor. Its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"taxInfoRejected":{"$ref":"#/components/schemas/CampaignEmailTemplate","description":"Tells a participant that their tax information was rejected and needs to be resubmitted. Its on/off toggle cannot be changed. Available for both referral and affiliate programs."},"settings":{"$ref":"#/components/schemas/CampaignEmailSettings","description":"Sender, contact, and design settings for the program's emails (the Emails > Settings sub-page)."}}},"CampaignEmailTemplate":{"type":"object","description":"A single editable email template. `subject` and `preheader` are capped at 255 characters; `body` is HTML capped at 150000 characters.","properties":{"subject":{"type":"string","maxLength":255,"description":"The email's subject line. Supports dynamic text (`{{...}}` tokens), the same as the body."},"preheader":{"type":"string","maxLength":255,"description":"The preview text shown after the subject line in most inboxes."},"body":{"type":"string","maxLength":150000,"description":"The email body as HTML. You can personalize it with dynamic text, inserting `{{...}}` tokens like `{{firstName}}` or `{{shareUrl}}` to tailor each email to its recipient. See [Guide to using dynamic text in GrowSurf emails](https://support.growsurf.com/article/213-guide-to-using-dynamic-text-in-growsurf-emails)."},"isEnabled":{"type":"boolean","description":"Whether this email is enabled. Read-only for transactional and invite emails (only promotional emails can be toggled) — sending it for those emails returns a `400`."},"useCompanyReplyTo":{"type":"boolean","description":"Only applicable to the `invite` email. When `true`, replies go to your company's reply-to address instead of the referring participant, which keeps the participant's email address private (it is never exposed to the people they invite). When `false`, replies go to the referring participant."}}},"CampaignEmailSettings":{"type":"object","description":"Email sender, contact, and design settings (the Emails → Settings sub-page).","properties":{"sender":{"description":"Sender name and reply-to settings for program emails.","$ref":"#/components/schemas/CampaignEmailSenderSettings"},"contact":{"$ref":"#/components/schemas/CampaignEmailContactSettings"},"design":{"description":"Design settings shared across program emails.","$ref":"#/components/schemas/CampaignEmailDesignSettings"}}},"CampaignEmailSenderSettings":{"type":"object","properties":{"fromName":{"type":"string","maxLength":100,"description":"The email sender name. Required; cannot be an email address."},"replyToEmail":{"type":"string","maxLength":100,"description":"The reply-to email address. Required; must be a valid email address."},"fromEmail":{"type":"string","readOnly":true,"description":"The from email address. Read-only — setting a custom from-address requires domain verification in the dashboard."}}},"CampaignEmailContactSettings":{"type":"object","description":"The physical mailing address shown in your email footers (required by anti-spam laws such as the US CAN-SPAM Act).","properties":{"companyName":{"type":"string","maxLength":255,"description":"Required."},"addressLine1":{"type":"string","maxLength":255,"description":"Required."},"addressLine2":{"description":"Second address line shown in email footers.","type":["string","null"],"maxLength":255},"city":{"type":"string","maxLength":255,"description":"Required."},"state":{"description":"State, province, or region shown in email footers.","type":["string","null"],"maxLength":255},"postalCode":{"description":"Postal or ZIP code shown in email footers.","type":["string","null"],"maxLength":100},"country":{"type":["string","null"],"maxLength":100,"description":"Free-text country (not validated as an ISO code)."}}},"CampaignEmailDesignSettings":{"type":"object","properties":{"header":{"type":["string","null"],"maxLength":150000,"description":"Email header HTML."},"footer":{"type":["string","null"],"maxLength":150000,"description":"Email footer HTML."},"unsubscribePromotional":{"type":"string","maxLength":150000,"description":"Unsubscribe footer for promotional emails. Must contain the tokens `{{unsubscribeLink}}`, `{{companyName}}`, and `{{address}}`."},"unsubscribeInvite":{"type":"string","maxLength":150000,"description":"Unsubscribe footer for invite emails. Must contain the tokens `{{unsubscribeLink}}`, `{{companyName}}`, and `{{address}}`."},"unsubscribeTransactional":{"type":"string","maxLength":150000,"description":"Footer for transactional emails. Must contain the tokens `{{companyName}}` and `{{address}}`."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/emails":{"patch":{"tags":["Campaigns"],"operationId":"updateCampaignEmails","summary":"Update campaign emails","description":"Updates a program's email configuration. Only the fields you send are changed; omitted fields are left untouched. You may only write the email templates the dashboard exposes for the program type — writing a template that is not available for the program type returns a `400`. Some fields are read-only (`settings.sender.fromEmail`, whose custom value requires dashboard domain verification).","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignEmails"}}}},"responses":{"200":{"description":"Campaign emails configuration updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignEmails"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## CAMPAIGN OPTIONS ↓

{% hint style="info" %}
Read or update a program's **Options** tab — reward/fraud approval, anti-fraud lists and toggles, referral cookie/credit windows, reCAPTCHA, payout threshold + tax settings (affiliate programs only), and notification-email settings. `PATCH` is a partial merge (send only what you want to change). Some fields are program-type specific (`requireManualRewardApproval`/`autoFulfillRewards` are referral program only; `payoutThreshold`/`taxDocumentation` are affiliate-only). `fraud.recaptcha.secretKey` is write-only (never returned), and `referralCreditWindowDays: null` means the credit never expires.
{% endhint %}

## Retrieve campaign options

> Retrieves a program's options — the same surface as the dashboard Program Editor's \*\*Options\*\* tab. Includes reward/fraud approval, anti-fraud lists + toggles, referral cookie/credit windows, reCAPTCHA, payout threshold + tax settings (affiliate only), and notification-email settings. \`fraud.recaptcha.secretKey\` is never returned.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignOptions":{"type":"object","description":"A program's options (the dashboard Program Editor's Options tab). To see the full object with every field and its current value, `GET` this resource, then `PATCH` back only the fields you want to change. Some fields are program-type specific (see the per-field notes).","properties":{"requireManualRewardApproval":{"type":"boolean","description":"Referral programs only. When `true`, each reward a participant earns is held for you to manually approve before it unlocks (and before the reward-won email is sent); when `false`, earned rewards are approved automatically. Cannot be `true` together with `autoFulfillRewards`."},"autoFulfillRewards":{"type":"boolean","description":"Referral programs only. When `true`, rewards a participant earns are automatically marked as fulfilled (issued) instead of you marking each one by hand, usually paired with an automated reward-delivery integration. Cannot be `true` together with `requireManualRewardApproval`."},"requireManualFraudApproval":{"type":"boolean","description":"When `true`, no signup is automatically blocked for fraud. Every participant is allowed to join, and any suspected fraud is flagged in your dashboard for you to review. Cannot be `true` together with `autoBlockFraud`."},"autoBlockFraud":{"type":"boolean","description":"When `true`, signups flagged as high fraud risk are automatically blocked from joining; when `false`, they are allowed in and flagged in your dashboard for review. Cannot be `true` together with `requireManualFraudApproval`."},"requireParticipantAuth":{"type":"boolean","description":"Require returning participants to authenticate. Affiliate programs require this to be `true`."},"enforceGdprCompliance":{"type":"boolean","description":"When `true`, GrowSurf stores only the minimum participant data needed to help you meet GDPR/CCPA requirements — it does not store IP addresses, browser fingerprints, or mobile instance IDs. The anti-fraud checks that rely on those signals no longer apply while this is on."},"blockPaidAdsTraffic":{"type":"boolean","description":"When `true`, referrals from visitors who arrived through paid ads (for example Google or Facebook ads) are not attributed, so the referring participant is not credited for them. Recommended so participants don't compete with you for your own paid keywords."},"referralCookieWindowDays":{"type":"integer","enum":[1,3,7,14,30,60,90,180,365,400],"description":"How long, in days, a referral-link click is remembered in the visitor's browser. If the visitor signs up within this window, the referral is credited to the participant whose link they clicked."},"referralCreditWindowDays":{"type":["integer","null"],"enum":[1,3,7,14,30,60,90,180,365,null],"description":"How long, in days, a referred friend has to complete a qualifying action for their referrer to earn credit and unlock a reward. After this window the referral no longer counts toward rewards. `null` = never expires."},"payoutThreshold":{"type":["integer","null"],"minimum":0,"description":"Affiliate programs only. Minimum payout in the program's currency minor units (`0` or `null` = no minimum). Requires `currencyISO` to be set."},"fraud":{"$ref":"#/components/schemas/CampaignOptionsFraud","description":"Anti-fraud settings — block and allow lists for emails, IPs, and countries; toggles for blocking burner emails, data-center IPs, and referrals from high-risk referrers; per-IP signup rate limits; and reCAPTCHA."},"taxDocumentation":{"$ref":"#/components/schemas/CampaignOptionsTaxDocumentation","description":"Affiliate programs only. Your company's billing details (name, address, and VAT number) used on affiliate payout invoices and for VAT handling."},"notificationEmails":{"$ref":"#/components/schemas/CampaignOptionsNotificationEmails","description":"Owner notification-email settings — who receives program notifications and which events they are notified about."}}},"CampaignOptionsFraud":{"type":"object","description":"Anti-fraud settings.","properties":{"blockedEmails":{"type":"array","items":{"type":"string","maxLength":100},"description":"Blocked emails (wildcards allowed). Max 10000. Replaces the whole list."},"blockedIps":{"type":"array","items":{"type":"string","maxLength":100},"description":"Blocked IP addresses (wildcards allowed). Max 10000."},"blockedCountries":{"type":"array","items":{"type":"string","maxLength":100},"description":"Blocked countries (ISO 3166-1 alpha-2 codes)."},"allowedEmails":{"description":"Allowed email addresses or patterns. Replaces the whole list.","type":"array","items":{"type":"string","maxLength":100}},"allowedIps":{"description":"Allowed IP addresses or patterns. Replaces the whole list.","type":"array","items":{"type":"string","maxLength":100}},"allowedCountries":{"type":"array","items":{"type":"string","maxLength":100},"description":"Allowed countries (ISO 3166-1 alpha-2 codes)."},"blockBurnerEmails":{"description":"Whether signups from burner or disposable email addresses are blocked.","type":"boolean"},"blockDataCenterIps":{"description":"Whether signups from known data-center IP addresses are blocked.","type":"boolean"},"blockHighRiskReferrers":{"description":"Whether referrals from participants marked as high fraud risk are blocked.","type":"boolean"},"autoBlockHighRiskIps":{"description":"Whether high-risk signup IP addresses are added to the blocked IP list automatically.","type":"boolean"},"maxSignupsPerIp2Min":{"description":"Maximum signups allowed from one IP address in a 2-minute window.","type":"integer","minimum":1,"maximum":100},"maxSignupsPerIp10Min":{"description":"Maximum signups allowed from one IP address in a 10-minute window.","type":"integer","minimum":1,"maximum":100},"recaptcha":{"description":"reCAPTCHA settings for signup forms.","$ref":"#/components/schemas/CampaignOptionsRecaptcha"}}},"CampaignOptionsRecaptcha":{"type":"object","properties":{"isEnabled":{"description":"Whether reCAPTCHA is enabled on signup forms.","type":"boolean"},"siteKey":{"description":"Public reCAPTCHA site key used by the signup form.","type":["string","null"],"maxLength":100},"secretKey":{"type":["string","null"],"maxLength":100,"writeOnly":true,"description":"The reCAPTCHA secret key. Write-only — never returned by GET."}}},"CampaignOptionsTaxDocumentation":{"type":"object","description":"Affiliate programs only. Your company's billing details (name, address, and VAT number) used on affiliate payout invoices and for VAT handling.","properties":{"companyName":{"description":"Legal or billing company name used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"vatNumber":{"description":"Your company VAT number, when VAT collection applies.","type":["string","null"],"maxLength":100},"addressLine1":{"description":"First line of the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"addressLine2":{"description":"Second line of the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"city":{"description":"City for the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"state":{"description":"State, province, or region for the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"postalCode":{"description":"Postal or ZIP code for the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":100},"country":{"type":["string","null"],"description":"ISO 3166-1 alpha-2 country code."},"collectAffiliateVat":{"type":"boolean","description":"Requires `vatNumber` to be set."}}},"CampaignOptionsNotificationEmails":{"type":"object","description":"Owner notification-email settings.","properties":{"recipients":{"type":"array","items":{"type":"string"},"description":"Email addresses that receive program notifications."},"events":{"type":"object","description":"Per-event on/off toggles. The available events depend on the program type.","properties":{"PARTICIPANT_REACHED_A_GOAL":{"description":"Notify recipients when a participant unlocks a reward.","type":"boolean"},"NEW_PARTICIPANT_ADDED_NON_REFERRED":{"description":"Notify recipients when a participant joins without being referred.","type":"boolean"},"NEW_PARTICIPANT_ADDED_REFERRED":{"description":"Notify recipients when a participant joins through a referral link.","type":"boolean"},"CAMPAIGN_ENDED":{"description":"Notify recipients when the program ends.","type":"boolean"},"WEEKLY_PERFORMANCE_REPORT":{"description":"Send recipients the weekly performance report.","type":"boolean"},"MONTHLY_PERFORMANCE_REPORT":{"description":"Send recipients the monthly performance report.","type":"boolean"},"NEW_COMMISSION_ADDED":{"description":"Notify recipients when an affiliate earns a new commission.","type":"boolean"},"COMMISSION_ADJUSTED":{"description":"Notify recipients when an affiliate commission is adjusted.","type":"boolean"},"NEW_PAYOUT_ISSUED":{"description":"Notify recipients when an affiliate payout is issued.","type":"boolean"},"AFFILIATE_BATCH_PAYOUT_COMPLETED":{"description":"Notify recipients when an affiliate payout batch completes.","type":"boolean"},"MONTHLY_PAYOUT_REMINDER":{"description":"Send recipients the monthly affiliate payout reminder.","type":"boolean"}}}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/options":{"get":{"tags":["Campaigns"],"operationId":"retrieveCampaignOptions","summary":"Retrieve campaign options","description":"Retrieves a program's options — the same surface as the dashboard Program Editor's **Options** tab. Includes reward/fraud approval, anti-fraud lists + toggles, referral cookie/credit windows, reCAPTCHA, payout threshold + tax settings (affiliate only), and notification-email settings. `fraud.recaptcha.secretKey` is never returned.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Campaign options returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOptions"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update campaign options

> Updates a program's options. Only the fields you send are changed. Some fields are program-type specific (\`requireManualRewardApproval\`/\`autoFulfillRewards\` are referral-only; \`payoutThreshold\`/\`taxDocumentation\` are affiliate-only, and affiliate programs require \`requireParticipantAuth: true\`). \`fraud.recaptcha.secretKey\` is write-only. \`referralCreditWindowDays: null\` means "never expires".

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignOptions":{"type":"object","description":"A program's options (the dashboard Program Editor's Options tab). To see the full object with every field and its current value, `GET` this resource, then `PATCH` back only the fields you want to change. Some fields are program-type specific (see the per-field notes).","properties":{"requireManualRewardApproval":{"type":"boolean","description":"Referral programs only. When `true`, each reward a participant earns is held for you to manually approve before it unlocks (and before the reward-won email is sent); when `false`, earned rewards are approved automatically. Cannot be `true` together with `autoFulfillRewards`."},"autoFulfillRewards":{"type":"boolean","description":"Referral programs only. When `true`, rewards a participant earns are automatically marked as fulfilled (issued) instead of you marking each one by hand, usually paired with an automated reward-delivery integration. Cannot be `true` together with `requireManualRewardApproval`."},"requireManualFraudApproval":{"type":"boolean","description":"When `true`, no signup is automatically blocked for fraud. Every participant is allowed to join, and any suspected fraud is flagged in your dashboard for you to review. Cannot be `true` together with `autoBlockFraud`."},"autoBlockFraud":{"type":"boolean","description":"When `true`, signups flagged as high fraud risk are automatically blocked from joining; when `false`, they are allowed in and flagged in your dashboard for review. Cannot be `true` together with `requireManualFraudApproval`."},"requireParticipantAuth":{"type":"boolean","description":"Require returning participants to authenticate. Affiliate programs require this to be `true`."},"enforceGdprCompliance":{"type":"boolean","description":"When `true`, GrowSurf stores only the minimum participant data needed to help you meet GDPR/CCPA requirements — it does not store IP addresses, browser fingerprints, or mobile instance IDs. The anti-fraud checks that rely on those signals no longer apply while this is on."},"blockPaidAdsTraffic":{"type":"boolean","description":"When `true`, referrals from visitors who arrived through paid ads (for example Google or Facebook ads) are not attributed, so the referring participant is not credited for them. Recommended so participants don't compete with you for your own paid keywords."},"referralCookieWindowDays":{"type":"integer","enum":[1,3,7,14,30,60,90,180,365,400],"description":"How long, in days, a referral-link click is remembered in the visitor's browser. If the visitor signs up within this window, the referral is credited to the participant whose link they clicked."},"referralCreditWindowDays":{"type":["integer","null"],"enum":[1,3,7,14,30,60,90,180,365,null],"description":"How long, in days, a referred friend has to complete a qualifying action for their referrer to earn credit and unlock a reward. After this window the referral no longer counts toward rewards. `null` = never expires."},"payoutThreshold":{"type":["integer","null"],"minimum":0,"description":"Affiliate programs only. Minimum payout in the program's currency minor units (`0` or `null` = no minimum). Requires `currencyISO` to be set."},"fraud":{"$ref":"#/components/schemas/CampaignOptionsFraud","description":"Anti-fraud settings — block and allow lists for emails, IPs, and countries; toggles for blocking burner emails, data-center IPs, and referrals from high-risk referrers; per-IP signup rate limits; and reCAPTCHA."},"taxDocumentation":{"$ref":"#/components/schemas/CampaignOptionsTaxDocumentation","description":"Affiliate programs only. Your company's billing details (name, address, and VAT number) used on affiliate payout invoices and for VAT handling."},"notificationEmails":{"$ref":"#/components/schemas/CampaignOptionsNotificationEmails","description":"Owner notification-email settings — who receives program notifications and which events they are notified about."}}},"CampaignOptionsFraud":{"type":"object","description":"Anti-fraud settings.","properties":{"blockedEmails":{"type":"array","items":{"type":"string","maxLength":100},"description":"Blocked emails (wildcards allowed). Max 10000. Replaces the whole list."},"blockedIps":{"type":"array","items":{"type":"string","maxLength":100},"description":"Blocked IP addresses (wildcards allowed). Max 10000."},"blockedCountries":{"type":"array","items":{"type":"string","maxLength":100},"description":"Blocked countries (ISO 3166-1 alpha-2 codes)."},"allowedEmails":{"description":"Allowed email addresses or patterns. Replaces the whole list.","type":"array","items":{"type":"string","maxLength":100}},"allowedIps":{"description":"Allowed IP addresses or patterns. Replaces the whole list.","type":"array","items":{"type":"string","maxLength":100}},"allowedCountries":{"type":"array","items":{"type":"string","maxLength":100},"description":"Allowed countries (ISO 3166-1 alpha-2 codes)."},"blockBurnerEmails":{"description":"Whether signups from burner or disposable email addresses are blocked.","type":"boolean"},"blockDataCenterIps":{"description":"Whether signups from known data-center IP addresses are blocked.","type":"boolean"},"blockHighRiskReferrers":{"description":"Whether referrals from participants marked as high fraud risk are blocked.","type":"boolean"},"autoBlockHighRiskIps":{"description":"Whether high-risk signup IP addresses are added to the blocked IP list automatically.","type":"boolean"},"maxSignupsPerIp2Min":{"description":"Maximum signups allowed from one IP address in a 2-minute window.","type":"integer","minimum":1,"maximum":100},"maxSignupsPerIp10Min":{"description":"Maximum signups allowed from one IP address in a 10-minute window.","type":"integer","minimum":1,"maximum":100},"recaptcha":{"description":"reCAPTCHA settings for signup forms.","$ref":"#/components/schemas/CampaignOptionsRecaptcha"}}},"CampaignOptionsRecaptcha":{"type":"object","properties":{"isEnabled":{"description":"Whether reCAPTCHA is enabled on signup forms.","type":"boolean"},"siteKey":{"description":"Public reCAPTCHA site key used by the signup form.","type":["string","null"],"maxLength":100},"secretKey":{"type":["string","null"],"maxLength":100,"writeOnly":true,"description":"The reCAPTCHA secret key. Write-only — never returned by GET."}}},"CampaignOptionsTaxDocumentation":{"type":"object","description":"Affiliate programs only. Your company's billing details (name, address, and VAT number) used on affiliate payout invoices and for VAT handling.","properties":{"companyName":{"description":"Legal or billing company name used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"vatNumber":{"description":"Your company VAT number, when VAT collection applies.","type":["string","null"],"maxLength":100},"addressLine1":{"description":"First line of the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"addressLine2":{"description":"Second line of the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"city":{"description":"City for the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"state":{"description":"State, province, or region for the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":255},"postalCode":{"description":"Postal or ZIP code for the company address used on affiliate payout invoices.","type":["string","null"],"maxLength":100},"country":{"type":["string","null"],"description":"ISO 3166-1 alpha-2 country code."},"collectAffiliateVat":{"type":"boolean","description":"Requires `vatNumber` to be set."}}},"CampaignOptionsNotificationEmails":{"type":"object","description":"Owner notification-email settings.","properties":{"recipients":{"type":"array","items":{"type":"string"},"description":"Email addresses that receive program notifications."},"events":{"type":"object","description":"Per-event on/off toggles. The available events depend on the program type.","properties":{"PARTICIPANT_REACHED_A_GOAL":{"description":"Notify recipients when a participant unlocks a reward.","type":"boolean"},"NEW_PARTICIPANT_ADDED_NON_REFERRED":{"description":"Notify recipients when a participant joins without being referred.","type":"boolean"},"NEW_PARTICIPANT_ADDED_REFERRED":{"description":"Notify recipients when a participant joins through a referral link.","type":"boolean"},"CAMPAIGN_ENDED":{"description":"Notify recipients when the program ends.","type":"boolean"},"WEEKLY_PERFORMANCE_REPORT":{"description":"Send recipients the weekly performance report.","type":"boolean"},"MONTHLY_PERFORMANCE_REPORT":{"description":"Send recipients the monthly performance report.","type":"boolean"},"NEW_COMMISSION_ADDED":{"description":"Notify recipients when an affiliate earns a new commission.","type":"boolean"},"COMMISSION_ADJUSTED":{"description":"Notify recipients when an affiliate commission is adjusted.","type":"boolean"},"NEW_PAYOUT_ISSUED":{"description":"Notify recipients when an affiliate payout is issued.","type":"boolean"},"AFFILIATE_BATCH_PAYOUT_COMPLETED":{"description":"Notify recipients when an affiliate payout batch completes.","type":"boolean"},"MONTHLY_PAYOUT_REMINDER":{"description":"Send recipients the monthly affiliate payout reminder.","type":"boolean"}}}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/options":{"patch":{"tags":["Campaigns"],"operationId":"updateCampaignOptions","summary":"Update campaign options","description":"Updates a program's options. Only the fields you send are changed. Some fields are program-type specific (`requireManualRewardApproval`/`autoFulfillRewards` are referral-only; `payoutThreshold`/`taxDocumentation` are affiliate-only, and affiliate programs require `requireParticipantAuth: true`). `fraud.recaptcha.secretKey` is write-only. `referralCreditWindowDays: null` means \"never expires\".","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOptions"}}}},"responses":{"200":{"description":"Campaign options updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOptions"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## CAMPAIGN INSTALLATION ↓

{% hint style="info" %}
Read or update a program's **Installation** tab (plus Mobile SDK settings) — the referral trigger (referral programs only), signup tracking method, share URL and whitelist, custom-form signup settings, and mobile SDK settings. `PATCH` is a partial merge (send only what you want to change). `mobile.publicKey` is read-only (server-generated), and any URLs you send must include an explicit `http://` or `https://` scheme.
{% endhint %}

## Retrieve campaign installation

> Retrieves a program's installation configuration — the same surface as the dashboard Program Editor's \*\*Installation\*\* tab (plus the Mobile SDK settings). Includes the referral trigger (referral programs only), signup tracking method, share URL and whitelist, custom-form signup settings, and mobile SDK settings.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignInstallation":{"type":"object","description":"A program's installation configuration (the dashboard Program Editor's Installation tab). To see the full object with every field and its current value, `GET` this resource, then `PATCH` back only the fields you want to change. `referralTrigger` is only present and writable for referral programs.","properties":{"referralTrigger":{"type":"string","enum":["CUSTOM","ON_SIGNUP"],"description":"Referral programs only. Sets what a referred friend must do before a referral counts. `ON_SIGNUP` (\"Sign Up\") counts the referral as soon as they sign up. `CUSTOM` (\"Sign Up + Qualifying Action\") counts it only after they sign up and also complete a qualifying action you define, such as a first payment."},"signupEvent":{"type":"string","enum":["FORM_DETECTION","PROGRAMMATIC"],"description":"The signup tracking method. `FORM_DETECTION` = GrowSurf automatically detects submissions of an existing form on your site; `PROGRAMMATIC` = you add participants via the JavaScript/mobile SDKs or this API."},"shareUrl":{"type":"string","maxLength":500,"description":"The landing page referred friends are taken to when they click a participant's referral link — usually your homepage or a marketing page. Required; must include an `http(s)://` scheme and contain no `#`, `#!`, or `??`."},"useGrowSurfHostedLinks":{"type":"boolean","description":"When `true`, each participant's referral link becomes a GrowSurf-hosted link instead of a link to your own share URL, and clicks are routed by the visitor's device (Android to Google Play, iOS to your iOS attribution or App Store URL, desktop to your share URL). Mainly used by mobile apps. Applies to referral links everywhere they appear, including the SDKs, integrations, webhooks, the GrowSurf window, and participant exports."},"allowedUrls":{"type":"array","items":{"type":"string","maxLength":500},"description":"Extra domains, beyond your share URL, where the GrowSurf window and SDK are allowed to run — handy for testing on local or staging URLs. Adding an apex domain (e.g. `https://example.com`) also allows its subdomains. Each entry must include an `http(s)://` scheme. Sending this array replaces the entire list."},"signup":{"$ref":"#/components/schemas/CampaignInstallationSignup"},"mobile":{"$ref":"#/components/schemas/CampaignInstallationMobile"}}},"CampaignInstallationSignup":{"type":"object","description":"Custom signup-form settings (applies when the signup tracking method is `FORM_DETECTION`).","properties":{"isCustomForm":{"description":"Whether signups come from your own form instead of automatic form detection.","type":"boolean"},"url":{"type":["string","null"],"maxLength":500,"description":"The custom signup form URL. Must include an `http(s)://` scheme; no `#!` or `??`. Send `null` to clear."},"redirectAfterSignup":{"type":"boolean","description":"Whether the signup form redirects to another page after submission."},"redirectUrl":{"type":["string","null"],"maxLength":500,"description":"URL the signup form redirects to. Must include an `http(s)://` scheme. Send `null` to clear."},"trackInputFields":{"description":"Whether GrowSurf watches signup form fields for referral attribution.","type":"boolean"}}},"CampaignInstallationMobile":{"type":"object","description":"Settings for the GrowSurf iOS and Android mobile SDKs — enable the mobile SDK, the read-only publishable key, and the iOS/Android attribution and app-store URLs used to route mobile referral-link clicks.","properties":{"isEnabled":{"type":"boolean","description":"Whether the mobile SDK is enabled for the campaign."},"publicKey":{"type":"string","readOnly":true,"description":"The publishable mobile SDK key used by the GrowSurf iOS and Android SDKs. Read-only."},"iosAttributionUrl":{"type":["string","null"],"maxLength":500,"description":"iOS attribution URL. Must include an `http(s)://` scheme; no `#!` or `??`. Send `null` to clear."},"iosAppStoreUrl":{"description":"iOS App Store URL used for mobile referral links.","type":["string","null"],"maxLength":500},"androidPackageName":{"type":["string","null"],"maxLength":255,"description":"Android package name, e.g. `com.example.app` (pattern: `^[a-zA-Z][\\w]*(\\.[a-zA-Z][\\w]*)+$`)."},"androidAppStoreUrl":{"description":"Google Play Store URL used for mobile referral links.","type":["string","null"],"maxLength":500}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/installation":{"get":{"tags":["Campaigns"],"operationId":"retrieveCampaignInstallation","summary":"Retrieve campaign installation","description":"Retrieves a program's installation configuration — the same surface as the dashboard Program Editor's **Installation** tab (plus the Mobile SDK settings). Includes the referral trigger (referral programs only), signup tracking method, share URL and whitelist, custom-form signup settings, and mobile SDK settings.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Campaign installation configuration returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignInstallation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update campaign installation

> Updates a program's installation configuration. Only the fields you send are changed; omitted fields are left untouched. \`referralTrigger\` is only available for referral programs. \`mobile.publicKey\` is read-only; if no key exists yet, enabling \`mobile.isEnabled\` creates one. Changing \`shareUrl\` re-resolves its redirect destinations, which may take a moment to complete. URLs must include an explicit \`http\://\` or \`https\://\` scheme.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaigns","description":"Program retrieval, listing, creation, updates, cloning, and configuration (design, emails, options, installation, and campaign rewards)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CampaignInstallation":{"type":"object","description":"A program's installation configuration (the dashboard Program Editor's Installation tab). To see the full object with every field and its current value, `GET` this resource, then `PATCH` back only the fields you want to change. `referralTrigger` is only present and writable for referral programs.","properties":{"referralTrigger":{"type":"string","enum":["CUSTOM","ON_SIGNUP"],"description":"Referral programs only. Sets what a referred friend must do before a referral counts. `ON_SIGNUP` (\"Sign Up\") counts the referral as soon as they sign up. `CUSTOM` (\"Sign Up + Qualifying Action\") counts it only after they sign up and also complete a qualifying action you define, such as a first payment."},"signupEvent":{"type":"string","enum":["FORM_DETECTION","PROGRAMMATIC"],"description":"The signup tracking method. `FORM_DETECTION` = GrowSurf automatically detects submissions of an existing form on your site; `PROGRAMMATIC` = you add participants via the JavaScript/mobile SDKs or this API."},"shareUrl":{"type":"string","maxLength":500,"description":"The landing page referred friends are taken to when they click a participant's referral link — usually your homepage or a marketing page. Required; must include an `http(s)://` scheme and contain no `#`, `#!`, or `??`."},"useGrowSurfHostedLinks":{"type":"boolean","description":"When `true`, each participant's referral link becomes a GrowSurf-hosted link instead of a link to your own share URL, and clicks are routed by the visitor's device (Android to Google Play, iOS to your iOS attribution or App Store URL, desktop to your share URL). Mainly used by mobile apps. Applies to referral links everywhere they appear, including the SDKs, integrations, webhooks, the GrowSurf window, and participant exports."},"allowedUrls":{"type":"array","items":{"type":"string","maxLength":500},"description":"Extra domains, beyond your share URL, where the GrowSurf window and SDK are allowed to run — handy for testing on local or staging URLs. Adding an apex domain (e.g. `https://example.com`) also allows its subdomains. Each entry must include an `http(s)://` scheme. Sending this array replaces the entire list."},"signup":{"$ref":"#/components/schemas/CampaignInstallationSignup"},"mobile":{"$ref":"#/components/schemas/CampaignInstallationMobile"}}},"CampaignInstallationSignup":{"type":"object","description":"Custom signup-form settings (applies when the signup tracking method is `FORM_DETECTION`).","properties":{"isCustomForm":{"description":"Whether signups come from your own form instead of automatic form detection.","type":"boolean"},"url":{"type":["string","null"],"maxLength":500,"description":"The custom signup form URL. Must include an `http(s)://` scheme; no `#!` or `??`. Send `null` to clear."},"redirectAfterSignup":{"type":"boolean","description":"Whether the signup form redirects to another page after submission."},"redirectUrl":{"type":["string","null"],"maxLength":500,"description":"URL the signup form redirects to. Must include an `http(s)://` scheme. Send `null` to clear."},"trackInputFields":{"description":"Whether GrowSurf watches signup form fields for referral attribution.","type":"boolean"}}},"CampaignInstallationMobile":{"type":"object","description":"Settings for the GrowSurf iOS and Android mobile SDKs — enable the mobile SDK, the read-only publishable key, and the iOS/Android attribution and app-store URLs used to route mobile referral-link clicks.","properties":{"isEnabled":{"type":"boolean","description":"Whether the mobile SDK is enabled for the campaign."},"publicKey":{"type":"string","readOnly":true,"description":"The publishable mobile SDK key used by the GrowSurf iOS and Android SDKs. Read-only."},"iosAttributionUrl":{"type":["string","null"],"maxLength":500,"description":"iOS attribution URL. Must include an `http(s)://` scheme; no `#!` or `??`. Send `null` to clear."},"iosAppStoreUrl":{"description":"iOS App Store URL used for mobile referral links.","type":["string","null"],"maxLength":500},"androidPackageName":{"type":["string","null"],"maxLength":255,"description":"Android package name, e.g. `com.example.app` (pattern: `^[a-zA-Z][\\w]*(\\.[a-zA-Z][\\w]*)+$`)."},"androidAppStoreUrl":{"description":"Google Play Store URL used for mobile referral links.","type":["string","null"],"maxLength":500}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/installation":{"patch":{"tags":["Campaigns"],"operationId":"updateCampaignInstallation","summary":"Update campaign installation","description":"Updates a program's installation configuration. Only the fields you send are changed; omitted fields are left untouched. `referralTrigger` is only available for referral programs. `mobile.publicKey` is read-only; if no key exists yet, enabling `mobile.isEnabled` creates one. Changing `shareUrl` re-resolves its redirect destinations, which may take a moment to complete. URLs must include an explicit `http://` or `https://` scheme.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignInstallation"}}}},"responses":{"200":{"description":"Campaign installation configuration updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignInstallation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## CAMPAIGN WEBHOOKS ↓

{% hint style="info" %}
Manage a program's webhooks — the HTTP endpoints GrowSurf calls when program events occur. `secret` is write-only (used to sign the `GrowSurf-Signature` HMAC header, and never returned), each webhook has a persistent `id` (the program's default webhook is `primary`), and `events` is the array of event types the webhook is subscribed to. Use the test endpoint to send a live sample event to a saved webhook using its stored URL and secret.
{% endhint %}

## List webhooks

> Lists a program's webhooks (secrets are never returned).

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaign Webhooks","description":"Program webhook configuration (create, update, delete, and test webhooks)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"WebhookListResponse":{"type":"object","required":["webhooks"],"properties":{"webhooks":{"description":"Webhooks configured for the program.","type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}},"Webhook":{"type":"object","description":"A program webhook's configuration (payload URL, subscribed events, enabled state) plus read-only delivery-health fields.","required":["id","events","isEnabled","autoDisabledDueToFailures","failureCount"],"properties":{"id":{"type":"string","readOnly":true,"description":"The webhook id (`primary` for the program's primary webhook)."},"payloadUrl":{"type":"string","nullable":true,"description":"The URL that receives webhook deliveries."},"events":{"description":"Webhook events this endpoint is subscribed to.","type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"isEnabled":{"description":"Whether deliveries to this webhook are enabled.","type":"boolean"},"autoDisabledDueToFailures":{"type":"boolean","readOnly":true,"description":"Read-only. Whether GrowSurf auto-disabled this webhook after repeated delivery failures."},"failureCount":{"type":"integer","readOnly":true,"description":"Read-only. Consecutive delivery failures."},"lastFailureAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"description":"Read-only. When the last delivery failure occurred, as a Unix timestamp in milliseconds."}}},"WebhookEvent":{"type":"string","description":"A webhook event name (the events GrowSurf delivers to subscribed webhooks).","enum":["PARTICIPANT_REACHED_A_GOAL","NEW_PARTICIPANT_ADDED","CAMPAIGN_ENDED","PARTICIPANT_FRAUD_STATUS_UPDATED","NEW_COMMISSION_ADDED","COMMISSION_ADJUSTED","NEW_PAYOUT_ISSUED"]},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/webhooks":{"get":{"tags":["Campaign Webhooks"],"operationId":"listWebhooks","summary":"List webhooks","description":"Lists a program's webhooks (secrets are never returned).","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Webhooks returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListResponse"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Create webhook

> Adds a webhook to the program.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaign Webhooks","description":"Program webhook configuration (create, update, delete, and test webhooks)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CreateWebhookRequest":{"type":"object","required":["payloadUrl"],"additionalProperties":false,"properties":{"payloadUrl":{"type":"string","description":"The URL that receives webhook deliveries."},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"},"default":[],"description":"The events this webhook is subscribed to. When omitted, the webhook is created subscribed to no events."},"secret":{"type":"string","writeOnly":true,"description":"Write-only. Used to sign deliveries (the `GrowSurf-Signature` HMAC header). Never returned."},"isEnabled":{"description":"Whether the webhook should start enabled. Defaults to `true`.","type":"boolean","default":true}}},"WebhookEvent":{"type":"string","description":"A webhook event name (the events GrowSurf delivers to subscribed webhooks).","enum":["PARTICIPANT_REACHED_A_GOAL","NEW_PARTICIPANT_ADDED","CAMPAIGN_ENDED","PARTICIPANT_FRAUD_STATUS_UPDATED","NEW_COMMISSION_ADDED","COMMISSION_ADJUSTED","NEW_PAYOUT_ISSUED"]},"Webhook":{"type":"object","description":"A program webhook's configuration (payload URL, subscribed events, enabled state) plus read-only delivery-health fields.","required":["id","events","isEnabled","autoDisabledDueToFailures","failureCount"],"properties":{"id":{"type":"string","readOnly":true,"description":"The webhook id (`primary` for the program's primary webhook)."},"payloadUrl":{"type":"string","nullable":true,"description":"The URL that receives webhook deliveries."},"events":{"description":"Webhook events this endpoint is subscribed to.","type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"isEnabled":{"description":"Whether deliveries to this webhook are enabled.","type":"boolean"},"autoDisabledDueToFailures":{"type":"boolean","readOnly":true,"description":"Read-only. Whether GrowSurf auto-disabled this webhook after repeated delivery failures."},"failureCount":{"type":"integer","readOnly":true,"description":"Read-only. Consecutive delivery failures."},"lastFailureAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"description":"Read-only. When the last delivery failure occurred, as a Unix timestamp in milliseconds."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/webhooks":{"post":{"tags":["Campaign Webhooks"],"operationId":"createWebhook","summary":"Create webhook","description":"Adds a webhook to the program.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"200":{"description":"Webhook created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update webhook

> Updates a webhook by id.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaign Webhooks","description":"Program webhook configuration (create, update, delete, and test webhooks)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"WebhookId":{"name":"webhookId","in":"path","required":true,"description":"Webhook ID (`primary` for the program's primary webhook, or the id of an additional webhook).","schema":{"type":"string"}}},"schemas":{"UpdateWebhookRequest":{"type":"object","additionalProperties":false,"properties":{"payloadUrl":{"description":"New URL that receives webhook deliveries.","type":"string"},"events":{"description":"Replacement event subscription list for this webhook.","type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"secret":{"type":"string","writeOnly":true,"description":"Write-only."},"isEnabled":{"description":"Whether deliveries to this webhook are enabled.","type":"boolean"}}},"WebhookEvent":{"type":"string","description":"A webhook event name (the events GrowSurf delivers to subscribed webhooks).","enum":["PARTICIPANT_REACHED_A_GOAL","NEW_PARTICIPANT_ADDED","CAMPAIGN_ENDED","PARTICIPANT_FRAUD_STATUS_UPDATED","NEW_COMMISSION_ADDED","COMMISSION_ADJUSTED","NEW_PAYOUT_ISSUED"]},"Webhook":{"type":"object","description":"A program webhook's configuration (payload URL, subscribed events, enabled state) plus read-only delivery-health fields.","required":["id","events","isEnabled","autoDisabledDueToFailures","failureCount"],"properties":{"id":{"type":"string","readOnly":true,"description":"The webhook id (`primary` for the program's primary webhook)."},"payloadUrl":{"type":"string","nullable":true,"description":"The URL that receives webhook deliveries."},"events":{"description":"Webhook events this endpoint is subscribed to.","type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"isEnabled":{"description":"Whether deliveries to this webhook are enabled.","type":"boolean"},"autoDisabledDueToFailures":{"type":"boolean","readOnly":true,"description":"Read-only. Whether GrowSurf auto-disabled this webhook after repeated delivery failures."},"failureCount":{"type":"integer","readOnly":true,"description":"Read-only. Consecutive delivery failures."},"lastFailureAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"description":"Read-only. When the last delivery failure occurred, as a Unix timestamp in milliseconds."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/webhooks/{webhookId}":{"patch":{"tags":["Campaign Webhooks"],"operationId":"updateWebhook","summary":"Update webhook","description":"Updates a webhook by id.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/WebhookId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"}}}},"responses":{"200":{"description":"Webhook updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Delete webhook

> Removes a webhook by id.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaign Webhooks","description":"Program webhook configuration (create, update, delete, and test webhooks)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"WebhookId":{"name":"webhookId","in":"path","required":true,"description":"Webhook ID (`primary` for the program's primary webhook, or the id of an additional webhook).","schema":{"type":"string"}}},"schemas":{"DeleteWebhookResponse":{"type":"object","required":["id","success"],"properties":{"id":{"description":"ID of the webhook that was deleted.","type":"string"},"success":{"description":"Whether the webhook was deleted.","type":"boolean"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/webhooks/{webhookId}":{"delete":{"tags":["Campaign Webhooks"],"operationId":"deleteWebhook","summary":"Delete webhook","description":"Removes a webhook by id.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/WebhookId"}],"responses":{"200":{"description":"Webhook deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteWebhookResponse"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Test webhook

> Sends a live test event to a webhook using its stored URL and secret.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Campaign Webhooks","description":"Program webhook configuration (create, update, delete, and test webhooks)."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"WebhookId":{"name":"webhookId","in":"path","required":true,"description":"Webhook ID (`primary` for the program's primary webhook, or the id of an additional webhook).","schema":{"type":"string"}}},"schemas":{"WebhookTestRequest":{"type":"object","additionalProperties":false,"properties":{"event":{"$ref":"#/components/schemas/WebhookEvent","description":"The event to simulate. When omitted, the webhook's first enabled event is used, and the request returns `400` if the webhook has no enabled events."}}},"WebhookEvent":{"type":"string","description":"A webhook event name (the events GrowSurf delivers to subscribed webhooks).","enum":["PARTICIPANT_REACHED_A_GOAL","NEW_PARTICIPANT_ADDED","CAMPAIGN_ENDED","PARTICIPANT_FRAUD_STATUS_UPDATED","NEW_COMMISSION_ADDED","COMMISSION_ADJUSTED","NEW_PAYOUT_ISSUED"]},"WebhookTestResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether the test webhook request completed.","type":"boolean"},"payload":{"type":"object","additionalProperties":true,"description":"The mock event payload that was sent."},"response":{"description":"Response returned by the webhook endpoint during the test.","type":"object","properties":{"msg":{"description":"Response message returned by the webhook endpoint.","type":"string"},"statusCode":{"description":"HTTP status code returned by the webhook endpoint.","type":"integer"}}}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/webhooks/{webhookId}/test":{"post":{"tags":["Campaign Webhooks"],"operationId":"testWebhook","summary":"Test webhook","description":"Sends a live test event to a webhook using its stored URL and secret.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/WebhookId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestRequest"}}}},"responses":{"200":{"description":"Test result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## PARTICIPANTS ↓

## List participants

> Retrieves a paged list of participants in a program.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}},"schemas":{"ParticipantListResponse":{"type":"object","required":["participants","limit","nextId"],"properties":{"participants":{"description":"Participants returned for this page.","type":"array","items":{"$ref":"#/components/schemas/Participant"}},"limit":{"description":"Maximum number of participants requested for this page.","type":"integer"},"nextId":{"description":"Participant ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]}}},"Participant":{"type":"object","description":"Detailed information about a program participant.","required":["id","referralCount","monthlyReferralCount","rank","monthlyRank","shareUrl","rewards","email"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant."},"firstName":{"type":["string","null"],"description":"The first name of the participant."},"lastName":{"type":["string","null"],"description":"The last name of the participant."},"email":{"type":"string","description":"The email of the participant."},"paypalEmailAddress":{"type":"string","format":"email","description":"The PayPal email address on file for the participant, used for affiliate or PayPal reward payouts."},"referralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made by the participant."},"monthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made this month by the participant (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made the previous month by the participant."},"rank":{"type":"integer","readOnly":true,"description":"The rank of the participant."},"monthlyRank":{"type":"integer","readOnly":true,"description":"The monthly rank of the participant. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","readOnly":true,"description":"The previous monthly rank of the participant. Not returned if the participant did not exist in your program during the previous month."},"shareUrl":{"type":"string","readOnly":true,"description":"The unique share URL of the participant."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"The date the participant was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","readOnly":true,"description":"The source of how the participant joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the participant was referred, the referrer's status in receiving the referral credit. Only applicable if the participant was referred into the program."},"referredBy":{"type":"string","description":"The ID of the referrer. Only applicable if the participant was referred into the program."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","readOnly":true,"description":"A value that represents the integrity of the participant."},"fraudReasonCode":{"type":"string","readOnly":true,"description":"The reason for the participant's `fraudRiskLevel`:\n\n- `UNIQUE_IDENTITY` — They have a unique identity (no other participant has the same identity).\n- `DUPLICATE_EMAIL` — Their email is not unique and is identical to another participant's email (e.g., gavin@hooli.com = gavin+1@hooli.com).\n- `DUPLICATE_IDENTITY` — Their identity (fingerprint or mobile instance ID) is not unique and matches another participant's.\n- `DUPLICATE_IDENTITY_EXCESSIVE` — Within a small window of time, they had an excessive number of referred participants who also shared the same IP address.\n- `EMAIL_FRAUD` — Their email was found to match another participant's when updated in a connected billing or payment integration.\n- `SIMILAR_EMAIL` — Their browser fingerprint matches another participant's and their email looks suspiciously similar.\n- `SIMILAR_FIRST_NAME` — Their browser fingerprint matches another participant's and their first name looks suspiciously similar.\n- `SIMILAR_LAST_NAME` — Their browser fingerprint matches another participant's and their last name looks suspiciously similar.\n- `REFERRAL_EMAIL_PATTERN` — (Status for a referred person) Their email matched a similar pattern to their referrer's email.\n- `REFERRAL_CHAIN_FRAUD` — (Status for a referrer or referred person) Their characteristics matched a pattern with other referrals the referrer made, indicating a fraud ring.\n- `REFERRAL_VELOCITY_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals in a short period of time.\n- `DOMAIN_CLUSTERING_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals sharing the same suspicious domain in a short period of time.\n- `MANUAL_UPDATE` — They were manually marked as a fraudster from the GrowSurf dashboard.\n- `WHITELISTED` — They were allowed to join the program because one of their properties matched an allowed value.\n- `BLACKLIST_MATCH` — They were not allowed to join the program because one of their properties matched a blocked value.\n- `BLOCKED_IP` — They were not allowed to join the program because their IP address was recently blocked by antifraud IP throttling.\n- `REFERRER_HIGH_RISK` — They were not allowed to join the program because their referrer was a high-risk fraudster."},"isWinner":{"type":"boolean","readOnly":true,"description":"`true` if the participant has earned one or more rewards."},"shareCount":{"type":"object","readOnly":true,"additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the participant has shared their referral link, keyed by channel. Standard web channels include `email`, `facebook`, and `twitter`; SDK/native-share channels include `iosNativeShare` and `androidNativeShare`."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions the participant has made."},"uniqueImpressionCount":{"type":"integer","readOnly":true,"description":"The total number of unique impressions the participant has made."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites the participant has sent."},"referrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the participant. Limited to the 100 most recently referred friends."},"monthlyReferrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the participant this month (resets at the end of the month). Limited to the 100 most recent."},"referrer":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/ParticipantReferrer"},{"type":"null"}],"description":"An object containing the participant's referrer information. Only applicable if the participant was referred into the program."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the participant, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the participant, used for anti-fraud matching."},"mobileInstanceId":{"type":["string","null"],"description":"App-install scoped mobile identifier used for anti-fraud matching when provided by native mobile apps. The official mobile SDKs generate this as a lowercase UUID. Not stored when strict GDPR/CCPA mode is enabled."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data, useful for saving additional data for the participant (e.g., `company`, `companySize`). Metadata is never used by GrowSurf and usage is optional. Metadata is returned only in REST API calls, and never in JavaScript Web API calls. See [API Guidelines](https://docs.growsurf.com/developer-tools/rest-api/api-guidelines)."},"notes":{"type":["string","null"],"description":"Internal notes about the participant, added via the [GrowSurf Dashboard](https://growsurf.com/dashboard)."},"unsubscribed":{"type":"boolean","description":"`true` if the participant has unsubscribed from program emails."},"rewards":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/ParticipantReward"},"description":"A list of the rewards the participant has earned."},"vanityKeys":{"type":"array","items":{"type":"string"},"description":"The list of vanity keys that the participant has."},"unreadCommissionsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of commissions the participant has not yet viewed."},"unreadPayoutsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of payouts the participant has not yet viewed."},"isNew":{"type":"boolean","readOnly":true,"description":"Whether this participant was newly created by the request. Returned by participant creation calls; `false` when the participant already existed."},"allMatchingFraudsters":{"type":"array","readOnly":true,"items":{"type":"object","additionalProperties":true},"description":"A list of other participants flagged as matching this participant during anti-fraud checks."},"payoutSettings":{"type":"object","readOnly":true,"description":"Payout-related actions the participant must complete before a payout can be released (e.g. confirming a PayPal email or submitting a W-9/W-8 tax form). Always present; the requiredActions array is empty when no action is required.","properties":{"requiredActions":{"description":"Actions the participant must complete before payouts can be sent.","type":"array","readOnly":true,"items":{"type":"string","enum":["PAYPAL_EMAIL","TAX_INFO"]}}}}}},"ReferralSource":{"type":"string","enum":["DIRECT","PARTICIPANT"]},"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"FraudRiskLevel":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"ParticipantReferrer":{"type":"object","description":"Summary information about a participant's referrer, returned within the `referrer` field of a `Participant`.","properties":{"id":{"type":"string","description":"The unique identifier of the referrer."},"firstName":{"type":["string","null"],"description":"The first name of the referrer."},"lastName":{"type":["string","null"],"description":"The last name of the referrer."},"email":{"type":"string","description":"The email of the referrer."},"referralCount":{"type":"integer","description":"The total number of referrals made by the referrer."},"monthlyReferralCount":{"type":"integer","description":"The total number of referrals made this month by the referrer (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","description":"The total number of referrals made the previous month by the referrer."},"rank":{"type":"integer","description":"The rank of the referrer."},"monthlyRank":{"type":"integer","description":"The monthly rank of the referrer. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","description":"The previous monthly rank of the referrer."},"shareUrl":{"type":"string","description":"The unique share URL of the referrer."},"createdAt":{"type":"integer","format":"int64","description":"The date the referrer was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","description":"The source of how the referrer joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the referrer was themselves referred, their referrer's status in receiving the referral credit."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","description":"A value that represents the integrity of the referrer."},"fraudReasonCode":{"type":"string","description":"The reason for the referrer's `fraudRiskLevel`. See `Participant.fraudReasonCode` for the list of possible values."},"isWinner":{"type":"boolean","description":"`true` if the referrer has earned one or more rewards."},"shareCount":{"type":"object","additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the referrer has shared their referral link, keyed by channel."},"impressionCount":{"type":"integer","description":"The total number of impressions the referrer has made."},"uniqueImpressionCount":{"type":"integer","description":"The total number of unique impressions the referrer has made."},"inviteCount":{"type":"integer","description":"The total number of invites the referrer has sent."},"referrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the referrer. Limited to the 100 most recent."},"monthlyReferrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the referrer this month (resets at the end of the month). Limited to the 100 most recent."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the referrer, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the referrer, used for anti-fraud matching."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data for the referrer."},"unsubscribed":{"type":"boolean","description":"`true` if the referrer has unsubscribed from program emails."}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"ParticipantReward":{"type":"object","description":"A reward that a participant has earned. This is different from a program `Reward` Object and contains information pertinent only to the participant that earned the reward.","required":["id","rewardId","status"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant's reward. This is different for every new reward the participant earns."},"rewardId":{"type":"string","readOnly":true,"description":"The ID of the program `Reward` (`CampaignReward`) that this participant has earned."},"status":{"$ref":"#/components/schemas/RewardStatus","readOnly":true,"description":"The status of the participant's reward."},"unread":{"type":"boolean","readOnly":true,"description":"`true` if the participant has not yet seen the reward in a GrowSurf window."},"approved":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been approved."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was approved for this participant (UTC milliseconds). `null` for unapproved rewards."},"fulfilledAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was fulfilled for this participant (UTC milliseconds). `null` for unapproved or unfulfilled rewards."},"isReferrer":{"type":"boolean","readOnly":true,"description":"`true` if the participant earned the reward as the referrer; `false` if they earned it as the referred friend (only applicable for double-sided reward types)."},"isAvailable":{"type":"boolean","readOnly":true,"description":"`true` if the reward is available for the participant to claim or redeem."},"isFulfilled":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been fulfilled."},"referredId":{"type":"string","readOnly":true,"description":"The ID of the friend that was referred."},"referrerId":{"type":"string","readOnly":true,"description":"The ID of the participant that made the referral."},"commissionStructure":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The commission structure associated with this reward. Present only for affiliate programs."}}},"RewardStatus":{"type":"string","enum":["PENDING","FULFILLED"]},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participants":{"get":{"tags":["Participants"],"operationId":"listParticipants","summary":"List participants","description":"Retrieves a paged list of participants in a program.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/NextId"},{"$ref":"#/components/parameters/Limit100"}],"responses":{"200":{"description":"Participants returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## List leaderboard participants

> Retrieves participants in leaderboard order for the specified leaderboard type.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}},"schemas":{"LeaderboardType":{"type":"string","enum":["ALL_TIME","CURRENT_MONTH","PREV_MONTH","TOTAL_IMPRESSION_COUNT","UNIQUE_IMPRESSION_COUNT","BY_COMMISSIONS","BY_REVENUE","BY_REFERRALS","BY_LEADS"],"default":"ALL_TIME"},"ParticipantListResponse":{"type":"object","required":["participants","limit","nextId"],"properties":{"participants":{"description":"Participants returned for this page.","type":"array","items":{"$ref":"#/components/schemas/Participant"}},"limit":{"description":"Maximum number of participants requested for this page.","type":"integer"},"nextId":{"description":"Participant ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]}}},"Participant":{"type":"object","description":"Detailed information about a program participant.","required":["id","referralCount","monthlyReferralCount","rank","monthlyRank","shareUrl","rewards","email"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant."},"firstName":{"type":["string","null"],"description":"The first name of the participant."},"lastName":{"type":["string","null"],"description":"The last name of the participant."},"email":{"type":"string","description":"The email of the participant."},"paypalEmailAddress":{"type":"string","format":"email","description":"The PayPal email address on file for the participant, used for affiliate or PayPal reward payouts."},"referralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made by the participant."},"monthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made this month by the participant (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made the previous month by the participant."},"rank":{"type":"integer","readOnly":true,"description":"The rank of the participant."},"monthlyRank":{"type":"integer","readOnly":true,"description":"The monthly rank of the participant. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","readOnly":true,"description":"The previous monthly rank of the participant. Not returned if the participant did not exist in your program during the previous month."},"shareUrl":{"type":"string","readOnly":true,"description":"The unique share URL of the participant."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"The date the participant was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","readOnly":true,"description":"The source of how the participant joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the participant was referred, the referrer's status in receiving the referral credit. Only applicable if the participant was referred into the program."},"referredBy":{"type":"string","description":"The ID of the referrer. Only applicable if the participant was referred into the program."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","readOnly":true,"description":"A value that represents the integrity of the participant."},"fraudReasonCode":{"type":"string","readOnly":true,"description":"The reason for the participant's `fraudRiskLevel`:\n\n- `UNIQUE_IDENTITY` — They have a unique identity (no other participant has the same identity).\n- `DUPLICATE_EMAIL` — Their email is not unique and is identical to another participant's email (e.g., gavin@hooli.com = gavin+1@hooli.com).\n- `DUPLICATE_IDENTITY` — Their identity (fingerprint or mobile instance ID) is not unique and matches another participant's.\n- `DUPLICATE_IDENTITY_EXCESSIVE` — Within a small window of time, they had an excessive number of referred participants who also shared the same IP address.\n- `EMAIL_FRAUD` — Their email was found to match another participant's when updated in a connected billing or payment integration.\n- `SIMILAR_EMAIL` — Their browser fingerprint matches another participant's and their email looks suspiciously similar.\n- `SIMILAR_FIRST_NAME` — Their browser fingerprint matches another participant's and their first name looks suspiciously similar.\n- `SIMILAR_LAST_NAME` — Their browser fingerprint matches another participant's and their last name looks suspiciously similar.\n- `REFERRAL_EMAIL_PATTERN` — (Status for a referred person) Their email matched a similar pattern to their referrer's email.\n- `REFERRAL_CHAIN_FRAUD` — (Status for a referrer or referred person) Their characteristics matched a pattern with other referrals the referrer made, indicating a fraud ring.\n- `REFERRAL_VELOCITY_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals in a short period of time.\n- `DOMAIN_CLUSTERING_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals sharing the same suspicious domain in a short period of time.\n- `MANUAL_UPDATE` — They were manually marked as a fraudster from the GrowSurf dashboard.\n- `WHITELISTED` — They were allowed to join the program because one of their properties matched an allowed value.\n- `BLACKLIST_MATCH` — They were not allowed to join the program because one of their properties matched a blocked value.\n- `BLOCKED_IP` — They were not allowed to join the program because their IP address was recently blocked by antifraud IP throttling.\n- `REFERRER_HIGH_RISK` — They were not allowed to join the program because their referrer was a high-risk fraudster."},"isWinner":{"type":"boolean","readOnly":true,"description":"`true` if the participant has earned one or more rewards."},"shareCount":{"type":"object","readOnly":true,"additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the participant has shared their referral link, keyed by channel. Standard web channels include `email`, `facebook`, and `twitter`; SDK/native-share channels include `iosNativeShare` and `androidNativeShare`."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions the participant has made."},"uniqueImpressionCount":{"type":"integer","readOnly":true,"description":"The total number of unique impressions the participant has made."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites the participant has sent."},"referrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the participant. Limited to the 100 most recently referred friends."},"monthlyReferrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the participant this month (resets at the end of the month). Limited to the 100 most recent."},"referrer":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/ParticipantReferrer"},{"type":"null"}],"description":"An object containing the participant's referrer information. Only applicable if the participant was referred into the program."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the participant, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the participant, used for anti-fraud matching."},"mobileInstanceId":{"type":["string","null"],"description":"App-install scoped mobile identifier used for anti-fraud matching when provided by native mobile apps. The official mobile SDKs generate this as a lowercase UUID. Not stored when strict GDPR/CCPA mode is enabled."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data, useful for saving additional data for the participant (e.g., `company`, `companySize`). Metadata is never used by GrowSurf and usage is optional. Metadata is returned only in REST API calls, and never in JavaScript Web API calls. See [API Guidelines](https://docs.growsurf.com/developer-tools/rest-api/api-guidelines)."},"notes":{"type":["string","null"],"description":"Internal notes about the participant, added via the [GrowSurf Dashboard](https://growsurf.com/dashboard)."},"unsubscribed":{"type":"boolean","description":"`true` if the participant has unsubscribed from program emails."},"rewards":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/ParticipantReward"},"description":"A list of the rewards the participant has earned."},"vanityKeys":{"type":"array","items":{"type":"string"},"description":"The list of vanity keys that the participant has."},"unreadCommissionsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of commissions the participant has not yet viewed."},"unreadPayoutsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of payouts the participant has not yet viewed."},"isNew":{"type":"boolean","readOnly":true,"description":"Whether this participant was newly created by the request. Returned by participant creation calls; `false` when the participant already existed."},"allMatchingFraudsters":{"type":"array","readOnly":true,"items":{"type":"object","additionalProperties":true},"description":"A list of other participants flagged as matching this participant during anti-fraud checks."},"payoutSettings":{"type":"object","readOnly":true,"description":"Payout-related actions the participant must complete before a payout can be released (e.g. confirming a PayPal email or submitting a W-9/W-8 tax form). Always present; the requiredActions array is empty when no action is required.","properties":{"requiredActions":{"description":"Actions the participant must complete before payouts can be sent.","type":"array","readOnly":true,"items":{"type":"string","enum":["PAYPAL_EMAIL","TAX_INFO"]}}}}}},"ReferralSource":{"type":"string","enum":["DIRECT","PARTICIPANT"]},"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"FraudRiskLevel":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"ParticipantReferrer":{"type":"object","description":"Summary information about a participant's referrer, returned within the `referrer` field of a `Participant`.","properties":{"id":{"type":"string","description":"The unique identifier of the referrer."},"firstName":{"type":["string","null"],"description":"The first name of the referrer."},"lastName":{"type":["string","null"],"description":"The last name of the referrer."},"email":{"type":"string","description":"The email of the referrer."},"referralCount":{"type":"integer","description":"The total number of referrals made by the referrer."},"monthlyReferralCount":{"type":"integer","description":"The total number of referrals made this month by the referrer (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","description":"The total number of referrals made the previous month by the referrer."},"rank":{"type":"integer","description":"The rank of the referrer."},"monthlyRank":{"type":"integer","description":"The monthly rank of the referrer. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","description":"The previous monthly rank of the referrer."},"shareUrl":{"type":"string","description":"The unique share URL of the referrer."},"createdAt":{"type":"integer","format":"int64","description":"The date the referrer was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","description":"The source of how the referrer joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the referrer was themselves referred, their referrer's status in receiving the referral credit."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","description":"A value that represents the integrity of the referrer."},"fraudReasonCode":{"type":"string","description":"The reason for the referrer's `fraudRiskLevel`. See `Participant.fraudReasonCode` for the list of possible values."},"isWinner":{"type":"boolean","description":"`true` if the referrer has earned one or more rewards."},"shareCount":{"type":"object","additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the referrer has shared their referral link, keyed by channel."},"impressionCount":{"type":"integer","description":"The total number of impressions the referrer has made."},"uniqueImpressionCount":{"type":"integer","description":"The total number of unique impressions the referrer has made."},"inviteCount":{"type":"integer","description":"The total number of invites the referrer has sent."},"referrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the referrer. Limited to the 100 most recent."},"monthlyReferrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the referrer this month (resets at the end of the month). Limited to the 100 most recent."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the referrer, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the referrer, used for anti-fraud matching."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data for the referrer."},"unsubscribed":{"type":"boolean","description":"`true` if the referrer has unsubscribed from program emails."}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"ParticipantReward":{"type":"object","description":"A reward that a participant has earned. This is different from a program `Reward` Object and contains information pertinent only to the participant that earned the reward.","required":["id","rewardId","status"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant's reward. This is different for every new reward the participant earns."},"rewardId":{"type":"string","readOnly":true,"description":"The ID of the program `Reward` (`CampaignReward`) that this participant has earned."},"status":{"$ref":"#/components/schemas/RewardStatus","readOnly":true,"description":"The status of the participant's reward."},"unread":{"type":"boolean","readOnly":true,"description":"`true` if the participant has not yet seen the reward in a GrowSurf window."},"approved":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been approved."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was approved for this participant (UTC milliseconds). `null` for unapproved rewards."},"fulfilledAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was fulfilled for this participant (UTC milliseconds). `null` for unapproved or unfulfilled rewards."},"isReferrer":{"type":"boolean","readOnly":true,"description":"`true` if the participant earned the reward as the referrer; `false` if they earned it as the referred friend (only applicable for double-sided reward types)."},"isAvailable":{"type":"boolean","readOnly":true,"description":"`true` if the reward is available for the participant to claim or redeem."},"isFulfilled":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been fulfilled."},"referredId":{"type":"string","readOnly":true,"description":"The ID of the friend that was referred."},"referrerId":{"type":"string","readOnly":true,"description":"The ID of the participant that made the referral."},"commissionStructure":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The commission structure associated with this reward. Present only for affiliate programs."}}},"RewardStatus":{"type":"string","enum":["PENDING","FULFILLED"]},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/leaderboard":{"get":{"tags":["Participants"],"operationId":"listLeaderboard","summary":"List leaderboard participants","description":"Retrieves participants in leaderboard order for the specified leaderboard type.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/NextId"},{"$ref":"#/components/parameters/Limit100"},{"name":"isMonthly","in":"query","deprecated":true,"description":"Deprecated. Use `leaderboardType=CURRENT_MONTH` instead.","schema":{"type":"boolean","default":false}},{"name":"leaderboardType","in":"query","description":"Leaderboard ordering mode.","schema":{"$ref":"#/components/schemas/LeaderboardType"}}],"responses":{"200":{"description":"Leaderboard participants returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Add participant

> Adds a new participant to the program. If the email already exists, the existing participant is returned.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CreateParticipantRequest":{"type":"object","required":["email"],"properties":{"email":{"description":"Participant email address.","type":"string","format":"email"},"referredBy":{"type":"string","description":"Referrer participant ID or email address.","maxLength":100},"referralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED"],"description":"The referral credit status, only meaningful when `referredBy` resolves to a referrer. When omitted, it is derived from the program's referral trigger: `CREDIT_AWARDED`, `CREDIT_PENDING` (manual or custom trigger), or `CREDIT_EXPIRED` (past the credit window). Left unset when no referrer resolves."},"firstName":{"description":"Participant first name.","type":"string","maxLength":255},"lastName":{"description":"Participant last name.","type":"string","maxLength":255},"ipAddress":{"description":"Participant IP address, used for fraud checks when provided.","type":"string"},"fingerprint":{"description":"Browser fingerprint, used for fraud checks when provided.","type":"string"},"mobileInstanceId":{"type":"string","description":"Optional app-install scoped identifier for native mobile anti-fraud. Recommended for mobile participant creation and mobile participant token flows. The official mobile SDKs generate this as a lowercase UUID."},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"Participant":{"type":"object","description":"Detailed information about a program participant.","required":["id","referralCount","monthlyReferralCount","rank","monthlyRank","shareUrl","rewards","email"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant."},"firstName":{"type":["string","null"],"description":"The first name of the participant."},"lastName":{"type":["string","null"],"description":"The last name of the participant."},"email":{"type":"string","description":"The email of the participant."},"paypalEmailAddress":{"type":"string","format":"email","description":"The PayPal email address on file for the participant, used for affiliate or PayPal reward payouts."},"referralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made by the participant."},"monthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made this month by the participant (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made the previous month by the participant."},"rank":{"type":"integer","readOnly":true,"description":"The rank of the participant."},"monthlyRank":{"type":"integer","readOnly":true,"description":"The monthly rank of the participant. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","readOnly":true,"description":"The previous monthly rank of the participant. Not returned if the participant did not exist in your program during the previous month."},"shareUrl":{"type":"string","readOnly":true,"description":"The unique share URL of the participant."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"The date the participant was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","readOnly":true,"description":"The source of how the participant joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the participant was referred, the referrer's status in receiving the referral credit. Only applicable if the participant was referred into the program."},"referredBy":{"type":"string","description":"The ID of the referrer. Only applicable if the participant was referred into the program."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","readOnly":true,"description":"A value that represents the integrity of the participant."},"fraudReasonCode":{"type":"string","readOnly":true,"description":"The reason for the participant's `fraudRiskLevel`:\n\n- `UNIQUE_IDENTITY` — They have a unique identity (no other participant has the same identity).\n- `DUPLICATE_EMAIL` — Their email is not unique and is identical to another participant's email (e.g., gavin@hooli.com = gavin+1@hooli.com).\n- `DUPLICATE_IDENTITY` — Their identity (fingerprint or mobile instance ID) is not unique and matches another participant's.\n- `DUPLICATE_IDENTITY_EXCESSIVE` — Within a small window of time, they had an excessive number of referred participants who also shared the same IP address.\n- `EMAIL_FRAUD` — Their email was found to match another participant's when updated in a connected billing or payment integration.\n- `SIMILAR_EMAIL` — Their browser fingerprint matches another participant's and their email looks suspiciously similar.\n- `SIMILAR_FIRST_NAME` — Their browser fingerprint matches another participant's and their first name looks suspiciously similar.\n- `SIMILAR_LAST_NAME` — Their browser fingerprint matches another participant's and their last name looks suspiciously similar.\n- `REFERRAL_EMAIL_PATTERN` — (Status for a referred person) Their email matched a similar pattern to their referrer's email.\n- `REFERRAL_CHAIN_FRAUD` — (Status for a referrer or referred person) Their characteristics matched a pattern with other referrals the referrer made, indicating a fraud ring.\n- `REFERRAL_VELOCITY_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals in a short period of time.\n- `DOMAIN_CLUSTERING_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals sharing the same suspicious domain in a short period of time.\n- `MANUAL_UPDATE` — They were manually marked as a fraudster from the GrowSurf dashboard.\n- `WHITELISTED` — They were allowed to join the program because one of their properties matched an allowed value.\n- `BLACKLIST_MATCH` — They were not allowed to join the program because one of their properties matched a blocked value.\n- `BLOCKED_IP` — They were not allowed to join the program because their IP address was recently blocked by antifraud IP throttling.\n- `REFERRER_HIGH_RISK` — They were not allowed to join the program because their referrer was a high-risk fraudster."},"isWinner":{"type":"boolean","readOnly":true,"description":"`true` if the participant has earned one or more rewards."},"shareCount":{"type":"object","readOnly":true,"additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the participant has shared their referral link, keyed by channel. Standard web channels include `email`, `facebook`, and `twitter`; SDK/native-share channels include `iosNativeShare` and `androidNativeShare`."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions the participant has made."},"uniqueImpressionCount":{"type":"integer","readOnly":true,"description":"The total number of unique impressions the participant has made."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites the participant has sent."},"referrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the participant. Limited to the 100 most recently referred friends."},"monthlyReferrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the participant this month (resets at the end of the month). Limited to the 100 most recent."},"referrer":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/ParticipantReferrer"},{"type":"null"}],"description":"An object containing the participant's referrer information. Only applicable if the participant was referred into the program."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the participant, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the participant, used for anti-fraud matching."},"mobileInstanceId":{"type":["string","null"],"description":"App-install scoped mobile identifier used for anti-fraud matching when provided by native mobile apps. The official mobile SDKs generate this as a lowercase UUID. Not stored when strict GDPR/CCPA mode is enabled."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data, useful for saving additional data for the participant (e.g., `company`, `companySize`). Metadata is never used by GrowSurf and usage is optional. Metadata is returned only in REST API calls, and never in JavaScript Web API calls. See [API Guidelines](https://docs.growsurf.com/developer-tools/rest-api/api-guidelines)."},"notes":{"type":["string","null"],"description":"Internal notes about the participant, added via the [GrowSurf Dashboard](https://growsurf.com/dashboard)."},"unsubscribed":{"type":"boolean","description":"`true` if the participant has unsubscribed from program emails."},"rewards":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/ParticipantReward"},"description":"A list of the rewards the participant has earned."},"vanityKeys":{"type":"array","items":{"type":"string"},"description":"The list of vanity keys that the participant has."},"unreadCommissionsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of commissions the participant has not yet viewed."},"unreadPayoutsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of payouts the participant has not yet viewed."},"isNew":{"type":"boolean","readOnly":true,"description":"Whether this participant was newly created by the request. Returned by participant creation calls; `false` when the participant already existed."},"allMatchingFraudsters":{"type":"array","readOnly":true,"items":{"type":"object","additionalProperties":true},"description":"A list of other participants flagged as matching this participant during anti-fraud checks."},"payoutSettings":{"type":"object","readOnly":true,"description":"Payout-related actions the participant must complete before a payout can be released (e.g. confirming a PayPal email or submitting a W-9/W-8 tax form). Always present; the requiredActions array is empty when no action is required.","properties":{"requiredActions":{"description":"Actions the participant must complete before payouts can be sent.","type":"array","readOnly":true,"items":{"type":"string","enum":["PAYPAL_EMAIL","TAX_INFO"]}}}}}},"ReferralSource":{"type":"string","enum":["DIRECT","PARTICIPANT"]},"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"FraudRiskLevel":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"ParticipantReferrer":{"type":"object","description":"Summary information about a participant's referrer, returned within the `referrer` field of a `Participant`.","properties":{"id":{"type":"string","description":"The unique identifier of the referrer."},"firstName":{"type":["string","null"],"description":"The first name of the referrer."},"lastName":{"type":["string","null"],"description":"The last name of the referrer."},"email":{"type":"string","description":"The email of the referrer."},"referralCount":{"type":"integer","description":"The total number of referrals made by the referrer."},"monthlyReferralCount":{"type":"integer","description":"The total number of referrals made this month by the referrer (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","description":"The total number of referrals made the previous month by the referrer."},"rank":{"type":"integer","description":"The rank of the referrer."},"monthlyRank":{"type":"integer","description":"The monthly rank of the referrer. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","description":"The previous monthly rank of the referrer."},"shareUrl":{"type":"string","description":"The unique share URL of the referrer."},"createdAt":{"type":"integer","format":"int64","description":"The date the referrer was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","description":"The source of how the referrer joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the referrer was themselves referred, their referrer's status in receiving the referral credit."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","description":"A value that represents the integrity of the referrer."},"fraudReasonCode":{"type":"string","description":"The reason for the referrer's `fraudRiskLevel`. See `Participant.fraudReasonCode` for the list of possible values."},"isWinner":{"type":"boolean","description":"`true` if the referrer has earned one or more rewards."},"shareCount":{"type":"object","additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the referrer has shared their referral link, keyed by channel."},"impressionCount":{"type":"integer","description":"The total number of impressions the referrer has made."},"uniqueImpressionCount":{"type":"integer","description":"The total number of unique impressions the referrer has made."},"inviteCount":{"type":"integer","description":"The total number of invites the referrer has sent."},"referrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the referrer. Limited to the 100 most recent."},"monthlyReferrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the referrer this month (resets at the end of the month). Limited to the 100 most recent."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the referrer, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the referrer, used for anti-fraud matching."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data for the referrer."},"unsubscribed":{"type":"boolean","description":"`true` if the referrer has unsubscribed from program emails."}}},"ParticipantReward":{"type":"object","description":"A reward that a participant has earned. This is different from a program `Reward` Object and contains information pertinent only to the participant that earned the reward.","required":["id","rewardId","status"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant's reward. This is different for every new reward the participant earns."},"rewardId":{"type":"string","readOnly":true,"description":"The ID of the program `Reward` (`CampaignReward`) that this participant has earned."},"status":{"$ref":"#/components/schemas/RewardStatus","readOnly":true,"description":"The status of the participant's reward."},"unread":{"type":"boolean","readOnly":true,"description":"`true` if the participant has not yet seen the reward in a GrowSurf window."},"approved":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been approved."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was approved for this participant (UTC milliseconds). `null` for unapproved rewards."},"fulfilledAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was fulfilled for this participant (UTC milliseconds). `null` for unapproved or unfulfilled rewards."},"isReferrer":{"type":"boolean","readOnly":true,"description":"`true` if the participant earned the reward as the referrer; `false` if they earned it as the referred friend (only applicable for double-sided reward types)."},"isAvailable":{"type":"boolean","readOnly":true,"description":"`true` if the reward is available for the participant to claim or redeem."},"isFulfilled":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been fulfilled."},"referredId":{"type":"string","readOnly":true,"description":"The ID of the friend that was referred."},"referrerId":{"type":"string","readOnly":true,"description":"The ID of the participant that made the referral."},"commissionStructure":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The commission structure associated with this reward. Present only for affiliate programs."}}},"RewardStatus":{"type":"string","enum":["PENDING","FULFILLED"]},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}},"ParticipantBlockedError":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"fraudRiskLevel":{"description":"Fraud risk level assigned to the blocked signup.","$ref":"#/components/schemas/FraudRiskLevel"},"fraudReasonCode":{"description":"Machine-readable reason code for the fraud decision.","type":"string"},"matchedParticipantIds":{"description":"Existing participant IDs related to the fraud match.","type":"array","items":{"type":"string"}},"email":{"description":"Email address from the blocked signup attempt.","type":"string","format":"email"},"referrerId":{"description":"Referrer participant ID supplied with the blocked signup, or `null`.","type":["string","null"]},"ipAddress":{"description":"IP address supplied with the blocked signup, or `null`.","type":["string","null"]},"fingerprint":{"description":"Browser fingerprint supplied with the blocked signup, or `null`.","type":["string","null"]},"blockedAt":{"description":"When the signup was blocked.","type":"string","format":"date-time"}}}]}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Conflicting duplicate request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant":{"post":{"tags":["Participants"],"operationId":"createParticipant","summary":"Add participant","description":"Adds a new participant to the program. If the email already exists, the existing participant is returned.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateParticipantRequest"}}}},"responses":{"200":{"description":"Participant returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"description":"Participant was blocked or the endpoint is not available for this program type.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ParticipantBlockedError"},{"$ref":"#/components/schemas/Error"}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Retrieve participant

> Retrieves a single participant by GrowSurf participant ID or email address.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"Participant":{"type":"object","description":"Detailed information about a program participant.","required":["id","referralCount","monthlyReferralCount","rank","monthlyRank","shareUrl","rewards","email"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant."},"firstName":{"type":["string","null"],"description":"The first name of the participant."},"lastName":{"type":["string","null"],"description":"The last name of the participant."},"email":{"type":"string","description":"The email of the participant."},"paypalEmailAddress":{"type":"string","format":"email","description":"The PayPal email address on file for the participant, used for affiliate or PayPal reward payouts."},"referralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made by the participant."},"monthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made this month by the participant (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made the previous month by the participant."},"rank":{"type":"integer","readOnly":true,"description":"The rank of the participant."},"monthlyRank":{"type":"integer","readOnly":true,"description":"The monthly rank of the participant. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","readOnly":true,"description":"The previous monthly rank of the participant. Not returned if the participant did not exist in your program during the previous month."},"shareUrl":{"type":"string","readOnly":true,"description":"The unique share URL of the participant."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"The date the participant was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","readOnly":true,"description":"The source of how the participant joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the participant was referred, the referrer's status in receiving the referral credit. Only applicable if the participant was referred into the program."},"referredBy":{"type":"string","description":"The ID of the referrer. Only applicable if the participant was referred into the program."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","readOnly":true,"description":"A value that represents the integrity of the participant."},"fraudReasonCode":{"type":"string","readOnly":true,"description":"The reason for the participant's `fraudRiskLevel`:\n\n- `UNIQUE_IDENTITY` — They have a unique identity (no other participant has the same identity).\n- `DUPLICATE_EMAIL` — Their email is not unique and is identical to another participant's email (e.g., gavin@hooli.com = gavin+1@hooli.com).\n- `DUPLICATE_IDENTITY` — Their identity (fingerprint or mobile instance ID) is not unique and matches another participant's.\n- `DUPLICATE_IDENTITY_EXCESSIVE` — Within a small window of time, they had an excessive number of referred participants who also shared the same IP address.\n- `EMAIL_FRAUD` — Their email was found to match another participant's when updated in a connected billing or payment integration.\n- `SIMILAR_EMAIL` — Their browser fingerprint matches another participant's and their email looks suspiciously similar.\n- `SIMILAR_FIRST_NAME` — Their browser fingerprint matches another participant's and their first name looks suspiciously similar.\n- `SIMILAR_LAST_NAME` — Their browser fingerprint matches another participant's and their last name looks suspiciously similar.\n- `REFERRAL_EMAIL_PATTERN` — (Status for a referred person) Their email matched a similar pattern to their referrer's email.\n- `REFERRAL_CHAIN_FRAUD` — (Status for a referrer or referred person) Their characteristics matched a pattern with other referrals the referrer made, indicating a fraud ring.\n- `REFERRAL_VELOCITY_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals in a short period of time.\n- `DOMAIN_CLUSTERING_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals sharing the same suspicious domain in a short period of time.\n- `MANUAL_UPDATE` — They were manually marked as a fraudster from the GrowSurf dashboard.\n- `WHITELISTED` — They were allowed to join the program because one of their properties matched an allowed value.\n- `BLACKLIST_MATCH` — They were not allowed to join the program because one of their properties matched a blocked value.\n- `BLOCKED_IP` — They were not allowed to join the program because their IP address was recently blocked by antifraud IP throttling.\n- `REFERRER_HIGH_RISK` — They were not allowed to join the program because their referrer was a high-risk fraudster."},"isWinner":{"type":"boolean","readOnly":true,"description":"`true` if the participant has earned one or more rewards."},"shareCount":{"type":"object","readOnly":true,"additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the participant has shared their referral link, keyed by channel. Standard web channels include `email`, `facebook`, and `twitter`; SDK/native-share channels include `iosNativeShare` and `androidNativeShare`."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions the participant has made."},"uniqueImpressionCount":{"type":"integer","readOnly":true,"description":"The total number of unique impressions the participant has made."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites the participant has sent."},"referrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the participant. Limited to the 100 most recently referred friends."},"monthlyReferrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the participant this month (resets at the end of the month). Limited to the 100 most recent."},"referrer":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/ParticipantReferrer"},{"type":"null"}],"description":"An object containing the participant's referrer information. Only applicable if the participant was referred into the program."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the participant, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the participant, used for anti-fraud matching."},"mobileInstanceId":{"type":["string","null"],"description":"App-install scoped mobile identifier used for anti-fraud matching when provided by native mobile apps. The official mobile SDKs generate this as a lowercase UUID. Not stored when strict GDPR/CCPA mode is enabled."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data, useful for saving additional data for the participant (e.g., `company`, `companySize`). Metadata is never used by GrowSurf and usage is optional. Metadata is returned only in REST API calls, and never in JavaScript Web API calls. See [API Guidelines](https://docs.growsurf.com/developer-tools/rest-api/api-guidelines)."},"notes":{"type":["string","null"],"description":"Internal notes about the participant, added via the [GrowSurf Dashboard](https://growsurf.com/dashboard)."},"unsubscribed":{"type":"boolean","description":"`true` if the participant has unsubscribed from program emails."},"rewards":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/ParticipantReward"},"description":"A list of the rewards the participant has earned."},"vanityKeys":{"type":"array","items":{"type":"string"},"description":"The list of vanity keys that the participant has."},"unreadCommissionsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of commissions the participant has not yet viewed."},"unreadPayoutsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of payouts the participant has not yet viewed."},"isNew":{"type":"boolean","readOnly":true,"description":"Whether this participant was newly created by the request. Returned by participant creation calls; `false` when the participant already existed."},"allMatchingFraudsters":{"type":"array","readOnly":true,"items":{"type":"object","additionalProperties":true},"description":"A list of other participants flagged as matching this participant during anti-fraud checks."},"payoutSettings":{"type":"object","readOnly":true,"description":"Payout-related actions the participant must complete before a payout can be released (e.g. confirming a PayPal email or submitting a W-9/W-8 tax form). Always present; the requiredActions array is empty when no action is required.","properties":{"requiredActions":{"description":"Actions the participant must complete before payouts can be sent.","type":"array","readOnly":true,"items":{"type":"string","enum":["PAYPAL_EMAIL","TAX_INFO"]}}}}}},"ReferralSource":{"type":"string","enum":["DIRECT","PARTICIPANT"]},"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"FraudRiskLevel":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"ParticipantReferrer":{"type":"object","description":"Summary information about a participant's referrer, returned within the `referrer` field of a `Participant`.","properties":{"id":{"type":"string","description":"The unique identifier of the referrer."},"firstName":{"type":["string","null"],"description":"The first name of the referrer."},"lastName":{"type":["string","null"],"description":"The last name of the referrer."},"email":{"type":"string","description":"The email of the referrer."},"referralCount":{"type":"integer","description":"The total number of referrals made by the referrer."},"monthlyReferralCount":{"type":"integer","description":"The total number of referrals made this month by the referrer (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","description":"The total number of referrals made the previous month by the referrer."},"rank":{"type":"integer","description":"The rank of the referrer."},"monthlyRank":{"type":"integer","description":"The monthly rank of the referrer. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","description":"The previous monthly rank of the referrer."},"shareUrl":{"type":"string","description":"The unique share URL of the referrer."},"createdAt":{"type":"integer","format":"int64","description":"The date the referrer was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","description":"The source of how the referrer joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the referrer was themselves referred, their referrer's status in receiving the referral credit."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","description":"A value that represents the integrity of the referrer."},"fraudReasonCode":{"type":"string","description":"The reason for the referrer's `fraudRiskLevel`. See `Participant.fraudReasonCode` for the list of possible values."},"isWinner":{"type":"boolean","description":"`true` if the referrer has earned one or more rewards."},"shareCount":{"type":"object","additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the referrer has shared their referral link, keyed by channel."},"impressionCount":{"type":"integer","description":"The total number of impressions the referrer has made."},"uniqueImpressionCount":{"type":"integer","description":"The total number of unique impressions the referrer has made."},"inviteCount":{"type":"integer","description":"The total number of invites the referrer has sent."},"referrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the referrer. Limited to the 100 most recent."},"monthlyReferrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the referrer this month (resets at the end of the month). Limited to the 100 most recent."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the referrer, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the referrer, used for anti-fraud matching."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data for the referrer."},"unsubscribed":{"type":"boolean","description":"`true` if the referrer has unsubscribed from program emails."}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"ParticipantReward":{"type":"object","description":"A reward that a participant has earned. This is different from a program `Reward` Object and contains information pertinent only to the participant that earned the reward.","required":["id","rewardId","status"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant's reward. This is different for every new reward the participant earns."},"rewardId":{"type":"string","readOnly":true,"description":"The ID of the program `Reward` (`CampaignReward`) that this participant has earned."},"status":{"$ref":"#/components/schemas/RewardStatus","readOnly":true,"description":"The status of the participant's reward."},"unread":{"type":"boolean","readOnly":true,"description":"`true` if the participant has not yet seen the reward in a GrowSurf window."},"approved":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been approved."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was approved for this participant (UTC milliseconds). `null` for unapproved rewards."},"fulfilledAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was fulfilled for this participant (UTC milliseconds). `null` for unapproved or unfulfilled rewards."},"isReferrer":{"type":"boolean","readOnly":true,"description":"`true` if the participant earned the reward as the referrer; `false` if they earned it as the referred friend (only applicable for double-sided reward types)."},"isAvailable":{"type":"boolean","readOnly":true,"description":"`true` if the reward is available for the participant to claim or redeem."},"isFulfilled":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been fulfilled."},"referredId":{"type":"string","readOnly":true,"description":"The ID of the friend that was referred."},"referrerId":{"type":"string","readOnly":true,"description":"The ID of the participant that made the referral."},"commissionStructure":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The commission structure associated with this reward. Present only for affiliate programs."}}},"RewardStatus":{"type":"string","enum":["PENDING","FULFILLED"]},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}":{"get":{"tags":["Participants"],"operationId":"retrieveParticipant","summary":"Retrieve participant","description":"Retrieves a single participant by GrowSurf participant ID or email address.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"responses":{"200":{"description":"Participant returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Update participant

> Updates a participant by GrowSurf participant ID or email address.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"UpdateParticipantRequest":{"type":"object","description":"The participant fields you can update. Any property not listed here is rejected with a `400` (you cannot update read-only fields such as counters, `origin`, or fraud state).","additionalProperties":false,"properties":{"referredBy":{"description":"Referrer participant ID or email address to assign to this participant.","type":"string","maxLength":100},"email":{"description":"Participant email address.","type":"string","format":"email"},"firstName":{"description":"Participant first name.","type":"string","maxLength":255},"lastName":{"description":"Participant last name.","type":"string","maxLength":255},"metadata":{"$ref":"#/components/schemas/Metadata"},"referralStatus":{"description":"Referral credit status for this participant.","type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED"]},"vanityKeys":{"description":"Custom referral-code aliases for this participant. Sending this array replaces the existing aliases.","type":"array","maxItems":5,"items":{"type":"string","minLength":1,"maxLength":20,"pattern":"^[A-Za-z0-9_-]+$"}},"unsubscribed":{"description":"Whether the participant is unsubscribed from program emails.","type":"boolean"},"notes":{"type":"string","maxLength":500,"description":"Freeform internal notes about the participant (internal only, never exposed to participants)."},"paypalEmail":{"type":"string","format":"email","description":"The participant's PayPal email address, used for affiliate payouts."}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"Participant":{"type":"object","description":"Detailed information about a program participant.","required":["id","referralCount","monthlyReferralCount","rank","monthlyRank","shareUrl","rewards","email"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant."},"firstName":{"type":["string","null"],"description":"The first name of the participant."},"lastName":{"type":["string","null"],"description":"The last name of the participant."},"email":{"type":"string","description":"The email of the participant."},"paypalEmailAddress":{"type":"string","format":"email","description":"The PayPal email address on file for the participant, used for affiliate or PayPal reward payouts."},"referralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made by the participant."},"monthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made this month by the participant (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made the previous month by the participant."},"rank":{"type":"integer","readOnly":true,"description":"The rank of the participant."},"monthlyRank":{"type":"integer","readOnly":true,"description":"The monthly rank of the participant. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","readOnly":true,"description":"The previous monthly rank of the participant. Not returned if the participant did not exist in your program during the previous month."},"shareUrl":{"type":"string","readOnly":true,"description":"The unique share URL of the participant."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"The date the participant was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","readOnly":true,"description":"The source of how the participant joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the participant was referred, the referrer's status in receiving the referral credit. Only applicable if the participant was referred into the program."},"referredBy":{"type":"string","description":"The ID of the referrer. Only applicable if the participant was referred into the program."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","readOnly":true,"description":"A value that represents the integrity of the participant."},"fraudReasonCode":{"type":"string","readOnly":true,"description":"The reason for the participant's `fraudRiskLevel`:\n\n- `UNIQUE_IDENTITY` — They have a unique identity (no other participant has the same identity).\n- `DUPLICATE_EMAIL` — Their email is not unique and is identical to another participant's email (e.g., gavin@hooli.com = gavin+1@hooli.com).\n- `DUPLICATE_IDENTITY` — Their identity (fingerprint or mobile instance ID) is not unique and matches another participant's.\n- `DUPLICATE_IDENTITY_EXCESSIVE` — Within a small window of time, they had an excessive number of referred participants who also shared the same IP address.\n- `EMAIL_FRAUD` — Their email was found to match another participant's when updated in a connected billing or payment integration.\n- `SIMILAR_EMAIL` — Their browser fingerprint matches another participant's and their email looks suspiciously similar.\n- `SIMILAR_FIRST_NAME` — Their browser fingerprint matches another participant's and their first name looks suspiciously similar.\n- `SIMILAR_LAST_NAME` — Their browser fingerprint matches another participant's and their last name looks suspiciously similar.\n- `REFERRAL_EMAIL_PATTERN` — (Status for a referred person) Their email matched a similar pattern to their referrer's email.\n- `REFERRAL_CHAIN_FRAUD` — (Status for a referrer or referred person) Their characteristics matched a pattern with other referrals the referrer made, indicating a fraud ring.\n- `REFERRAL_VELOCITY_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals in a short period of time.\n- `DOMAIN_CLUSTERING_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals sharing the same suspicious domain in a short period of time.\n- `MANUAL_UPDATE` — They were manually marked as a fraudster from the GrowSurf dashboard.\n- `WHITELISTED` — They were allowed to join the program because one of their properties matched an allowed value.\n- `BLACKLIST_MATCH` — They were not allowed to join the program because one of their properties matched a blocked value.\n- `BLOCKED_IP` — They were not allowed to join the program because their IP address was recently blocked by antifraud IP throttling.\n- `REFERRER_HIGH_RISK` — They were not allowed to join the program because their referrer was a high-risk fraudster."},"isWinner":{"type":"boolean","readOnly":true,"description":"`true` if the participant has earned one or more rewards."},"shareCount":{"type":"object","readOnly":true,"additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the participant has shared their referral link, keyed by channel. Standard web channels include `email`, `facebook`, and `twitter`; SDK/native-share channels include `iosNativeShare` and `androidNativeShare`."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions the participant has made."},"uniqueImpressionCount":{"type":"integer","readOnly":true,"description":"The total number of unique impressions the participant has made."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites the participant has sent."},"referrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the participant. Limited to the 100 most recently referred friends."},"monthlyReferrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the participant this month (resets at the end of the month). Limited to the 100 most recent."},"referrer":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/ParticipantReferrer"},{"type":"null"}],"description":"An object containing the participant's referrer information. Only applicable if the participant was referred into the program."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the participant, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the participant, used for anti-fraud matching."},"mobileInstanceId":{"type":["string","null"],"description":"App-install scoped mobile identifier used for anti-fraud matching when provided by native mobile apps. The official mobile SDKs generate this as a lowercase UUID. Not stored when strict GDPR/CCPA mode is enabled."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data, useful for saving additional data for the participant (e.g., `company`, `companySize`). Metadata is never used by GrowSurf and usage is optional. Metadata is returned only in REST API calls, and never in JavaScript Web API calls. See [API Guidelines](https://docs.growsurf.com/developer-tools/rest-api/api-guidelines)."},"notes":{"type":["string","null"],"description":"Internal notes about the participant, added via the [GrowSurf Dashboard](https://growsurf.com/dashboard)."},"unsubscribed":{"type":"boolean","description":"`true` if the participant has unsubscribed from program emails."},"rewards":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/ParticipantReward"},"description":"A list of the rewards the participant has earned."},"vanityKeys":{"type":"array","items":{"type":"string"},"description":"The list of vanity keys that the participant has."},"unreadCommissionsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of commissions the participant has not yet viewed."},"unreadPayoutsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of payouts the participant has not yet viewed."},"isNew":{"type":"boolean","readOnly":true,"description":"Whether this participant was newly created by the request. Returned by participant creation calls; `false` when the participant already existed."},"allMatchingFraudsters":{"type":"array","readOnly":true,"items":{"type":"object","additionalProperties":true},"description":"A list of other participants flagged as matching this participant during anti-fraud checks."},"payoutSettings":{"type":"object","readOnly":true,"description":"Payout-related actions the participant must complete before a payout can be released (e.g. confirming a PayPal email or submitting a W-9/W-8 tax form). Always present; the requiredActions array is empty when no action is required.","properties":{"requiredActions":{"description":"Actions the participant must complete before payouts can be sent.","type":"array","readOnly":true,"items":{"type":"string","enum":["PAYPAL_EMAIL","TAX_INFO"]}}}}}},"ReferralSource":{"type":"string","enum":["DIRECT","PARTICIPANT"]},"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"FraudRiskLevel":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"ParticipantReferrer":{"type":"object","description":"Summary information about a participant's referrer, returned within the `referrer` field of a `Participant`.","properties":{"id":{"type":"string","description":"The unique identifier of the referrer."},"firstName":{"type":["string","null"],"description":"The first name of the referrer."},"lastName":{"type":["string","null"],"description":"The last name of the referrer."},"email":{"type":"string","description":"The email of the referrer."},"referralCount":{"type":"integer","description":"The total number of referrals made by the referrer."},"monthlyReferralCount":{"type":"integer","description":"The total number of referrals made this month by the referrer (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","description":"The total number of referrals made the previous month by the referrer."},"rank":{"type":"integer","description":"The rank of the referrer."},"monthlyRank":{"type":"integer","description":"The monthly rank of the referrer. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","description":"The previous monthly rank of the referrer."},"shareUrl":{"type":"string","description":"The unique share URL of the referrer."},"createdAt":{"type":"integer","format":"int64","description":"The date the referrer was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","description":"The source of how the referrer joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the referrer was themselves referred, their referrer's status in receiving the referral credit."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","description":"A value that represents the integrity of the referrer."},"fraudReasonCode":{"type":"string","description":"The reason for the referrer's `fraudRiskLevel`. See `Participant.fraudReasonCode` for the list of possible values."},"isWinner":{"type":"boolean","description":"`true` if the referrer has earned one or more rewards."},"shareCount":{"type":"object","additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the referrer has shared their referral link, keyed by channel."},"impressionCount":{"type":"integer","description":"The total number of impressions the referrer has made."},"uniqueImpressionCount":{"type":"integer","description":"The total number of unique impressions the referrer has made."},"inviteCount":{"type":"integer","description":"The total number of invites the referrer has sent."},"referrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the referrer. Limited to the 100 most recent."},"monthlyReferrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the referrer this month (resets at the end of the month). Limited to the 100 most recent."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the referrer, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the referrer, used for anti-fraud matching."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data for the referrer."},"unsubscribed":{"type":"boolean","description":"`true` if the referrer has unsubscribed from program emails."}}},"ParticipantReward":{"type":"object","description":"A reward that a participant has earned. This is different from a program `Reward` Object and contains information pertinent only to the participant that earned the reward.","required":["id","rewardId","status"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant's reward. This is different for every new reward the participant earns."},"rewardId":{"type":"string","readOnly":true,"description":"The ID of the program `Reward` (`CampaignReward`) that this participant has earned."},"status":{"$ref":"#/components/schemas/RewardStatus","readOnly":true,"description":"The status of the participant's reward."},"unread":{"type":"boolean","readOnly":true,"description":"`true` if the participant has not yet seen the reward in a GrowSurf window."},"approved":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been approved."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was approved for this participant (UTC milliseconds). `null` for unapproved rewards."},"fulfilledAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was fulfilled for this participant (UTC milliseconds). `null` for unapproved or unfulfilled rewards."},"isReferrer":{"type":"boolean","readOnly":true,"description":"`true` if the participant earned the reward as the referrer; `false` if they earned it as the referred friend (only applicable for double-sided reward types)."},"isAvailable":{"type":"boolean","readOnly":true,"description":"`true` if the reward is available for the participant to claim or redeem."},"isFulfilled":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been fulfilled."},"referredId":{"type":"string","readOnly":true,"description":"The ID of the friend that was referred."},"referrerId":{"type":"string","readOnly":true,"description":"The ID of the participant that made the referral."},"commissionStructure":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The commission structure associated with this reward. Present only for affiliate programs."}}},"RewardStatus":{"type":"string","enum":["PENDING","FULFILLED"]},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Conflicting duplicate request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}":{"post":{"tags":["Participants"],"operationId":"updateParticipant","summary":"Update participant","description":"Updates a participant by GrowSurf participant ID or email address.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateParticipantRequest"}}}},"responses":{"200":{"description":"Updated participant returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Delete participant

> Removes a participant by GrowSurf participant ID or email address.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"responses":{"Success":{"description":"Success response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"SuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether the request succeeded.","type":"boolean"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}":{"delete":{"tags":["Participants"],"operationId":"deleteParticipant","summary":"Delete participant","description":"Removes a participant by GrowSurf participant ID or email address.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"responses":{"200":{"$ref":"#/components/responses/Success"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Bulk delete participants

> Deletes a list of participants from a program in one request. Each entry in \`participants\` is a GrowSurf participant ID or an email address (mixed lists are allowed). Up to \`200\` entries per request — chunk larger lists across multiple calls. The response reports a per-row \`status\` for every submitted entry, so a \`200\` can include rows that were \`NOT\_FOUND\` or failed. Deletion is permanent and removes the participants' referrals, rewards, commissions, and payout records.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"BulkDeleteParticipantsRequest":{"type":"object","required":["participants"],"additionalProperties":false,"properties":{"participants":{"type":"array","minItems":1,"maxItems":200,"description":"GrowSurf participant IDs and/or email addresses to delete. Mixed entries are allowed.","items":{"type":"string","minLength":1}}}},"BulkDeleteParticipantsResponse":{"type":"object","required":["summary","results"],"properties":{"summary":{"description":"Counts of submitted, deleted, not-found, duplicate, and failed entries.","$ref":"#/components/schemas/BulkDeleteParticipantsSummary"},"results":{"type":"array","description":"One entry per submitted identifier, in the same order as the request.","items":{"$ref":"#/components/schemas/BulkDeleteParticipantResult"}}}},"BulkDeleteParticipantsSummary":{"type":"object","required":["total","deletedCount","notFoundCount","duplicateCount","errorCount"],"properties":{"total":{"type":"integer","description":"Number of entries submitted in this request."},"deletedCount":{"type":"integer","description":"Entries that resolved to a participant and were deleted."},"notFoundCount":{"type":"integer","description":"Entries that did not match any participant."},"duplicateCount":{"type":"integer","description":"Entries that resolved to the same participant as an earlier entry."},"errorCount":{"type":"integer","description":"Entries that failed to look up or delete."}}},"BulkDeleteParticipantResult":{"type":"object","required":["index","identifier","status"],"properties":{"index":{"type":"integer","description":"Zero-based position of this entry in the submitted `participants` array."},"identifier":{"type":"string","description":"The submitted participant ID or email address, echoed back as received."},"status":{"$ref":"#/components/schemas/BulkDeleteParticipantStatus"},"participantId":{"type":"string","description":"The resolved GrowSurf participant ID. Present when the entry resolved to a participant."},"email":{"type":"string","format":"email","description":"The resolved participant's email address. Present on `DELETED` rows."},"message":{"type":"string","description":"Human-readable detail for `NOT_FOUND`, `DUPLICATE`, and `ERROR` rows."}}},"BulkDeleteParticipantStatus":{"type":"string","enum":["DELETED","NOT_FOUND","DUPLICATE","ERROR"],"description":"Per-row outcome. `DELETED` — the participant was resolved and removed. `NOT_FOUND` — no participant matches the ID or email. `DUPLICATE` — the entry resolves to the same participant as an earlier entry in the same request. `ERROR` — the lookup or deletion failed for this row."},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participants/bulk-delete":{"post":{"tags":["Participants"],"operationId":"bulkDeleteParticipants","summary":"Bulk delete participants","description":"Deletes a list of participants from a program in one request. Each entry in `participants` is a GrowSurf participant ID or an email address (mixed lists are allowed). Up to `200` entries per request — chunk larger lists across multiple calls. The response reports a per-row `status` for every submitted entry, so a `200` can include rows that were `NOT_FOUND` or failed. Deletion is permanent and removes the participants' referrals, rewards, commissions, and payout records.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteParticipantsRequest"}}}},"responses":{"200":{"description":"Per-row outcomes returned (individual rows may still be `NOT_FOUND`, `DUPLICATE`, or `ERROR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteParticipantsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Trigger referral

> Triggers referral credit for an existing referred participant by GrowSurf participant ID or email address. Optionally pass \`delayInDays\` to hold the credit for a number of days before it is awarded (for example, to cover your own refund window). A delayed trigger can be cancelled before it is awarded with the Cancel delayed referral trigger request (DELETE on this same path).

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"TriggerReferralRequest":{"type":"object","description":"Optional body for a referral trigger. Omit it (or send an empty object) to award credit immediately.","properties":{"delayInDays":{"type":"integer","minimum":1,"maximum":90,"description":"Number of whole days to hold referral credit before it is awarded. Useful for honoring a refund window before crediting a referrer. Omit this field to award credit immediately. The credit is awarded automatically once the delay elapses, and can be cancelled before then with the Cancel delayed referral trigger request."}}},"ReferralTriggerResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether referral credit was awarded or scheduled.","type":"boolean"},"message":{"description":"Human-readable result message, present when credit was not awarded immediately or when a delayed trigger was scheduled.","type":"string"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/ref":{"post":{"tags":["Participants"],"operationId":"triggerReferral","summary":"Trigger referral","description":"Triggers referral credit for an existing referred participant by GrowSurf participant ID or email address. Optionally pass `delayInDays` to hold the credit for a number of days before it is awarded (for example, to cover your own refund window). A delayed trigger can be cancelled before it is awarded with the Cancel delayed referral trigger request (DELETE on this same path).","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerReferralRequest"}}}},"responses":{"200":{"description":"Referral trigger result returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralTriggerResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Cancel delayed referral trigger

> Cancels a pending delayed referral trigger for a participant (the companion to a delayed Trigger referral request). Use this to undo a scheduled referral credit before it is awarded, for example when a refund occurs inside your refund window. If the participant has no pending delayed trigger, \`success\` is returned as \`false\`.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"ReferralTriggerResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether referral credit was awarded or scheduled.","type":"boolean"},"message":{"description":"Human-readable result message, present when credit was not awarded immediately or when a delayed trigger was scheduled.","type":"string"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/ref":{"delete":{"tags":["Participants"],"operationId":"cancelDelayedReferral","summary":"Cancel delayed referral trigger","description":"Cancels a pending delayed referral trigger for a participant (the companion to a delayed Trigger referral request). Use this to undo a scheduled referral credit before it is awarded, for example when a refund occurs inside your refund window. If the participant has no pending delayed trigger, `success` is returned as `false`.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"responses":{"200":{"description":"Delayed referral trigger cancellation result returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralTriggerResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Create mobile participant token

> Creates or returns a participant using the same input behavior as Add Participant, then returns a participant-scoped token for GrowSurf mobile SDK participant endpoints. Use this endpoint from your backend after your mobile app authenticates a signed-in user. The program must have mobile SDK access enabled.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}}},"schemas":{"CreateParticipantRequest":{"type":"object","required":["email"],"properties":{"email":{"description":"Participant email address.","type":"string","format":"email"},"referredBy":{"type":"string","description":"Referrer participant ID or email address.","maxLength":100},"referralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED"],"description":"The referral credit status, only meaningful when `referredBy` resolves to a referrer. When omitted, it is derived from the program's referral trigger: `CREDIT_AWARDED`, `CREDIT_PENDING` (manual or custom trigger), or `CREDIT_EXPIRED` (past the credit window). Left unset when no referrer resolves."},"firstName":{"description":"Participant first name.","type":"string","maxLength":255},"lastName":{"description":"Participant last name.","type":"string","maxLength":255},"ipAddress":{"description":"Participant IP address, used for fraud checks when provided.","type":"string"},"fingerprint":{"description":"Browser fingerprint, used for fraud checks when provided.","type":"string"},"mobileInstanceId":{"type":"string","description":"Optional app-install scoped identifier for native mobile anti-fraud. Recommended for mobile participant creation and mobile participant token flows. The official mobile SDKs generate this as a lowercase UUID."},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"Metadata":{"type":"object","description":"Shallow custom metadata object.","additionalProperties":true},"MobileParticipantTokenResponse":{"type":"object","required":["participantToken","expiresIn","participant","isNew"],"properties":{"participantToken":{"type":"string","description":"Participant-scoped bearer token for GrowSurf mobile SDK participant endpoints."},"expiresIn":{"type":"integer","description":"Token lifetime in seconds."},"participant":{"$ref":"#/components/schemas/Participant"},"isNew":{"type":"boolean","description":"Whether this request created a new participant. Returns false when the participant already existed."}}},"Participant":{"type":"object","description":"Detailed information about a program participant.","required":["id","referralCount","monthlyReferralCount","rank","monthlyRank","shareUrl","rewards","email"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant."},"firstName":{"type":["string","null"],"description":"The first name of the participant."},"lastName":{"type":["string","null"],"description":"The last name of the participant."},"email":{"type":"string","description":"The email of the participant."},"paypalEmailAddress":{"type":"string","format":"email","description":"The PayPal email address on file for the participant, used for affiliate or PayPal reward payouts."},"referralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made by the participant."},"monthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made this month by the participant (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","readOnly":true,"description":"The total number of referrals made the previous month by the participant."},"rank":{"type":"integer","readOnly":true,"description":"The rank of the participant."},"monthlyRank":{"type":"integer","readOnly":true,"description":"The monthly rank of the participant. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","readOnly":true,"description":"The previous monthly rank of the participant. Not returned if the participant did not exist in your program during the previous month."},"shareUrl":{"type":"string","readOnly":true,"description":"The unique share URL of the participant."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"The date the participant was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","readOnly":true,"description":"The source of how the participant joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the participant was referred, the referrer's status in receiving the referral credit. Only applicable if the participant was referred into the program."},"referredBy":{"type":"string","description":"The ID of the referrer. Only applicable if the participant was referred into the program."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","readOnly":true,"description":"A value that represents the integrity of the participant."},"fraudReasonCode":{"type":"string","readOnly":true,"description":"The reason for the participant's `fraudRiskLevel`:\n\n- `UNIQUE_IDENTITY` — They have a unique identity (no other participant has the same identity).\n- `DUPLICATE_EMAIL` — Their email is not unique and is identical to another participant's email (e.g., gavin@hooli.com = gavin+1@hooli.com).\n- `DUPLICATE_IDENTITY` — Their identity (fingerprint or mobile instance ID) is not unique and matches another participant's.\n- `DUPLICATE_IDENTITY_EXCESSIVE` — Within a small window of time, they had an excessive number of referred participants who also shared the same IP address.\n- `EMAIL_FRAUD` — Their email was found to match another participant's when updated in a connected billing or payment integration.\n- `SIMILAR_EMAIL` — Their browser fingerprint matches another participant's and their email looks suspiciously similar.\n- `SIMILAR_FIRST_NAME` — Their browser fingerprint matches another participant's and their first name looks suspiciously similar.\n- `SIMILAR_LAST_NAME` — Their browser fingerprint matches another participant's and their last name looks suspiciously similar.\n- `REFERRAL_EMAIL_PATTERN` — (Status for a referred person) Their email matched a similar pattern to their referrer's email.\n- `REFERRAL_CHAIN_FRAUD` — (Status for a referrer or referred person) Their characteristics matched a pattern with other referrals the referrer made, indicating a fraud ring.\n- `REFERRAL_VELOCITY_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals in a short period of time.\n- `DOMAIN_CLUSTERING_FRAUD` — (Status for a referrer or referred person) The referrer made an excessive number of referrals sharing the same suspicious domain in a short period of time.\n- `MANUAL_UPDATE` — They were manually marked as a fraudster from the GrowSurf dashboard.\n- `WHITELISTED` — They were allowed to join the program because one of their properties matched an allowed value.\n- `BLACKLIST_MATCH` — They were not allowed to join the program because one of their properties matched a blocked value.\n- `BLOCKED_IP` — They were not allowed to join the program because their IP address was recently blocked by antifraud IP throttling.\n- `REFERRER_HIGH_RISK` — They were not allowed to join the program because their referrer was a high-risk fraudster."},"isWinner":{"type":"boolean","readOnly":true,"description":"`true` if the participant has earned one or more rewards."},"shareCount":{"type":"object","readOnly":true,"additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the participant has shared their referral link, keyed by channel. Standard web channels include `email`, `facebook`, and `twitter`; SDK/native-share channels include `iosNativeShare` and `androidNativeShare`."},"impressionCount":{"type":"integer","readOnly":true,"description":"The total number of impressions the participant has made."},"uniqueImpressionCount":{"type":"integer","readOnly":true,"description":"The total number of unique impressions the participant has made."},"inviteCount":{"type":"integer","readOnly":true,"description":"The total number of invites the participant has sent."},"referrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the participant. Limited to the 100 most recently referred friends."},"monthlyReferrals":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the participant this month (resets at the end of the month). Limited to the 100 most recent."},"referrer":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/ParticipantReferrer"},{"type":"null"}],"description":"An object containing the participant's referrer information. Only applicable if the participant was referred into the program."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the participant, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the participant, used for anti-fraud matching."},"mobileInstanceId":{"type":["string","null"],"description":"App-install scoped mobile identifier used for anti-fraud matching when provided by native mobile apps. The official mobile SDKs generate this as a lowercase UUID. Not stored when strict GDPR/CCPA mode is enabled."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data, useful for saving additional data for the participant (e.g., `company`, `companySize`). Metadata is never used by GrowSurf and usage is optional. Metadata is returned only in REST API calls, and never in JavaScript Web API calls. See [API Guidelines](https://docs.growsurf.com/developer-tools/rest-api/api-guidelines)."},"notes":{"type":["string","null"],"description":"Internal notes about the participant, added via the [GrowSurf Dashboard](https://growsurf.com/dashboard)."},"unsubscribed":{"type":"boolean","description":"`true` if the participant has unsubscribed from program emails."},"rewards":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/ParticipantReward"},"description":"A list of the rewards the participant has earned."},"vanityKeys":{"type":"array","items":{"type":"string"},"description":"The list of vanity keys that the participant has."},"unreadCommissionsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of commissions the participant has not yet viewed."},"unreadPayoutsCount":{"type":"integer","readOnly":true,"description":"Affiliate programs only. The number of payouts the participant has not yet viewed."},"isNew":{"type":"boolean","readOnly":true,"description":"Whether this participant was newly created by the request. Returned by participant creation calls; `false` when the participant already existed."},"allMatchingFraudsters":{"type":"array","readOnly":true,"items":{"type":"object","additionalProperties":true},"description":"A list of other participants flagged as matching this participant during anti-fraud checks."},"payoutSettings":{"type":"object","readOnly":true,"description":"Payout-related actions the participant must complete before a payout can be released (e.g. confirming a PayPal email or submitting a W-9/W-8 tax form). Always present; the requiredActions array is empty when no action is required.","properties":{"requiredActions":{"description":"Actions the participant must complete before payouts can be sent.","type":"array","readOnly":true,"items":{"type":"string","enum":["PAYPAL_EMAIL","TAX_INFO"]}}}}}},"ReferralSource":{"type":"string","enum":["DIRECT","PARTICIPANT"]},"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"FraudRiskLevel":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"ParticipantReferrer":{"type":"object","description":"Summary information about a participant's referrer, returned within the `referrer` field of a `Participant`.","properties":{"id":{"type":"string","description":"The unique identifier of the referrer."},"firstName":{"type":["string","null"],"description":"The first name of the referrer."},"lastName":{"type":["string","null"],"description":"The last name of the referrer."},"email":{"type":"string","description":"The email of the referrer."},"referralCount":{"type":"integer","description":"The total number of referrals made by the referrer."},"monthlyReferralCount":{"type":"integer","description":"The total number of referrals made this month by the referrer (resets at the end of the month)."},"prevMonthlyReferralCount":{"type":"integer","description":"The total number of referrals made the previous month by the referrer."},"rank":{"type":"integer","description":"The rank of the referrer."},"monthlyRank":{"type":"integer","description":"The monthly rank of the referrer. This rank resets to 0 at the end of each month."},"prevMonthlyRank":{"type":"integer","description":"The previous monthly rank of the referrer."},"shareUrl":{"type":"string","description":"The unique share URL of the referrer."},"createdAt":{"type":"integer","format":"int64","description":"The date the referrer was added to the program (UTC milliseconds)."},"referralSource":{"$ref":"#/components/schemas/ReferralSource","description":"The source of how the referrer joined the program."},"referralStatus":{"$ref":"#/components/schemas/ReferralStatus","description":"If the referrer was themselves referred, their referrer's status in receiving the referral credit."},"fraudRiskLevel":{"$ref":"#/components/schemas/FraudRiskLevel","description":"A value that represents the integrity of the referrer."},"fraudReasonCode":{"type":"string","description":"The reason for the referrer's `fraudRiskLevel`. See `Participant.fraudReasonCode` for the list of possible values."},"isWinner":{"type":"boolean","description":"`true` if the referrer has earned one or more rewards."},"shareCount":{"type":"object","additionalProperties":{"type":"integer"},"description":"An object containing counts of how many times the referrer has shared their referral link, keyed by channel."},"impressionCount":{"type":"integer","description":"The total number of impressions the referrer has made."},"uniqueImpressionCount":{"type":"integer","description":"The total number of unique impressions the referrer has made."},"inviteCount":{"type":"integer","description":"The total number of invites the referrer has sent."},"referrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs who were successfully referred by the referrer. Limited to the 100 most recent."},"monthlyReferrals":{"type":"array","items":{"type":"string"},"description":"A list of `Participant` IDs successfully referred by the referrer this month (resets at the end of the month). Limited to the 100 most recent."},"ipAddress":{"type":["string","null"],"description":"The IP address associated with the referrer, used for anti-fraud matching."},"fingerprint":{"type":["string","null"],"description":"The browser fingerprint associated with the referrer, used for anti-fraud matching."},"metadata":{"$ref":"#/components/schemas/Metadata","description":"An object containing any custom key-value data for the referrer."},"unsubscribed":{"type":"boolean","description":"`true` if the referrer has unsubscribed from program emails."}}},"ParticipantReward":{"type":"object","description":"A reward that a participant has earned. This is different from a program `Reward` Object and contains information pertinent only to the participant that earned the reward.","required":["id","rewardId","status"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant's reward. This is different for every new reward the participant earns."},"rewardId":{"type":"string","readOnly":true,"description":"The ID of the program `Reward` (`CampaignReward`) that this participant has earned."},"status":{"$ref":"#/components/schemas/RewardStatus","readOnly":true,"description":"The status of the participant's reward."},"unread":{"type":"boolean","readOnly":true,"description":"`true` if the participant has not yet seen the reward in a GrowSurf window."},"approved":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been approved."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was approved for this participant (UTC milliseconds). `null` for unapproved rewards."},"fulfilledAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was fulfilled for this participant (UTC milliseconds). `null` for unapproved or unfulfilled rewards."},"isReferrer":{"type":"boolean","readOnly":true,"description":"`true` if the participant earned the reward as the referrer; `false` if they earned it as the referred friend (only applicable for double-sided reward types)."},"isAvailable":{"type":"boolean","readOnly":true,"description":"`true` if the reward is available for the participant to claim or redeem."},"isFulfilled":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been fulfilled."},"referredId":{"type":"string","readOnly":true,"description":"The ID of the friend that was referred."},"referrerId":{"type":"string","readOnly":true,"description":"The ID of the participant that made the referral."},"commissionStructure":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The commission structure associated with this reward. Present only for affiliate programs."}}},"RewardStatus":{"type":"string","enum":["PENDING","FULFILLED"]},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}},"ParticipantBlockedError":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"fraudRiskLevel":{"description":"Fraud risk level assigned to the blocked signup.","$ref":"#/components/schemas/FraudRiskLevel"},"fraudReasonCode":{"description":"Machine-readable reason code for the fraud decision.","type":"string"},"matchedParticipantIds":{"description":"Existing participant IDs related to the fraud match.","type":"array","items":{"type":"string"}},"email":{"description":"Email address from the blocked signup attempt.","type":"string","format":"email"},"referrerId":{"description":"Referrer participant ID supplied with the blocked signup, or `null`.","type":["string","null"]},"ipAddress":{"description":"IP address supplied with the blocked signup, or `null`.","type":["string","null"]},"fingerprint":{"description":"Browser fingerprint supplied with the blocked signup, or `null`.","type":["string","null"]},"blockedAt":{"description":"When the signup was blocked.","type":"string","format":"date-time"}}}]}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Conflicting duplicate request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/mobile-participant-token":{"post":{"tags":["Participants"],"operationId":"createMobileParticipantToken","summary":"Create mobile participant token","description":"Creates or returns a participant using the same input behavior as Add Participant, then returns a participant-scoped token for GrowSurf mobile SDK participant endpoints. Use this endpoint from your backend after your mobile app authenticates a signed-in user. The program must have mobile SDK access enabled.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateParticipantRequest"}}}},"responses":{"200":{"description":"Participant and mobile participant token returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileParticipantTokenResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"description":"Participant was blocked or the endpoint is not available for this program type.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ParticipantBlockedError"},{"$ref":"#/components/schemas/Error"}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Email participant

> Sends an email to a participant. Provide EITHER \`emailType\` to trigger one of the program's configured email templates, OR \`subject\` + \`body\` for a free-form email. Free-form emails are sent with the same compliance handling (company name, postal address, and an unsubscribe link are added automatically, and unsubscribed participants are suppressed). Sending requires the team to be verified by GrowSurf. Requires a \*\*verified custom email domain\*\* on the program (which can be completed in \*Campaign Editor > 3. Emails > Email Settings\*). Returns \`400\` until one is verified. The email is accepted for delivery.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"EmailParticipantRequest":{"type":"object","additionalProperties":false,"description":"Provide EITHER `emailType` (template mode) OR `subject` + `body` (free-form mode), not both.","properties":{"emailType":{"type":"string","description":"The program email template to trigger (template mode). Send the camelCase email-type key. The available types depend on the program type; the template's `isEnabled` setting controls automatic sends only. This endpoint can trigger any sendable template. System and transactional types (login link, PayPal confirmation, tax notifications) and the invite email cannot be sent. Referral programs: `welcomeNonReferred`, `referralLinkViewedFirstTime`, `referralLinkUsed`, `referredSignup`, `welcomeReferred`, `goalAchieved`, `campaignEndedWinners`, `campaignEndedNonWinners`, `progressUpdateMonthly`. Affiliate programs: `welcomeNonReferred`, `referralLinkViewedFirstTime`, `referredSignup`, `commissionGenerated`, `commissionAdjusted`, `payoutPending`, `payoutSentSuccess`, `progressUpdateMonthly`."},"subject":{"type":"string","maxLength":255,"description":"Subject line for a free-form email. Supports dynamic text (`{{...}}` tokens), the same as the body."},"body":{"type":"string","description":"HTML body for a free-form email. You can personalize it with dynamic text, inserting `{{...}}` tokens like `{{firstName}}` or `{{shareUrl}}`. See [Guide to using dynamic text in GrowSurf emails](https://support.growsurf.com/article/213-guide-to-using-dynamic-text-in-growsurf-emails)."},"preheader":{"type":"string","description":"Optional preheader text for a free-form email."}}},"EmailParticipantResponse":{"type":"object","required":["success","status"],"properties":{"success":{"description":"Whether the email request was accepted.","type":"boolean"},"status":{"type":"string","enum":["queued"],"description":"The email was accepted for delivery."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/email":{"post":{"tags":["Participants"],"operationId":"emailParticipant","summary":"Email participant","description":"Sends an email to a participant. Provide EITHER `emailType` to trigger one of the program's configured email templates, OR `subject` + `body` for a free-form email. Free-form emails are sent with the same compliance handling (company name, postal address, and an unsubscribe link are added automatically, and unsubscribed participants are suppressed). Sending requires the team to be verified by GrowSurf. Requires a **verified custom email domain** on the program (which can be completed in *Campaign Editor > 3. Emails > Email Settings*). Returns `400` until one is verified. The email is accepted for delivery.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailParticipantRequest"}}}},"responses":{"200":{"description":"Email accepted for delivery.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailParticipantResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Retrieve participant analytics

> Retrieves analytics for a single participant — all-time engagement counters, leaderboard ranks, and per-channel share counts (plus affiliate money metrics for affiliate programs). Useful for segmenting and re-engaging participants. Pass \`include=series\` to also get this participant's own activity over time.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Analytics","description":"Program analytics."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}},"AnalyticsDays":{"name":"days","in":"query","required":false,"description":"Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.","schema":{"type":"integer","minimum":1,"maximum":1825,"default":365}},"AnalyticsStartDate":{"name":"startDate","in":"query","required":false,"description":"Start date of the analytics timeframe as a Unix timestamp in milliseconds. Required if `days` is not set.","schema":{"type":"integer","format":"int64"}},"AnalyticsEndDate":{"name":"endDate","in":"query","required":false,"description":"End date of the analytics timeframe as a Unix timestamp in milliseconds. Required if `days` is not set.","schema":{"type":"integer","format":"int64"}}},"schemas":{"ParticipantAnalyticsResponse":{"type":"object","required":["analytics","ranks","shareCount"],"properties":{"analytics":{"description":"Participant analytics totals.","type":"object","properties":{"referrals":{"description":"All-time referrals credited to this participant.","type":"integer"},"monthlyReferrals":{"description":"Referrals credited to this participant in the current month.","type":"integer"},"leads":{"description":"Pending referral credits for this participant.","type":"integer"},"expiredReferrals":{"description":"Expired referral credits for this participant.","type":"integer"},"impressions":{"description":"Total referral-link views for this participant.","type":"integer"},"uniqueImpressions":{"description":"Unique referral-link views for this participant.","type":"integer"},"invitesSent":{"description":"Invites sent by this participant.","type":"integer"},"rewardsEarned":{"description":"Approved rewards earned by this participant.","type":"integer"},"pendingRewards":{"description":"Rewards earned by this participant that are awaiting approval.","type":"integer"},"referralRevenue":{"type":"integer","description":"Affiliate only. Revenue attributed to this participant's referrals, in minor currency units."},"totalCommissions":{"type":"integer","description":"Affiliate only. Total commissions earned, in minor currency units."},"totalPaidOut":{"type":"integer","description":"Affiliate only. Total paid out, in minor currency units."},"upcomingPayout":{"type":"integer","description":"Affiliate only. Approved commissions ready to pay, in minor currency units."},"currencyISO":{"description":"Program currency for this participant's money metrics.","type":"string"}}},"ranks":{"description":"Leaderboard ranks for this participant.","type":"object","properties":{"rank":{"type":"integer","nullable":true,"description":"All-time rank (1-indexed), or null when unranked."},"monthlyRank":{"description":"Current-month rank, or `null` when unranked.","type":"integer","nullable":true},"prevMonthlyRank":{"description":"Previous-month rank, or `null` when unranked.","type":"integer","nullable":true}}},"shareCount":{"type":"object","additionalProperties":{"type":"integer"},"description":"Per-channel share counts (e.g. `email`, `facebook`, `twitter`, ...)."},"series":{"type":"array","description":"Present only when `include=series`. This participant's own referral-link activity per period (ascending), windowed by `days`/`startDate`/`endDate` and bucketed by `interval`.","items":{"allOf":[{"type":"object","properties":{"periodStart":{"type":"integer","format":"int64","description":"Start of the period, as a Unix timestamp in milliseconds (UTC)."}}},{"$ref":"#/components/schemas/CampaignAnalytics"}]}},"startDate":{"type":"integer","format":"int64","description":"Present only with `include=series`. Window start (Unix ms)."},"endDate":{"type":"integer","format":"int64","description":"Present only with `include=series`. Window end (Unix ms)."}}},"CampaignAnalytics":{"type":"object","properties":{"invites":{"description":"Number of invites sent by participants.","type":"integer"},"impressions":{"description":"Total referral-link views.","type":"integer"},"uniqueImpressions":{"description":"Unique referral-link views.","type":"integer"},"participants":{"description":"Number of participants added.","type":"integer"},"referrals":{"description":"Number of referrals credited.","type":"integer"},"referralCreditPendings":{"description":"Number of referrals waiting for credit.","type":"integer"},"referralCreditExpireds":{"description":"Number of referrals whose credit window expired.","type":"integer"},"emailShares":{"description":"Number of shares through email.","type":"integer"},"facebookShares":{"description":"Number of shares through Facebook.","type":"integer"},"twitterShares":{"description":"Number of shares through Twitter/X.","type":"integer"},"threadsShares":{"description":"Number of shares through Threads.","type":"integer"},"blueskyShares":{"description":"Number of shares through Bluesky.","type":"integer"},"pinterestShares":{"description":"Number of shares through Pinterest.","type":"integer"},"linkedInShares":{"description":"Number of shares through LinkedIn.","type":"integer"},"smsShares":{"description":"Number of shares through SMS.","type":"integer"},"messengerShares":{"description":"Number of shares through Messenger.","type":"integer"},"whatsAppShares":{"description":"Number of shares through WhatsApp.","type":"integer"},"wechatShares":{"description":"Number of shares through WeChat.","type":"integer"},"telegramShares":{"description":"Number of shares through Telegram.","type":"integer"},"qrcodeShares":{"description":"Number of shares through QR code.","type":"integer"},"redditShares":{"description":"Number of shares through Reddit.","type":"integer"},"tumblrShares":{"description":"Number of shares through Tumblr.","type":"integer"},"copyRefLinkShares":{"description":"Number of times participants copied their referral link.","type":"integer"},"iosNativeShares":{"description":"Number of shares through iOS native sharing.","type":"integer"},"androidNativeShares":{"description":"Number of shares through Android native sharing.","type":"integer"},"totalRevenue":{"type":"integer","description":"Affiliate programs only. Revenue in the smallest unit of the program currency."},"totalCommissions":{"type":"integer","description":"Affiliate programs only. Commissions in the smallest unit of the program currency."},"totalCommissionCount":{"type":"integer","description":"Affiliate programs only. Number of commission records."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/analytics":{"get":{"tags":["Analytics"],"operationId":"retrieveParticipantAnalytics","summary":"Retrieve participant analytics","description":"Retrieves analytics for a single participant — all-time engagement counters, leaderboard ranks, and per-channel share counts (plus affiliate money metrics for affiliate programs). Useful for segmenting and re-engaging participants. Pass `include=series` to also get this participant's own activity over time.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"},{"name":"include","in":"query","description":"Set to `series` to also return this participant's own activity per period.","schema":{"type":"string","enum":["series"]}},{"$ref":"#/components/parameters/AnalyticsDays"},{"$ref":"#/components/parameters/AnalyticsStartDate"},{"$ref":"#/components/parameters/AnalyticsEndDate"},{"name":"interval","in":"query","description":"Bucket size for the `series` (only used with `include=series`). Defaults to `day`.","schema":{"type":"string","enum":["day","week","month"],"default":"day"}}],"responses":{"200":{"description":"Participant analytics returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantAnalyticsResponse"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## List participant activity logs

> Returns a participant's activity logs, most recent first (offset/limit paginated).

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participants","description":"Program participant retrieval, creation, updates, deletion, and referral triggering."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"ParticipantActivityLogsResponse":{"type":"object","required":["activityLogs","limit"],"properties":{"activityLogs":{"description":"Activity log entries for the participant.","type":"array","items":{"$ref":"#/components/schemas/ParticipantActivityLog"}},"offset":{"type":"integer","nullable":true,"description":"The offset for the next page, or null when there are no more logs."},"limit":{"description":"Number of activity logs returned per page.","type":"integer"}}},"ParticipantActivityLog":{"type":"object","required":["type","text","createdAt"],"properties":{"type":{"type":"string","description":"The activity family (e.g. `REFERRAL`, `SHARE`, `REWARD`, `EMAIL`, `COMMON`)."},"text":{"type":"string","description":"A human-readable description of the activity."},"createdAt":{"type":"integer","format":"int64","description":"When the activity occurred, as a Unix timestamp in milliseconds."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/activity-logs":{"get":{"tags":["Participants"],"operationId":"listParticipantActivityLogs","summary":"List participant activity logs","description":"Returns a participant's activity logs, most recent first (offset/limit paginated).","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"},{"name":"limit","in":"query","description":"Number of logs to return (1–100, default 20).","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","description":"Number of logs to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Activity logs returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantActivityLogsResponse"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## PARTICIPANT REWARDS ↓

## List participant rewards

> Retrieves a paged list of rewards earned by a participant.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participant Rewards","description":"Participant reward retrieval and manual reward operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}},"schemas":{"ParticipantRewardListResponse":{"type":"object","required":["rewards","limit","nextId"],"properties":{"rewards":{"description":"Participant rewards returned for this page.","type":"array","items":{"$ref":"#/components/schemas/ParticipantReward"}},"limit":{"description":"Maximum number of rewards requested for this page.","type":"integer"},"nextId":{"description":"Reward ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]}}},"ParticipantReward":{"type":"object","description":"A reward that a participant has earned. This is different from a program `Reward` Object and contains information pertinent only to the participant that earned the reward.","required":["id","rewardId","status"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant's reward. This is different for every new reward the participant earns."},"rewardId":{"type":"string","readOnly":true,"description":"The ID of the program `Reward` (`CampaignReward`) that this participant has earned."},"status":{"$ref":"#/components/schemas/RewardStatus","readOnly":true,"description":"The status of the participant's reward."},"unread":{"type":"boolean","readOnly":true,"description":"`true` if the participant has not yet seen the reward in a GrowSurf window."},"approved":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been approved."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was approved for this participant (UTC milliseconds). `null` for unapproved rewards."},"fulfilledAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"The date and time the reward was fulfilled for this participant (UTC milliseconds). `null` for unapproved or unfulfilled rewards."},"isReferrer":{"type":"boolean","readOnly":true,"description":"`true` if the participant earned the reward as the referrer; `false` if they earned it as the referred friend (only applicable for double-sided reward types)."},"isAvailable":{"type":"boolean","readOnly":true,"description":"`true` if the reward is available for the participant to claim or redeem."},"isFulfilled":{"type":"boolean","readOnly":true,"description":"`true` if the participant's reward has been fulfilled."},"referredId":{"type":"string","readOnly":true,"description":"The ID of the friend that was referred."},"referrerId":{"type":"string","readOnly":true,"description":"The ID of the participant that made the referral."},"commissionStructure":{"readOnly":true,"oneOf":[{"$ref":"#/components/schemas/CommissionStructure"},{"type":"null"}],"description":"The commission structure associated with this reward. Present only for affiliate programs."}}},"RewardStatus":{"type":"string","enum":["PENDING","FULFILLED"]},"CommissionStructure":{"type":"object","description":"The commission configuration for an affiliate reward. Present only for affiliate programs.","properties":{"amount":{"type":["integer","null"],"description":"Fixed commission amount in the currency's smallest denomination, used when `type` is `FIXED`. `null` for percentage-based commissions."},"amountISO":{"type":["string","null"],"description":"ISO 4217 currency code for the fixed `amount`. Defaults to the program's currency when omitted. Must match the campaign `currencyISO` when provided. `null` for percentage-based commissions."},"event":{"type":["string","null"],"description":"The event that generates a commission (e.g., `SALE`)."},"type":{"type":["string","null"],"enum":["PERCENT","FIXED",null],"description":"How the commission is calculated: `PERCENT` (a percentage of the sale) or `FIXED` (a fixed `amount`)."},"minPaidReferrals":{"type":["integer","null"],"description":"The minimum number of paid referrals required before commissions are earned."},"holdDuration":{"type":["integer","null"],"description":"Number of days a commission is held before it can be paid out."},"duration":{"type":["string","null"],"description":"How long commissions continue to be earned for a referred customer."},"durationInMonths":{"type":["integer","null"],"description":"When `duration` is repeating, the number of months over which commissions are earned."},"approvalRequired":{"type":["boolean","null"],"description":"`true` if commissions require manual approval before they can be paid out."},"percent":{"type":["number","null"],"description":"The commission percentage, used when `type` is `PERCENT`."},"hasMaxAmount":{"type":["boolean","null"],"description":"`true` if a maximum commission amount cap is configured."},"maxAmount":{"type":["integer","null"],"description":"The maximum commission amount cap in the currency's smallest denomination. `null` if no cap is set."},"maxAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `maxAmount`. Must match the campaign `currencyISO` when provided."},"hasIntro":{"type":["boolean","null"],"description":"`true` if an introductory commission rate is configured."},"introType":{"type":["string","null"],"description":"How the introductory commission is calculated: `PERCENT` or `FIXED`."},"introPercent":{"type":["number","null"],"description":"The introductory commission percentage, used when `introType` is `PERCENT`."},"introAmount":{"type":["integer","null"],"description":"The introductory commission amount in the currency's smallest denomination, used when `introType` is `FIXED`."},"introAmountISO":{"type":["string","null"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code for `introAmount`. Must match the campaign `currencyISO` when provided."},"introDuration":{"type":["string","null"],"description":"How long the introductory rate applies."},"introDurationInMonths":{"type":["integer","null"],"description":"When `introDuration` is repeating, the number of months the introductory rate applies."}},"additionalProperties":false},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/rewards":{"get":{"tags":["Participant Rewards"],"operationId":"listParticipantRewards","summary":"List participant rewards","description":"Retrieves a paged list of rewards earned by a participant.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"},{"$ref":"#/components/parameters/NextId"},{"$ref":"#/components/parameters/Limit100"}],"responses":{"200":{"description":"Participant rewards returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantRewardListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Approve participant reward

> Approves a manually approved reward earned by a participant. This requires \`reward:write\`. When the request also sets \`fulfill\` to \`true\`, it additionally requires \`reward:fulfill\`.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participant Rewards","description":"Participant reward retrieval and manual reward operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"RewardId":{"name":"rewardId","in":"path","required":true,"description":"Participant reward ID.","schema":{"type":"string"}}},"schemas":{"ApproveRewardRequest":{"type":"object","properties":{"fulfill":{"type":"boolean","default":false,"description":"Set true to mark the reward as fulfilled after approval."}}},"SuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether the request succeeded.","type":"boolean"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"Success":{"description":"Success response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InvalidState":{"description":"Resource is not in a state that permits this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/reward/{rewardId}/approve":{"post":{"tags":["Participant Rewards"],"operationId":"approveParticipantReward","summary":"Approve participant reward","description":"Approves a manually approved reward earned by a participant. This requires `reward:write`. When the request also sets `fulfill` to `true`, it additionally requires `reward:fulfill`.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/RewardId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveRewardRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/Success"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"406":{"$ref":"#/components/responses/InvalidState"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Fulfill participant reward

> Marks an approved participant reward as fulfilled.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participant Rewards","description":"Participant reward retrieval and manual reward operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"RewardId":{"name":"rewardId","in":"path","required":true,"description":"Participant reward ID.","schema":{"type":"string"}}},"responses":{"Success":{"description":"Success response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InvalidState":{"description":"Resource is not in a state that permits this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"SuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether the request succeeded.","type":"boolean"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}}},"paths":{"/campaign/{id}/reward/{rewardId}/fulfill":{"post":{"tags":["Participant Rewards"],"operationId":"fulfillParticipantReward","summary":"Fulfill participant reward","description":"Marks an approved participant reward as fulfilled.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/RewardId"}],"responses":{"200":{"$ref":"#/components/responses/Success"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"406":{"$ref":"#/components/responses/InvalidState"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Delete participant reward

> Removes a manually approved participant reward that has not already been approved.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Participant Rewards","description":"Participant reward retrieval and manual reward operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"RewardId":{"name":"rewardId","in":"path","required":true,"description":"Participant reward ID.","schema":{"type":"string"}}},"responses":{"Success":{"description":"Success response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InvalidState":{"description":"Resource is not in a state that permits this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"SuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether the request succeeded.","type":"boolean"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}}},"paths":{"/campaign/{id}/reward/{rewardId}":{"delete":{"tags":["Participant Rewards"],"operationId":"deleteParticipantReward","summary":"Delete participant reward","description":"Removes a manually approved participant reward that has not already been approved.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/RewardId"}],"responses":{"200":{"$ref":"#/components/responses/Success"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"406":{"$ref":"#/components/responses/InvalidState"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## REFERRALS AND INVITES ↓

## List referrals and invites

> Retrieves a list of all referrals and email invites made by participants in a program.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Referrals and Invites","description":"Referral, invite, and participant email invite operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ReferralSortBy":{"name":"sortBy","in":"query","required":false,"description":"Field used to sort referral results.","schema":{"type":"string","enum":["updatedAt","createdAt","email","firstName","lastName","referralStatus","referralTriggeredAt"],"default":"updatedAt"}},"Desc":{"name":"desc","in":"query","required":false,"description":"Return results in descending order when true.","schema":{"type":"boolean","default":true}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"Offset":{"name":"offset","in":"query","required":false,"description":"Offset number used to skip through a result set.","schema":{"type":"integer","minimum":0,"default":0}},"ReferralEmailFilter":{"name":"email","in":"query","required":false,"description":"URL-encoded email value to filter referral results.","schema":{"type":"string"}},"FirstNameFilter":{"name":"firstName","in":"query","required":false,"description":"First name value to filter results.","schema":{"type":"string"}},"LastNameFilter":{"name":"lastName","in":"query","required":false,"description":"Last name value to filter results.","schema":{"type":"string"}},"ReferralStatusFilter":{"name":"referralStatus","in":"query","required":false,"description":"Referral status to filter results.","schema":{"$ref":"#/components/schemas/ReferralStatus"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}}},"schemas":{"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"ReferralListResponse":{"type":"object","required":["referrals","limit","more"],"properties":{"referrals":{"description":"Referrals and invites returned for this page.","type":"array","items":{"$ref":"#/components/schemas/Referral"}},"limit":{"description":"Maximum number of referrals requested for this page.","type":"integer"},"nextOffset":{"description":"Offset to pass as `offset` for the next page, or `null` when offset pagination is not used.","type":["integer","null"]},"nextId":{"description":"Referral ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]},"more":{"description":"Whether another page of referrals is available.","type":"boolean"}}},"Referral":{"type":"object","required":["id","email","referralStatus","referredBy","createdAt","updatedAt"],"properties":{"id":{"description":"Participant ID for the referred friend or invitee.","type":"string"},"email":{"description":"Email address for the referred friend or invitee.","type":"string"},"firstName":{"description":"First name for the referred friend or invitee.","type":["string","null"]},"lastName":{"description":"Last name for the referred friend or invitee.","type":["string","null"]},"referralStatus":{"description":"Current referral status for this referred friend or invite.","$ref":"#/components/schemas/ReferralStatus"},"referredBy":{"description":"Participant ID of the referrer.","type":"string"},"createdAt":{"description":"When the referral or invite was created, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"},"updatedAt":{"description":"When the referral or invite was last updated, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/referrals":{"get":{"tags":["Referrals and Invites"],"operationId":"listReferrals","summary":"List referrals and invites","description":"Retrieves a list of all referrals and email invites made by participants in a program.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ReferralSortBy"},{"$ref":"#/components/parameters/Desc"},{"$ref":"#/components/parameters/Limit100"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/ReferralEmailFilter"},{"$ref":"#/components/parameters/FirstNameFilter"},{"$ref":"#/components/parameters/LastNameFilter"},{"$ref":"#/components/parameters/ReferralStatusFilter"},{"$ref":"#/components/parameters/NextId"}],"responses":{"200":{"description":"Referrals and invites returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## List participant referrals and invites

> Retrieves referrals and email invites made by a participant.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Referrals and Invites","description":"Referral, invite, and participant email invite operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}},"ReferralSortBy":{"name":"sortBy","in":"query","required":false,"description":"Field used to sort referral results.","schema":{"type":"string","enum":["updatedAt","createdAt","email","firstName","lastName","referralStatus","referralTriggeredAt"],"default":"updatedAt"}},"Desc":{"name":"desc","in":"query","required":false,"description":"Return results in descending order when true.","schema":{"type":"boolean","default":true}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"Offset":{"name":"offset","in":"query","required":false,"description":"Offset number used to skip through a result set.","schema":{"type":"integer","minimum":0,"default":0}},"ReferralEmailFilter":{"name":"email","in":"query","required":false,"description":"URL-encoded email value to filter referral results.","schema":{"type":"string"}},"FirstNameFilter":{"name":"firstName","in":"query","required":false,"description":"First name value to filter results.","schema":{"type":"string"}},"LastNameFilter":{"name":"lastName","in":"query","required":false,"description":"Last name value to filter results.","schema":{"type":"string"}},"ReferralStatusFilter":{"name":"referralStatus","in":"query","required":false,"description":"Referral status to filter results.","schema":{"$ref":"#/components/schemas/ReferralStatus"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}}},"schemas":{"ReferralStatus":{"type":"string","enum":["CREDIT_PENDING","CREDIT_AWARDED","CREDIT_EXPIRED","INVITE_SENT"]},"ReferralListResponse":{"type":"object","required":["referrals","limit","more"],"properties":{"referrals":{"description":"Referrals and invites returned for this page.","type":"array","items":{"$ref":"#/components/schemas/Referral"}},"limit":{"description":"Maximum number of referrals requested for this page.","type":"integer"},"nextOffset":{"description":"Offset to pass as `offset` for the next page, or `null` when offset pagination is not used.","type":["integer","null"]},"nextId":{"description":"Referral ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]},"more":{"description":"Whether another page of referrals is available.","type":"boolean"}}},"Referral":{"type":"object","required":["id","email","referralStatus","referredBy","createdAt","updatedAt"],"properties":{"id":{"description":"Participant ID for the referred friend or invitee.","type":"string"},"email":{"description":"Email address for the referred friend or invitee.","type":"string"},"firstName":{"description":"First name for the referred friend or invitee.","type":["string","null"]},"lastName":{"description":"Last name for the referred friend or invitee.","type":["string","null"]},"referralStatus":{"description":"Current referral status for this referred friend or invite.","$ref":"#/components/schemas/ReferralStatus"},"referredBy":{"description":"Participant ID of the referrer.","type":"string"},"createdAt":{"description":"When the referral or invite was created, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"},"updatedAt":{"description":"When the referral or invite was last updated, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/referrals":{"get":{"tags":["Referrals and Invites"],"operationId":"listParticipantReferrals","summary":"List participant referrals and invites","description":"Retrieves referrals and email invites made by a participant.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"},{"$ref":"#/components/parameters/ReferralSortBy"},{"$ref":"#/components/parameters/Desc"},{"$ref":"#/components/parameters/Limit100"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/ReferralEmailFilter"},{"$ref":"#/components/parameters/FirstNameFilter"},{"$ref":"#/components/parameters/LastNameFilter"},{"$ref":"#/components/parameters/ReferralStatusFilter"},{"$ref":"#/components/parameters/NextId"}],"responses":{"200":{"description":"Participant referrals and invites returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Send participant invites

> Sends email invites on behalf of a participant to a list of email addresses. Sending invites via the API requires a \*\*verified custom email domain\*\* on the program; the request fails until one is verified.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Referrals and Invites","description":"Referral, invite, and participant email invite operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"SendInvitesRequest":{"type":"object","required":["emailAddresses","messageText","subjectText"],"properties":{"emailAddresses":{"description":"Email addresses to invite.","type":"array","minItems":1,"items":{"type":"string","format":"email"}},"messageText":{"description":"Message body for the invite email.","type":"string"},"subjectText":{"description":"Subject line for the invite email.","type":"string"}}},"SendInvitesResponse":{"type":"object","required":["success","messageType","invitesSent"],"properties":{"success":{"description":"Whether the invites request succeeded.","type":"boolean"},"messageType":{"description":"Result category for the invites request.","type":"string"},"invitesSent":{"description":"Number of invite emails sent.","type":"integer"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/invites":{"post":{"tags":["Referrals and Invites"],"operationId":"sendParticipantInvites","summary":"Send participant invites","description":"Sends email invites on behalf of a participant to a list of email addresses. Sending invites via the API requires a **verified custom email domain** on the program; the request fails until one is verified.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInvitesRequest"}}}},"responses":{"200":{"description":"Invite send result returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInvitesResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## ANALYTICS ↓

## Retrieve campaign analytics

> Retrieves analytics for a program. Pass \`interval\` to also get a time-series (\`series\`) alongside the totals, and \`include\` to add previous-period totals, status breakdowns, or derived rates — useful for detecting trends over time.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Analytics","description":"Program analytics."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"AnalyticsDays":{"name":"days","in":"query","required":false,"description":"Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.","schema":{"type":"integer","minimum":1,"maximum":1825,"default":365}},"AnalyticsStartDate":{"name":"startDate","in":"query","required":false,"description":"Start date of the analytics timeframe as a Unix timestamp in milliseconds. Required if `days` is not set.","schema":{"type":"integer","format":"int64"}},"AnalyticsEndDate":{"name":"endDate","in":"query","required":false,"description":"End date of the analytics timeframe as a Unix timestamp in milliseconds. Required if `days` is not set.","schema":{"type":"integer","format":"int64"}}},"schemas":{"CampaignAnalyticsResponse":{"type":"object","required":["analytics","startDate","endDate"],"properties":{"analytics":{"description":"Campaign analytics totals for the requested timeframe.","$ref":"#/components/schemas/CampaignAnalytics"},"startDate":{"description":"Start of the analytics timeframe, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"},"endDate":{"description":"End of the analytics timeframe, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"},"series":{"type":"array","description":"Present only when `interval` is `day`, `week`, or `month`. Per-period totals, ascending.","items":{"allOf":[{"type":"object","properties":{"periodStart":{"type":"integer","format":"int64","description":"Start of the period, as a Unix timestamp in milliseconds (UTC)."}}},{"$ref":"#/components/schemas/CampaignAnalytics"}]}},"previousPeriod":{"description":"Present only when `include` contains `previousPeriod`.","allOf":[{"$ref":"#/components/schemas/PreviousPeriodAnalytics"}]},"statusCounts":{"description":"Present only when `include` contains `statusCounts`.","allOf":[{"$ref":"#/components/schemas/CampaignStatusCounts"}]},"rates":{"description":"Present only when `include` contains `rates`.","allOf":[{"$ref":"#/components/schemas/CampaignAnalyticsRates"}]}}},"CampaignAnalytics":{"type":"object","properties":{"invites":{"description":"Number of invites sent by participants.","type":"integer"},"impressions":{"description":"Total referral-link views.","type":"integer"},"uniqueImpressions":{"description":"Unique referral-link views.","type":"integer"},"participants":{"description":"Number of participants added.","type":"integer"},"referrals":{"description":"Number of referrals credited.","type":"integer"},"referralCreditPendings":{"description":"Number of referrals waiting for credit.","type":"integer"},"referralCreditExpireds":{"description":"Number of referrals whose credit window expired.","type":"integer"},"emailShares":{"description":"Number of shares through email.","type":"integer"},"facebookShares":{"description":"Number of shares through Facebook.","type":"integer"},"twitterShares":{"description":"Number of shares through Twitter/X.","type":"integer"},"threadsShares":{"description":"Number of shares through Threads.","type":"integer"},"blueskyShares":{"description":"Number of shares through Bluesky.","type":"integer"},"pinterestShares":{"description":"Number of shares through Pinterest.","type":"integer"},"linkedInShares":{"description":"Number of shares through LinkedIn.","type":"integer"},"smsShares":{"description":"Number of shares through SMS.","type":"integer"},"messengerShares":{"description":"Number of shares through Messenger.","type":"integer"},"whatsAppShares":{"description":"Number of shares through WhatsApp.","type":"integer"},"wechatShares":{"description":"Number of shares through WeChat.","type":"integer"},"telegramShares":{"description":"Number of shares through Telegram.","type":"integer"},"qrcodeShares":{"description":"Number of shares through QR code.","type":"integer"},"redditShares":{"description":"Number of shares through Reddit.","type":"integer"},"tumblrShares":{"description":"Number of shares through Tumblr.","type":"integer"},"copyRefLinkShares":{"description":"Number of times participants copied their referral link.","type":"integer"},"iosNativeShares":{"description":"Number of shares through iOS native sharing.","type":"integer"},"androidNativeShares":{"description":"Number of shares through Android native sharing.","type":"integer"},"totalRevenue":{"type":"integer","description":"Affiliate programs only. Revenue in the smallest unit of the program currency."},"totalCommissions":{"type":"integer","description":"Affiliate programs only. Commissions in the smallest unit of the program currency."},"totalCommissionCount":{"type":"integer","description":"Affiliate programs only. Number of commission records."}}},"PreviousPeriodAnalytics":{"type":"object","description":"Totals for the equal-length window immediately preceding the requested one.","required":["analytics","startDate","endDate"],"properties":{"analytics":{"description":"Campaign analytics totals for the previous comparison timeframe.","$ref":"#/components/schemas/CampaignAnalytics"},"startDate":{"description":"Start of the previous comparison timeframe, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"},"endDate":{"description":"End of the previous comparison timeframe, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"}}},"CampaignStatusCounts":{"type":"object","description":"Status-count breakdowns. `rewardStatus` is present for every program; `affiliateStatus`, `commissionStatus`, and `payoutStatus` are present only for affiliate programs. Money amounts are in minor units of `currencyISO`.","properties":{"currencyISO":{"description":"Program currency for money amounts in the status-count breakdown.","type":"string"},"rewardStatus":{"description":"Reward counts by approval status.","type":"object","properties":{"pending":{"type":"integer","description":"Unapproved rewards awaiting fulfillment."},"approved":{"description":"Approved rewards.","type":"integer"}}},"affiliateStatus":{"type":"object","description":"Affiliate only. Participant counts keyed by affiliate status.","additionalProperties":{"type":"integer"}},"commissionStatus":{"type":"object","description":"Affiliate only. Commission counts and amounts by status.","properties":{"pending":{"description":"Pending commissions.","$ref":"#/components/schemas/CommissionStatusMetric"},"approved":{"description":"Approved commissions.","$ref":"#/components/schemas/CommissionStatusMetric"},"paid":{"description":"Paid commissions.","$ref":"#/components/schemas/CommissionStatusMetric"},"reversed":{"description":"Reversed commissions.","$ref":"#/components/schemas/CommissionStatusMetric"}}},"payoutStatus":{"type":"object","description":"Affiliate only. Payout counts and amounts by status.","properties":{"upcoming":{"description":"Upcoming payouts.","$ref":"#/components/schemas/PayoutStatusMetric"},"queued":{"description":"Queued payouts.","$ref":"#/components/schemas/PayoutStatusMetric"},"issued":{"description":"Issued payouts.","$ref":"#/components/schemas/PayoutStatusMetric"},"failed":{"description":"Failed payouts.","$ref":"#/components/schemas/PayoutStatusMetric"}}}}},"CommissionStatusMetric":{"type":"object","properties":{"count":{"description":"Number of commissions in this status.","type":"integer"},"totalAmount":{"type":"integer","description":"Total commission amount in minor currency units."},"totalRevenue":{"type":"integer","description":"Total attributed revenue in minor currency units."}}},"PayoutStatusMetric":{"type":"object","properties":{"count":{"description":"Number of payouts in this status.","type":"integer"},"totalAmount":{"type":"integer","description":"Total payout amount in minor currency units."}}},"CampaignAnalyticsRates":{"type":"object","description":"Derived referral rates, each a ratio in the range 0–1 (0 when its denominator is 0).","properties":{"referralConversionRate":{"type":"number","format":"float","description":"`referrals` divided by `uniqueImpressions`."},"participationRate":{"type":"number","format":"float","description":"`participants` divided by `uniqueImpressions`."},"sharesPerParticipant":{"type":"number","format":"float","description":"Total shares across all channels divided by `participants`."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/analytics":{"get":{"tags":["Analytics"],"operationId":"retrieveCampaignAnalytics","summary":"Retrieve campaign analytics","description":"Retrieves analytics for a program. Pass `interval` to also get a time-series (`series`) alongside the totals, and `include` to add previous-period totals, status breakdowns, or derived rates — useful for detecting trends over time.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/AnalyticsDays"},{"$ref":"#/components/parameters/AnalyticsStartDate"},{"$ref":"#/components/parameters/AnalyticsEndDate"},{"name":"interval","in":"query","description":"When set to `day`, `week`, or `month`, the response also includes a `series` array with per-period totals. Defaults to `total` (no series).","schema":{"type":"string","enum":["day","week","month","total"],"default":"total"}},{"name":"include","in":"query","description":"Comma-separated list of optional enrichments (opt-in to keep the default response lean): `previousPeriod` adds totals for the equal-length window immediately before the requested one; `statusCounts` adds reward (and, for affiliate programs, affiliate/commission/payout) status breakdowns; `rates` adds derived referral rates.","schema":{"type":"string"}}],"responses":{"200":{"description":"Campaign analytics returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignAnalyticsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

***

## AFFILIATE PROGRAMS ↓

## Record affiliate transaction

> \*\*Affiliate programs only.\*\* Records a sale made by a referred customer and generates affiliate commissions for their referrer when applicable. Requires at least one transaction identifier (externalId, transactionId, orderId, paymentId, invoiceId, paymentIntentId, or chargeId) so repeated requests can be de-duplicated — without one, a resent sale would create a second commission. Reuse the same identifier(s) when refunding.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Affiliate Programs","description":"Affiliate transaction, commission, and payout operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"RecordTransactionRequest":{"type":"object","required":["currency","grossAmount"],"properties":{"currency":{"description":"3-letter ISO 4217 currency code for the sale. Must match the program currency.","type":"string","minLength":3,"maxLength":3,"pattern":"^[A-Za-z]{3}$"},"grossAmount":{"description":"Total sale amount in the currency's minor unit. Must be a positive integer.","type":"integer","minimum":1},"netAmount":{"description":"Net-of-tax sale amount in the currency's minor unit. Used as the commissionable base when supplied.","type":"integer","minimum":0},"taxAmount":{"description":"Tax collected in the currency's minor unit. Used to derive the commissionable base when `netAmount` is absent.","type":"integer","minimum":0},"amountCashNet":{"description":"Explicit post-tax cash amount in the currency's minor unit. Overrides derived net amounts.","type":"integer","minimum":0},"amountPaid":{"description":"Amount actually paid in the currency's minor unit, when reported by your payment processor.","type":"integer","minimum":0},"paidAt":{"description":"When the payment was captured or settled, as a Unix timestamp in milliseconds.","type":"integer","format":"int64"},"externalId":{"description":"Primary transaction identifier from your billing system. Used to detect duplicate submissions.","type":"string","maxLength":500},"transactionId":{"description":"Transaction identifier to store for this sale. Used to detect duplicate submissions.","type":"string","maxLength":500},"customerId":{"description":"Customer record identifier, such as a payment-provider customer ID.","type":"string","maxLength":500},"orderId":{"description":"Order identifier. Used to detect duplicate submissions when supplied.","type":"string","maxLength":500},"paymentId":{"description":"Payment identifier. Used to detect duplicate submissions when supplied.","type":"string","maxLength":500},"invoiceId":{"description":"Invoice identifier. Used to detect duplicate submissions when supplied.","type":"string","maxLength":500},"subscriptionId":{"description":"Subscription identifier for recurring payments.","type":"string","maxLength":500},"paymentIntentId":{"description":"Payment intent identifier. Used to detect duplicate submissions when supplied.","type":"string","maxLength":500},"chargeId":{"description":"Charge identifier. Used to detect duplicate submissions when supplied.","type":"string","maxLength":500},"description":{"description":"Freeform sale description shown in dashboard context and reports.","type":"string","maxLength":500},"invoiceTotal":{"description":"Invoice total including tax, in the currency's minor unit.","type":"integer","minimum":0},"invoiceTotalExcludingTax":{"description":"Invoice total excluding tax, in the currency's minor unit.","type":"integer","minimum":0},"invoiceSubtotalExcludingTax":{"description":"Invoice subtotal excluding tax, in the currency's minor unit.","type":"integer","minimum":0},"totalTaxAmount":{"description":"Aggregate tax amount in the currency's minor unit.","type":"integer","minimum":0},"totalTaxAmounts":{"description":"Detailed tax breakdown objects from your payment processor.","type":"array","items":{"type":"object","additionalProperties":true}},"totalTaxes":{"description":"Alternate detailed tax breakdown objects from your payment processor.","type":"array","items":{"type":"object","additionalProperties":true}}}},"RecordTransactionResponse":{"oneOf":[{"type":"object","required":["success","firstSale","duplicate","message"],"properties":{"success":{"description":"Whether the sale was recorded.","type":"boolean","const":true},"firstSale":{"description":"Whether this was the referred customer's first recorded sale.","type":"boolean"},"duplicate":{"description":"Always `false` when the sale is newly recorded.","type":"boolean","const":false},"message":{"description":"Human-readable result message for the sale.","type":"string"}}},{"type":"object","required":["success","duplicate","commissionsCreated","duplicateFields","matchingCommissionIds","message"],"properties":{"success":{"description":"Always `false` when the sale matched an existing transaction.","type":"boolean","const":false},"duplicate":{"description":"Always `true` when the sale matched an existing transaction.","type":"boolean","const":true},"commissionsCreated":{"description":"Number of commissions created by this duplicate request.","type":"integer"},"duplicateFields":{"description":"Identifier fields that matched an existing transaction.","type":"array","items":{"type":"string"}},"matchingCommissionIds":{"description":"Commission IDs that matched the submitted identifiers.","type":"array","items":{"type":"string"}},"message":{"description":"Human-readable result message for the duplicate sale.","type":"string"}}}]},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/transaction":{"post":{"tags":["Affiliate Programs"],"operationId":"recordTransaction","summary":"Record affiliate transaction","description":"**Affiliate programs only.** Records a sale made by a referred customer and generates affiliate commissions for their referrer when applicable. Requires at least one transaction identifier (externalId, transactionId, orderId, paymentId, invoiceId, paymentIntentId, or chargeId) so repeated requests can be de-duplicated — without one, a resent sale would create a second commission. Reuse the same identifier(s) when refunding.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordTransactionRequest"}}}},"responses":{"200":{"description":"Transaction result returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordTransactionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Refund or amend affiliate transaction

> \*\*Affiliate programs only.\*\* Records an amendment (refund, partial refund, refund cancellation, or chargeback) against a previously recorded transaction and reverses or adjusts the referrer's commission. The inverse of Record Affiliate Transaction. Identify the original transaction with the same identifier(s) you sent when recording it. Commissions already paid out to the affiliate are not clawed back; the amendment is recorded for tax reporting only.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Affiliate Programs","description":"Affiliate transaction, commission, and payout operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}}},"schemas":{"RefundTransactionRequest":{"type":"object","description":"At least one transaction identifier (externalId, transactionId, orderId, paymentId, invoiceId, paymentIntentId, or chargeId) is required to locate the original transaction. Send the same one(s) you used when recording the transaction.","properties":{"amendmentType":{"type":"string","enum":["REFUND","CHARGEBACK"],"default":"REFUND","description":"REFUND covers full refunds, partial refunds, and refund cancellations; CHARGEBACK is always a full reversal."},"amountRefunded":{"type":"integer","minimum":0,"description":"Cumulative amount refunded so far, in the currency's minor unit. Omit for a full refund. For a partial refund send the running total, not the per-refund delta."},"amount":{"type":"integer","minimum":1,"description":"Original sale gross (minor units). Optional — the value stored when the transaction was recorded is used when available; only needed for partial refunds of older records."},"refundId":{"type":"string","maxLength":500,"description":"Stable per-refund identifier. Recommended for partial refunds so repeated calls stay idempotent."},"refundStatus":{"type":"string","maxLength":500,"description":"Refund status. Send \"canceled\" with a lowered amountRefunded to restore a previously reduced commission."},"refundAmount":{"type":"integer","minimum":0,"description":"The per-refund delta (minor units). Optional bookkeeping field."},"currency":{"type":"string","minLength":3,"maxLength":3,"pattern":"^[A-Za-z]{3}$","description":"3-letter ISO currency. Optional — resolved from the original commission when available."},"externalId":{"description":"Original transaction identifier from your billing system.","type":"string","maxLength":500},"transactionId":{"description":"Original transaction identifier to match against.","type":"string","maxLength":500},"orderId":{"description":"Original order identifier to match against.","type":"string","maxLength":500},"paymentId":{"description":"Original payment identifier to match against.","type":"string","maxLength":500},"invoiceId":{"description":"Original invoice identifier to match against.","type":"string","maxLength":500},"paymentIntentId":{"description":"Original payment intent identifier to match against.","type":"string","maxLength":500},"chargeId":{"description":"Original charge identifier to match against.","type":"string","maxLength":500},"description":{"description":"Freeform amendment description shown in dashboard context and reports.","type":"string","maxLength":500}}},"RefundTransactionResponse":{"type":"object","required":["success","amendmentType","matched","reversed","adjusted","deleted","matchingCommissionIds","message"],"properties":{"success":{"type":"boolean","description":"true when the amendment was processed (including the tax-only case for already-paid commissions); false when no matching transaction was found."},"notFound":{"type":"boolean","description":"Present and true when no commission matched the provided identifiers."},"amendmentType":{"description":"Amendment type that was processed.","type":"string","enum":["REFUND","CHARGEBACK"]},"matched":{"type":"integer","description":"Number of commissions found for the provided identifiers."},"reversed":{"type":"integer","description":"Number of commissions reversed (set to zero amount)."},"adjusted":{"type":"integer","description":"Number of commissions partially adjusted."},"deleted":{"description":"Number of pending commissions deleted by the amendment.","type":"integer"},"matchingCommissionIds":{"description":"Commission IDs that matched the submitted identifiers.","type":"array","items":{"type":"string"}},"message":{"description":"Human-readable result message for the amendment.","type":"string"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/transaction/refund":{"post":{"tags":["Affiliate Programs"],"operationId":"refundTransaction","summary":"Refund or amend affiliate transaction","description":"**Affiliate programs only.** Records an amendment (refund, partial refund, refund cancellation, or chargeback) against a previously recorded transaction and reverses or adjusts the referrer's commission. The inverse of Record Affiliate Transaction. Identify the original transaction with the same identifier(s) you sent when recording it. Commissions already paid out to the affiliate are not clawed back; the amendment is recorded for tax reporting only.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundTransactionRequest"}}}},"responses":{"200":{"description":"Amendment result returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundTransactionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## List participant commissions

> \*\*Affiliate programs only.\*\* Retrieves a paged list of all participant commissions in an affiliate program.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Affiliate Programs","description":"Affiliate transaction, commission, and payout operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"CommissionStatus":{"name":"status","in":"query","required":false,"description":"Participant commission status.","schema":{"$ref":"#/components/schemas/CommissionStatus"}}},"schemas":{"CommissionStatus":{"type":"string","enum":["PENDING","APPROVED","PAID","REVERSED","DELETED"]},"ParticipantCommissionListResponse":{"type":"object","required":["commissions","limit","nextId"],"properties":{"commissions":{"description":"Participant commissions returned for this page.","type":"array","items":{"$ref":"#/components/schemas/ParticipantCommission"}},"limit":{"description":"Maximum number of commissions requested for this page.","type":"integer"},"nextId":{"description":"Commission ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]}}},"ParticipantCommission":{"type":"object","description":"**Affiliate programs only.** A commission generated for a (referrer) participant in an affiliate program.","required":["id","referrerId","referredId","amount","saleAmount","currencyISO","status","createdAt"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant commission."},"referrerId":{"type":"string","readOnly":true,"description":"The participant ID of the referrer who earned the commission."},"referredId":{"type":"string","readOnly":true,"description":"The participant ID of the referred friend (the conversion that triggered the commission)."},"amount":{"type":["integer","null"],"readOnly":true,"description":"Commission amount (what the affiliate earned) in the currency's smallest denomination (e.g., `100` cents equals $1.00 USD, and `100` equals ¥100 for a zero-decimal currency). Always non-negative when present; `null` if it could not be computed."},"saleAmount":{"type":["integer","null"],"readOnly":true,"description":"The sale amount from the transaction the referral paid, in the currency's smallest denomination. Always non-negative when present; `null` for commissions whose provider does not report a sale amount."},"currencyISO":{"type":"string","readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the commission (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CommissionStatus","readOnly":true,"description":"Current lifecycle state of the commission."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was approved. `null` until the commission transitions to `APPROVED`."},"paidAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was sent in a payout. `null` until the commission transitions to `PAID`."},"reversedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was reversed (for example, due to a refund or chargeback). `null` unless the commission transitions to `REVERSED`."},"holdDuration":{"type":["integer","null"],"readOnly":true,"description":"Number of days the commission must age before it can be processed for payout. Defaults to `0` (no hold)."},"payoutQueuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was queued for payout. `null` if it has not been scheduled."},"provider":{"type":["string","null"],"readOnly":true,"description":"Origin of the commission event. For example, `stripe` or `api`."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission record was created."},"amountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"Commission amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the commission is still pending FX conversion."},"saleAmountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"The sale amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the commission is still pending FX conversion."},"exchangeRate":{"type":["number","null"],"readOnly":true,"description":"The currency exchange rate used for conversion. `null` if the commission is still pending FX conversion."},"campaignCurrencyISO":{"type":["string","null"],"readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the program used in currency conversion (e.g., `USD`, `GBP`). `null` if the commission is still pending FX conversion."},"exchangeRateAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the currency exchange rate was received. `null` if the commission is still pending FX conversion."},"fxError":{"type":["string","null"],"readOnly":true,"description":"If there was an error with FX conversion, the specific details. `null` if conversion was successful."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/commissions":{"get":{"tags":["Affiliate Programs"],"operationId":"listCommissions","summary":"List participant commissions","description":"**Affiliate programs only.** Retrieves a paged list of all participant commissions in an affiliate program.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/NextId"},{"$ref":"#/components/parameters/Limit100"},{"$ref":"#/components/parameters/CommissionStatus"}],"responses":{"200":{"description":"Participant commissions returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantCommissionListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## List commissions for a participant

> \*\*Affiliate programs only.\*\* Retrieves a paged list of commissions earned by a participant.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Affiliate Programs","description":"Affiliate transaction, commission, and payout operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"CommissionStatus":{"name":"status","in":"query","required":false,"description":"Participant commission status.","schema":{"$ref":"#/components/schemas/CommissionStatus"}}},"schemas":{"CommissionStatus":{"type":"string","enum":["PENDING","APPROVED","PAID","REVERSED","DELETED"]},"ParticipantCommissionListResponse":{"type":"object","required":["commissions","limit","nextId"],"properties":{"commissions":{"description":"Participant commissions returned for this page.","type":"array","items":{"$ref":"#/components/schemas/ParticipantCommission"}},"limit":{"description":"Maximum number of commissions requested for this page.","type":"integer"},"nextId":{"description":"Commission ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]}}},"ParticipantCommission":{"type":"object","description":"**Affiliate programs only.** A commission generated for a (referrer) participant in an affiliate program.","required":["id","referrerId","referredId","amount","saleAmount","currencyISO","status","createdAt"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant commission."},"referrerId":{"type":"string","readOnly":true,"description":"The participant ID of the referrer who earned the commission."},"referredId":{"type":"string","readOnly":true,"description":"The participant ID of the referred friend (the conversion that triggered the commission)."},"amount":{"type":["integer","null"],"readOnly":true,"description":"Commission amount (what the affiliate earned) in the currency's smallest denomination (e.g., `100` cents equals $1.00 USD, and `100` equals ¥100 for a zero-decimal currency). Always non-negative when present; `null` if it could not be computed."},"saleAmount":{"type":["integer","null"],"readOnly":true,"description":"The sale amount from the transaction the referral paid, in the currency's smallest denomination. Always non-negative when present; `null` for commissions whose provider does not report a sale amount."},"currencyISO":{"type":"string","readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the commission (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/CommissionStatus","readOnly":true,"description":"Current lifecycle state of the commission."},"approvedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was approved. `null` until the commission transitions to `APPROVED`."},"paidAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was sent in a payout. `null` until the commission transitions to `PAID`."},"reversedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was reversed (for example, due to a refund or chargeback). `null` unless the commission transitions to `REVERSED`."},"holdDuration":{"type":["integer","null"],"readOnly":true,"description":"Number of days the commission must age before it can be processed for payout. Defaults to `0` (no hold)."},"payoutQueuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission was queued for payout. `null` if it has not been scheduled."},"provider":{"type":["string","null"],"readOnly":true,"description":"Origin of the commission event. For example, `stripe` or `api`."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the commission record was created."},"amountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"Commission amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the commission is still pending FX conversion."},"saleAmountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"The sale amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the commission is still pending FX conversion."},"exchangeRate":{"type":["number","null"],"readOnly":true,"description":"The currency exchange rate used for conversion. `null` if the commission is still pending FX conversion."},"campaignCurrencyISO":{"type":["string","null"],"readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the program used in currency conversion (e.g., `USD`, `GBP`). `null` if the commission is still pending FX conversion."},"exchangeRateAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the currency exchange rate was received. `null` if the commission is still pending FX conversion."},"fxError":{"type":["string","null"],"readOnly":true,"description":"If there was an error with FX conversion, the specific details. `null` if conversion was successful."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/commissions":{"get":{"tags":["Affiliate Programs"],"operationId":"listParticipantCommissions","summary":"List commissions for a participant","description":"**Affiliate programs only.** Retrieves a paged list of commissions earned by a participant.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"},{"$ref":"#/components/parameters/NextId"},{"$ref":"#/components/parameters/Limit100"},{"$ref":"#/components/parameters/CommissionStatus"}],"responses":{"200":{"description":"Participant commissions returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantCommissionListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Approve participant commission

> \*\*Affiliate programs only.\*\* Approves a pending participant commission so it can become eligible for payout.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Affiliate Programs","description":"Affiliate transaction, commission, and payout operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"CommissionId":{"name":"commissionId","in":"path","required":true,"description":"Participant commission ID.","schema":{"type":"string"}}},"responses":{"Success":{"description":"Success response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InvalidState":{"description":"Resource is not in a state that permits this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"SuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether the request succeeded.","type":"boolean"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}}},"paths":{"/campaign/{id}/commission/{commissionId}/approve":{"post":{"tags":["Affiliate Programs"],"operationId":"approveCommission","summary":"Approve participant commission","description":"**Affiliate programs only.** Approves a pending participant commission so it can become eligible for payout.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/CommissionId"}],"responses":{"200":{"$ref":"#/components/responses/Success"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"406":{"$ref":"#/components/responses/InvalidState"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## Delete participant commission

> \*\*Affiliate programs only.\*\* Removes a pending participant commission.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Affiliate Programs","description":"Affiliate transaction, commission, and payout operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"CommissionId":{"name":"commissionId","in":"path","required":true,"description":"Participant commission ID.","schema":{"type":"string"}}},"responses":{"Success":{"description":"Success response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InvalidState":{"description":"Resource is not in a state that permits this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"SuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"description":"Whether the request succeeded.","type":"boolean"}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}}},"paths":{"/campaign/{id}/commission/{commissionId}":{"delete":{"tags":["Affiliate Programs"],"operationId":"deleteCommission","summary":"Delete participant commission","description":"**Affiliate programs only.** Removes a pending participant commission.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/CommissionId"}],"responses":{"200":{"$ref":"#/components/responses/Success"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"406":{"$ref":"#/components/responses/InvalidState"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## List participant payouts

> \*\*Affiliate programs only.\*\* Retrieves a paged list of all participant payouts in an affiliate program.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Affiliate Programs","description":"Affiliate transaction, commission, and payout operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"PayoutStatus":{"name":"status","in":"query","required":false,"description":"Participant payout status.","schema":{"$ref":"#/components/schemas/PayoutStatus"}}},"schemas":{"PayoutStatus":{"type":"string","enum":["UPCOMING","QUEUED","ISSUED","FAILED"]},"ParticipantPayoutListResponse":{"type":"object","required":["payouts","limit","nextId"],"properties":{"payouts":{"description":"Participant payouts returned for this page.","type":"array","items":{"$ref":"#/components/schemas/ParticipantPayout"}},"limit":{"description":"Maximum number of payouts requested for this page.","type":"integer"},"nextId":{"description":"Payout ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]}}},"ParticipantPayout":{"type":"object","description":"**Affiliate programs only.** A payout generated for a participant in an affiliate program. All payouts start with a status of `UPCOMING`, which represents an aggregation of the participant's `ParticipantCommission` amounts, and is adjusted in real time as commissions change.","required":["id","participantId","commissionIds","amount","currencyISO","status","createdAt"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant payout."},"participantId":{"type":"string","readOnly":true,"description":"The participant ID of the referrer who earned the payout."},"commissionIds":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"The IDs of the associated `ParticipantCommission`s."},"amount":{"type":"integer","readOnly":true,"description":"Payout amount in the currency's smallest denomination (e.g., `100` cents equals $1.00 USD, and `100` equals ¥100 for a zero-decimal currency). Always non-negative."},"currencyISO":{"type":"string","readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the payout (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/PayoutStatus","readOnly":true,"description":"Current lifecycle state of the payout."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout record was created."},"queuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout was queued for processing (status `QUEUED`). `null` until the payout is queued."},"issuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout was issued. `null` if the payout was not successfully issued."},"failedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout failed to be issued. `null` if the payout did not fail to be issued."},"provider":{"type":["string","null"],"readOnly":true,"description":"The payment provider used to issue the payout (e.g., `paypal`). `null` for payouts with a status of `UPCOMING`."},"amountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"Payout amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"campaignCurrencyISO":{"type":["string","null"],"readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the program used in currency conversion (e.g., `USD`, `GBP`). `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"exchangeRateAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the currency exchange rate was received. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"exchangeRate":{"type":["number","null"],"readOnly":true,"description":"The currency exchange rate used for conversion. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"fxError":{"type":["string","null"],"readOnly":true,"description":"If there was an error with FX conversion, the specific details. `null` if the payout status is `UPCOMING` or if the FX conversion was successful."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/payouts":{"get":{"tags":["Affiliate Programs"],"operationId":"listPayouts","summary":"List participant payouts","description":"**Affiliate programs only.** Retrieves a paged list of all participant payouts in an affiliate program.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/NextId"},{"$ref":"#/components/parameters/Limit100"},{"$ref":"#/components/parameters/PayoutStatus"}],"responses":{"200":{"description":"Participant payouts returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantPayoutListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```

## List payouts for a participant

> \*\*Affiliate programs only.\*\* Retrieves a paged list of payouts that belong to a participant.

```json
{"openapi":"3.1.0","info":{"title":"GrowSurf REST API","version":"2.0.0"},"tags":[{"name":"Affiliate Programs","description":"Affiliate transaction, commission, and payout operations."}],"servers":[{"url":"https://api.growsurf.com/v2","description":"Production"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`."}},"parameters":{"CampaignId":{"name":"id","in":"path","required":true,"description":"GrowSurf program ID.","schema":{"type":"string"}},"ParticipantIdOrEmail":{"name":"participantIdOrEmail","in":"path","required":true,"description":"GrowSurf participant ID or URL-encoded participant email address.","schema":{"type":"string"}},"NextId":{"name":"nextId","in":"query","required":false,"description":"ID to start the next paged result set with.","schema":{"type":"string"}},"Limit100":{"name":"limit","in":"query","required":false,"description":"Number of results to return. Maximum 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"PayoutStatus":{"name":"status","in":"query","required":false,"description":"Participant payout status.","schema":{"$ref":"#/components/schemas/PayoutStatus"}}},"schemas":{"PayoutStatus":{"type":"string","enum":["UPCOMING","QUEUED","ISSUED","FAILED"]},"ParticipantPayoutListResponse":{"type":"object","required":["payouts","limit","nextId"],"properties":{"payouts":{"description":"Participant payouts returned for this page.","type":"array","items":{"$ref":"#/components/schemas/ParticipantPayout"}},"limit":{"description":"Maximum number of payouts requested for this page.","type":"integer"},"nextId":{"description":"Payout ID to pass as `nextId` for the next page, or `null` when there are no more results.","type":["string","null"]}}},"ParticipantPayout":{"type":"object","description":"**Affiliate programs only.** A payout generated for a participant in an affiliate program. All payouts start with a status of `UPCOMING`, which represents an aggregation of the participant's `ParticipantCommission` amounts, and is adjusted in real time as commissions change.","required":["id","participantId","commissionIds","amount","currencyISO","status","createdAt"],"properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the participant payout."},"participantId":{"type":"string","readOnly":true,"description":"The participant ID of the referrer who earned the payout."},"commissionIds":{"type":"array","readOnly":true,"items":{"type":"string"},"description":"The IDs of the associated `ParticipantCommission`s."},"amount":{"type":"integer","readOnly":true,"description":"Payout amount in the currency's smallest denomination (e.g., `100` cents equals $1.00 USD, and `100` equals ¥100 for a zero-decimal currency). Always non-negative."},"currencyISO":{"type":"string","readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the payout (e.g., `USD`, `GBP`)."},"status":{"$ref":"#/components/schemas/PayoutStatus","readOnly":true,"description":"Current lifecycle state of the payout."},"createdAt":{"type":"integer","format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout record was created."},"queuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout was queued for processing (status `QUEUED`). `null` until the payout is queued."},"issuedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout was issued. `null` if the payout was not successfully issued."},"failedAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the payout failed to be issued. `null` if the payout did not fail to be issued."},"provider":{"type":["string","null"],"readOnly":true,"description":"The payment provider used to issue the payout (e.g., `paypal`). `null` for payouts with a status of `UPCOMING`."},"amountInCampaignCurrency":{"type":["integer","null"],"readOnly":true,"description":"Payout amount converted to the program's currency, in the currency's smallest denomination. Always non-negative. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"campaignCurrencyISO":{"type":["string","null"],"readOnly":true,"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code of the program used in currency conversion (e.g., `USD`, `GBP`). `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"exchangeRateAt":{"type":["integer","null"],"format":"int64","readOnly":true,"description":"UTC timestamp (in milliseconds) when the currency exchange rate was received. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"exchangeRate":{"type":["number","null"],"readOnly":true,"description":"The currency exchange rate used for conversion. `null` if the payout status is `UPCOMING` or if it is still pending FX conversion."},"fxError":{"type":["string","null"],"readOnly":true,"description":"If there was an error with FX conversion, the specific details. `null` if the payout status is `UPCOMING` or if the FX conversion was successful."}}},"Error":{"type":"object","properties":{"name":{"description":"Error name returned for the failed request.","type":"string"},"code":{"description":"Stable machine-readable error code.","type":"string"},"message":{"description":"Human-readable error message.","type":"string"},"errors":{"description":"Optional validation details for specific request fields.","type":"array","items":{"type":"object","additionalProperties":true}},"status":{"description":"HTTP status code for the error.","type":"integer"},"supportUrl":{"description":"Support URL related to the error, when available.","type":"string","format":"uri"},"policyName":{"description":"Rate-limit policy name for `429` errors, when available.","type":"string"},"level":{"description":"Error severity level, when available.","type":"string"},"timestamp":{"description":"When the error response was created.","type":"string","format":"date-time"}}}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The API key is missing, invalid, revoked, outside its scope, or not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"Request is not valid for the current program or participant state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests.","headers":{"GrowSurf-RateLimit-Second-Limit":{"description":"Number of API requests allowed per second policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Second-Remaining":{"description":"Number of API requests remaining in the second policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Second-Milliseconds":{"description":"Milliseconds until the second policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Limit":{"description":"Number of API requests allowed per minute policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Minute-Remaining":{"description":"Number of API requests remaining in the minute policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Minute-Milliseconds":{"description":"Milliseconds until the minute policy window resets.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Limit":{"description":"Number of API requests allowed per hour policy.","schema":{"type":"integer"}},"GrowSurf-RateLimit-Hour-Remaining":{"description":"Number of API requests remaining in the hour policy.","schema":{"type":"integer"}},"GrowSurf-Retry-After-Hour-Milliseconds":{"description":"Milliseconds until the hour policy window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/campaign/{id}/participant/{participantIdOrEmail}/payouts":{"get":{"tags":["Affiliate Programs"],"operationId":"listParticipantPayouts","summary":"List payouts for a participant","description":"**Affiliate programs only.** Retrieves a paged list of payouts that belong to a participant.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/ParticipantIdOrEmail"},{"$ref":"#/components/parameters/NextId"},{"$ref":"#/components/parameters/Limit100"},{"$ref":"#/components/parameters/PayoutStatus"}],"responses":{"200":{"description":"Participant payouts returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantPayoutListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
```


# API Guidelines

Follow these standard guidelines when interacting with GrowSurf APIs.

Requests

* All requests should be made using HTTPS.
* JSON objects are recommended for POST requests, but standard parameters are accepted.
* All parameters are required unless otherwise specified.

## Responses

* Data is returned in JSON.
* Any non-`200` HTTP response code can be considered an error.

{% hint style="info" %}
**Tip:** Refer to [Response Codes](/developer-tools/rest-api/api-response-codes) for help in troubleshooting any errors.
{% endhint %}

## Rate Limits

All API requests made to GrowSurf (including client and server calls) are appropriately rate-limited to prevent excessive requests. If you exceed those limits, you will start receiving 429 error responses for any API calls that you make. Those 429 responses will have the following format.

API keys and OAuth connections for the same team share the team's aggregate rate limits. Creating more credentials does not increase the team's total request capacity.

```javascript
{
    "name": "RateLimit",
    "code": "RATE_LIMIT",
    "message": "You have reached your minute limit.",
    "status": 429,
    "supportUrl": "https://growsurf.com/settings#contact_support",
    "policyName": "MINUTE",
    "level": "error",
    "timestamp": "2019-12-08T00:05:45.478Z"
}
```

The `message` and `policyName` will indicate which limit you hit (e.g. second, minute, or hour).

### Rate Headers

{% hint style="info" %}
**NOTE:** These headers are only included for requests made using an API key.
{% endhint %}

| Header                                         | Description                                                                                                                                                                                                                                                                                                |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`GrowSurf-RateLimit-Second-Limit`**          | The number of API requests that are allowed per second.                                                                                                                                                                                                                                                    |
| **`GrowSurf-RateLimit-Second-Remaining`**      | The number of API requests remaining within the second policy.                                                                                                                                                                                                                                             |
| **`GrowSurf-Retry-After-Second-Milliseconds`** | <p>The window of time that the <code>GrowSurf-RateLimit-Second-Limit</code> and <code>Growsurf-RateLimit-Second-Remaining</code> headers apply to.<br><br>For example, a value of 1000 would be a window of 1 second.</p><p>This value is only provided if the second policy is hit or exceeded.</p>       |
| **`GrowSurf-RateLimit-Minute-Limit`**          | The number of API requests that are allowed per minute.                                                                                                                                                                                                                                                    |
| **`GrowSurf-RateLimit-Minute-Remaining`**      | The number of API requests remaining within the minute policy.                                                                                                                                                                                                                                             |
| **`GrowSurf-Retry-After-Minute-Milliseconds`** | <p>The window of time that the <code>GrowSurf-RateLimit-Minute-Limit</code> and <code>Growsurf-RateLimit-Minute-Remaining</code> headers apply to.<br></p><p>For example, a value of 10000 would be a window of 10 seconds.</p><p>This value is only provided if the minute policy is hit or exceeded.</p> |
| **`GrowSurf-RateLimit-Hour-Limit`**            | The number of API requests that are allowed per hour.                                                                                                                                                                                                                                                      |
| **`GrowSurf-RateLimit-Hour-Remaining`**        | The number of API requests remaining within the hour policy.                                                                                                                                                                                                                                               |
| **`GrowSurf-Retry-After-Hour-Milliseconds`**   | <p>The window of time that the <code>GrowSurf-RateLimit-Hour-Limit</code> and <code>Growsurf-RateLimit-Hour-Remaining</code> headers apply to.<br></p><p>For example, a value of 600000 would be a window of 10 minutes.</p><p>This value is only provided if the hour policy is hit or exceeded.</p>      |

### Policies

The following are the rate limits for all API requests made using an API key.

| Policy     | Limit                   |
| ---------- | ----------------------- |
| **Second** | 50 requests / 5 seconds |
| **Minute** | 400 requests / minute   |
| **Hour**   | 20,000 requests / hour  |

### Slowdown Rate

For operations which update a resource (`PUT`, `POST`, `DELETE`), if the cumulative rate of requests exceed 60 requests per minute, a slowdown delay will be added to each request thereafter. The delay is equal to the number of exceeded requests multiplied by 100 milliseconds (ms).

**For example:**

* 61st request: 100ms delay
* 63rd request: 300ms delay
* 70th request: 1000ms delay

### Max Connections

In addition to the rate limits and slowdown rate, the number of concurrent connections to the REST API allowed per IP address is limited to three (3).

Please note that if you hit a rate limit or max connection limit, you will see a [`429` error](https://docs.growsurf.com/api-response-codes#glossary).

### Suggestions

Here are some suggestions for using the GrowSurf API within policy limits.

#### 1. Cache data for repeat calls

If your site or app uses data from GrowSurf on each page load, that data should be cached and loaded from that cache instead of being requested from the GrowSurf APIs each time. If you're making repeated requests to get participant information or program data for a custom implementation, the information from those calls should also be cached when possible.

#### 2. Use Webhooks to get updated data from GrowSurf

Webhooks are an excellent way for your application to receive updated information from GrowSurf without needing to call GrowSurf APIs. More details about using Webhooks can be found [here](/developer-tools/webhooks), with example data [here](https://docs.growsurf.com/developer-tools/webhooks/examples).

## Metadata

Certain GrowSurf objects, such as [`Participants`](/developer-tools/rest-api/api-objects#participant) and [`Rewards`](/developer-tools/rest-api/api-objects#reward) can have a special `metadata`parameter, which is useful for storing any custom information.

Learn more here:

{% content-ref url="/pages/KdcA4HSS8K9pL0VdjLEP" %}
[Metadata](/developer-tools/metadata)
{% endcontent-ref %}


# API Response Codes

Refer to the below response code glossary to help you troubleshoot any errors.

## Glossary

| **Response Code**                | **Messages**                                                                                                                                          | **Explanation**                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200 OK`                         | The request was successful!                                                                                                                           | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `400 Bad Request`                | Request validation failed on an input.                                                                                                                | <p>Check that your inputs are entered correctly.</p><p>Note that participant lookups return a <code>400</code> (not a <code>404</code>) when no participant exists for the given ID or email, and emailing a participant returns a <code>400</code> if they have unsubscribed.</p>                                                                                                                                                        |
| `402 Usage Limit`                | Usage limit exceeded.                                                                                                                                 | You've reached a plan limit (such as your participant usage limit, or your plan's program limit when creating a program) and will need to upgrade to the next tier.                                                                                                                                                                                                                                                                       |
| `402 Payment Method Required`    | You must add a payment method to your account to use the REST API for affiliate programs.                                                             | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `403 Not Authorized`             | <p>You are not allowed to perform that action.</p><p><br>Or no valid participant access token provided.</p>                                           | <p>Your API key may be missing, revoked, contain a typo, lack the required scope, or be limited to different programs. You may also be trying to access a program outside the team or program list assigned to the API key.<br><br>Verify that your API key has the required scope and program access. To create or change keys in Settings, use an owner, Admin, or teammate with Manage API access.</p>                                 |
| `403 Paid Plan Required`         | A paid plan is required to use the GrowSurf REST API                                                                                                  | A paid plan is required to use the REST API with referral programs. For affiliate programs, a payment method on file is required instead (see `402 Payment Method Required`).                                                                                                                                                                                                                                                             |
| `403 Email Not Verified`         | The team owner email address must be verified to use this endpoint. Check the owner inbox, or resend it via `POST /v2/team/owner/verification-email`. | Program and resource endpoints remain locked until the owner verifies the email address. Check the team's GrowSurf verification state with `GET /v2/team`.                                                                                                                                                                                                                                                                                |
| `403 Account Disabled`           | This account has been disabled.                                                                                                                       | The team bound to the API key has been disabled. Please [contact support](https://app.growsurf.com/#contact_support) if you believe this is a mistake.                                                                                                                                                                                                                                                                                    |
| `404 Resource Not Found`         | The requested resource does not exist.                                                                                                                | You may be trying to request a resource that does not exist or was deleted.                                                                                                                                                                                                                                                                                                                                                               |
| `406 Invalid State`              | The resource is not in a state that permits this operation.                                                                                           | The resource cannot be changed from its current state — for example, approving or fulfilling a participant reward that has already been fulfilled, or approving a commission that has already been paid out.                                                                                                                                                                                                                              |
| `409 Conflict Duplicate Request` | Conflicting duplicate request.                                                                                                                        | <p>An identical request is already in progress — wait for it to complete before retrying.</p><p>When creating an account, a <code>409</code> means an account with this email already exists.</p>                                                                                                                                                                                                                                         |
| `422 Unprocessable Entity Error` | This endpoint is only available for referral programs. Your program is an affiliate program.                                                          | You may be trying to call an endpoint that is only valid to referral programs (or vice versa with affiliate programs).                                                                                                                                                                                                                                                                                                                    |
| `422 Participant Blocked`        | Participant was detected as a high-risk fraudster and was blocked from joining.                                                                       | <p>The person may be a high-risk fraudster, and has been blocked from entering the program. <a href="https://support.growsurf.com/article/195-what-does-the-growsurf-anti-fraud-system-entail">Learn more about how GrowSurf's anti-fraud system works</a>.<br><br>Please check that your program's anti-fraud settings are not set to <em>Strict</em>, or that you do not have the email or IP address blacklisted.</p>                  |
| `429 Too Many Requests`          | You have reached a rate limit.                                                                                                                        | <p>You have sent too many requests in a given time. Some operations (such as creating accounts or sending participant emails) have their own stricter limits.<br><br>See <a href="https://docs.growsurf.com/developer-tools/rest-api/api-guidelines#rate-limits">Rate Limits</a> and <a href="https://docs.growsurf.com/developer-tools/rest-api/api-guidelines#max-connections">Max Connections</a> for more details on rate limits.</p> |
| `5XX Internal Server Error`      | The GrowSurf server is inaccessible or offline -- that's our fault! Check for updates on our [status page](https://growsurf.com/status).              | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                       |


# API Libraries

Official GrowSurf API libraries for popular languages like TypeScript, Python, PHP, Ruby, and Java.

The following official API libraries provide convenient access to the [GrowSurf REST API](https://docs.growsurf.com/developer-tools/rest-api).

{% hint style="info" %}
These libraries are for server-side REST API integrations. For native mobile apps, use the [iOS SDK](/developer-tools/ios-sdk) or [Android SDK](/developer-tools/android-sdk) instead.
{% endhint %}

Click on a library's *Installation* link to get started.

| Language                                                                       | Library                                                                  | Get Started                                                                  |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| <img src="/files/Sdc7bnaXBqMsxCLXHkCN" alt="" data-size="line"> **TypeScript** | [`growsurf-typescript`](https://github.com/growsurf/growsurf-typescript) | [Installation](https://github.com/growsurf/growsurf-typescript#installation) |
| <img src="/files/cdSznfSzW2DHIazXtByl" alt="" data-size="line"> **Python**     | [`growsurf-python`](https://github.com/growsurf/growsurf-python)         | [Installation](https://github.com/growsurf/growsurf-python#installation)     |
| <img src="/files/yXkhXr6IBIvjeZaaCxrP" alt="" data-size="line"> **PHP**        | [`growsurf-php`](https://github.com/growsurf/growsurf-php)               | [Installation](https://github.com/growsurf/growsurf-php#installation)        |
| <img src="/files/6qxTCZuWoLOFcTrECiFo" alt="" data-size="line"> **Ruby**       | [`growsurf-ruby`](https://github.com/growsurf/growsurf-ruby)             | [Installation](https://github.com/growsurf/growsurf-ruby#installation)       |
| <img src="/files/Ha2L4YJGdHz9ydpbcZ0j" alt="" data-size="line"> **Java**       | [`growsurf-java`](https://github.com/growsurf/growsurf-java)             | [Installation](https://github.com/growsurf/growsurf-java#installation)       |


# Webhooks

Webhooks send data to your server when important events occur in your referral/affiliate program. This lets you automatically fulfill rewards or update users in your database.

{% hint style="info" %}
If you're using an AI tool such as Cursor, Codex, Claude Code, or Antigravity to help you implement GrowSurf, we recommend utilizing our [MCP server](https://docs.growsurf.com/build-with-ai).
{% endhint %}

## Example scenarios

Here are a few scenarios in which you would use webhooks:

* If you have an internal points system, webhooks allow you to add credits to users in your database whenever a referral occurs.
* When a new participant joins your referral or affiliate program, webhooks let you store their unique referral link (along with other participant details) in your database.

## Getting started

### Step 1: Add a webhook URL to your program

1. Go to the *Options* step in the *Program Editor*.
2. In the *Set up integrations* sectio&#x6E;*,* click the *Webhooks* card. Then enter your webhook endpoint URL.
3. Publish/save your changes.

<figure><img src="/files/98Sj28pipvwcGB1GdPuC" alt=""><figcaption><p>Webhooks can be configured in the Options step in the Program Editor</p></figcaption></figure>

{% hint style="info" %}
**Tips:**

* You can test your webhook URL to see if it is set up properly and/or to see the different types of data from each webhook event. Simply click the *Test* button right next to the webhook URL input field.
* You can select the specific events to receive within the *advanced webhook settings* section.
* A total of 5 webhooks can be added per program.
  {% endhint %}

## **Retry logic**

If we are unable to deliver a webhook the first time, GrowSurf will attempt to redeliver your webhooks for several days with an exponential back off. After several days of failed attempts we will mark the webhook as undeliverable and it will no longer be retried.

Webhook events are stored durably, so if delivery is ever interrupted, they will be retried once service is restored. You can always check our [System Status page](https://growsurf.com/status) for webhook health.

## **Next steps**

View [Examples](/developer-tools/webhooks/examples) of implementing webhooks, or view what the request payloads for webhook events look like:

* [When a participant reaches a reward goal](/developer-tools/webhooks/events-reference#participant_reached_a_goal)
* [When a new participant is added to the program](https://docs.growsurf.com/developer-tools/webhooks/events-reference#new_participant_added)
* [When the program ends](https://docs.growsurf.com/developer-tools/webhooks/events-reference#campaign_ended)


# Securing Your Webhooks (optional)

This is an optional step. For security purposes, you can add a webhook secret to limit requests sent to your webhook endpoint to those only coming from GrowSurf.

## Adding a secret

1. Go to the *Options* step in the *Program Editor*.
2. In the Webhooks integration, click *Show advanced webhook settings* and enter the secret (it can be any string of text).
3. Publish/save your changes.

![](/files/-M3vdyAlJ0GLVsKTKcLy)

{% hint style="info" %}
Once your program has a webhook secret, a signature `GrowSurf-Signature` will be included in the header of all outgoing requests to your webhook endpoint.
{% endhint %}

## Validating payloads

When your secret token has been set, GrowSurf uses it to create a hash signature to include in the header of each event notification payload.\
\
The signature hash is passed along with each request in the header as `GrowSurf-Signature`. You will need to compute a hash once the payload is received and compare it against the `GrowSurf-Signature` value provided by GrowSurf within the header. Those steps are outlined below.

{% hint style="info" %}
The `GrowSurf-Signature` header contains a timestamp and a signature hash value. The timestamp is prefixed by `ts=`, and the signature value is prefixed by `v=`.
{% endhint %}

### **Step 1: Extract the timestamp and signature from the header**

Split the header using the `,` character as the separator to get a list of elements. Then split each element using the `=` character as the separator to get a key/value pair.\
\
The value for key/prefix `ts` corresponds to the timestamp and the `v` key/prefix corresponds to the signature you will use to compare your generated hash against.

{% hint style="info" %}
NOTE: `ts` is a Unix timestamp in milliseconds
{% endhint %}

### **Step 2: Prepare the signed payload string for comparison**

Achieve this by concatenating:

* The timestamp (as a string). AKA the value of `ts`
* The character `.`
* The actual JSON payload within the request body

### **Step 3: Determine the expected signature**

Compute an *HMAC* with a `SHA256` hash function. Use the endpoint's signing secret token as the key (which you added in the *Options* step in the *Program Editor*), and use the signed payload string from **Step 2** as the message.

### **Step 4: Compare signatures**

Compare the GrowSurf provided signature within the header to the expected signature. If they match then compute the difference between a current timestamp and the received timestamp `ts`. Then decide if the difference is within your tolerance.

{% hint style="info" %}
**Tip:** The timestamp comparison is completely optional but it will help to protect against timing attacks.
{% endhint %}

## View an example

[View an example here](/developer-tools/webhooks/examples#example-1-webhooks-with-secret)


# Examples

How to implement Webhooks for your GrowSurf program.

## Example 1: Webhooks

Below is a **Node.js + Express** example of what the code for your webhook endpoint could look like:

```javascript
//Your webhooks payload endpoint
app.post("/your/webhook/payload-url", function(req, res) {
  const body = req.body;
  
  try {
    if (body.event === 'PARTICIPANT_REACHED_A_GOAL') {
      // Write code here to do something when a participant wins a reward
      console.log(`${body.data.participant.email} just won this reward: ${body.data.reward.description}`);

      // If the reward is approved
      if (body.data && body.data.reward && body.data.reward.approved) {
        // Do something
      }
      
      // If this is a double-sided reward, use body.data.reward.isReferrer to determine if this is for the referrer or referred person
      if (body.data && body.data.reward && body.data.reward.isReferrer) {
        // Do something
        
        // Optional: If you set metadata on the CampaignReward object, you can reference it:
        if (body.data.reward.metadata && body.data.reward.metadata["proRewardValue"]) {
            console.log(`${body.data.participant.email} earned an amount of ${body.data.reward.metadata["proRewardValue"]}.`);
        }
      }
      
      // Optional: If this is the referrer that unlocked the reward, you can get the details of the person that they referred
      if (body.data.reward.isReferrer && body.data.participant.referee) {
          console.log(`${body.data.participant.referee.email} was the person referred by ${body.data.participant.email}.`);
      }      

    } else if (body.event === 'NEW_PARTICIPANT_ADDED') {
      // Write code here to do something when a new participant is added    
      console.log(`${body.data.email} just joined via source: ${body.data.referralSource}.`);
            
    } else if (body.event === 'CAMPAIGN_ENDED') {
      // Write code here to do something when a program ends
      console.log(`${body.data.name} just ended with ${body.data.referralCount} total referrals!`);
            
    }
  
  } catch (err) {
    res.status(400).end();
  }
  res.json({received: true});
});
```

{% hint style="info" %}
**Helpful tips:**

* To see the different sample data from webhook request payloads, see [Events](/developer-tools/webhooks/events-reference)
* If you reference [reward metadata](https://docs.growsurf.com/developer-tools/webhooks/events-reference#campaign_ended) in your *New Participant Reward* events, your marketing team can update these values anytime in the future from the Program Editor without getting developers involved.
  {% endhint %}

## Example 2: Webhooks (with secret)

Below is a **Node.js + Express** example (using the [crypto-js](https://github.com/brix/crypto-js) library) of what the code for your webhook endpoint could look like:

```javascript
//Your webhooks payload endpoint
app.post("/your/webhook/payload-url", function(req, res) {
  const body = req.body;
  const signature = req.get("GrowSurf-Signature");
  
  try {
    // Validate the signature
    validateSignature(body, signature);
  
    // Do work!.....
    // Write your code in here...  
  
  } catch (err) {
    res.status(400).end();
  }
  res.json({received: true});
});

/**
 * Compares the GrowSurf header provided signature against the expected
 * signature.
 *
 * @param {Object} body the request body provided by GrowSurf
 * @param {String} signature the signature hash value provided within the header of the request
 * @returns {Boolean} valid true if the expected matches the given
 * @throws {Exception} thrown if the expected signature value does not match the given
 */
const validateSignature = function(body, signature) {
  // Extract
  let parts = signature.split(",");
  // t value
  let timestamp = parts[0].split("=")[1];
  // v value
  let hash = parts[1].split("=")[1];
  // Generate hash
  let message = (timestamp + "." + JSON.stringify(body));
  let expected = CryptoJS.HmacSHA256(message, "YOUR-SECRET-TOKEN").toString();

  // Validate/Compare
  if(expected === hash) {
    return true;
  } else {
    throw new Error("Invalid Signature");
  }
}
```


# Events Reference

Below are sample request payloads you will receive based on the webhook event types you have selected for your program.

## Overview

* **`PARTICIPANT_REACHED_A_GOAL`** - <mark style="color:orange;">Referral programs only.</mark> When a participant unlocks a new reward.
* **`NEW_PARTICIPANT_ADDED`** - When a new participant is added to the program (includes direct signups, referrals, and participants added/imported via admin dashboard).
* **`PARTICIPANT_FRAUD_STATUS_UPDATED`** - When an existing participant's fraud status changes.
* **`NEW_COMMISSION_ADDED`** - <mark style="color:orange;">Affiliate programs only.</mark> When a new commission is generated for an affiliate.
* **`COMMISSION_ADJUSTED`** - <mark style="color:orange;">Affiliate programs only.</mark> When an existing commission is adjusted (refunds, chargebacks, or refund cancellations).
* **`NEW_PAYOUT_ISSUED`** - <mark style="color:orange;">Affiliate programs only.</mark> When a payout is successfully issued to an affiliate.
* **`CAMPAIGN_ENDED`** - When the program ends.

***

## `PARTICIPANT_REACHED_A_GOAL`

<mark style="color:orange;">Referral programs only</mark>

**Description:** When a participant unlocks a new reward.

{% hint style="info" %}
**Important notes:**

* **For double-sided rewards,** **two events will be sent for both referrer and referee**. To discern between the two, use the `data.reward.isReferrer` property (the referrer will have `isReferrer` as `true`).
  * You can confirm this by examining `data.reward.referrerId` and `data.reward.referredId` and comparing it with `data.participant.id`.
  * If the reward is for the referrer, you can view the person they referred by accessing `data.participant.referee`.
  * If the reward is for the referred friend, you can view the person who referred them by accessing `data.participant.referrer`.
* **If you have manual reward approval enabled for your program, events will be sent twice: (1) when the reward is pending approval and (2) when the reward is approved.** To discern between unapproved/approved rewards, use the `data.reward.approved` property (approved rewards will have `approved` as `true`).
* The `data.reward` object contains combined data from the [`CampaignReward`](https://docs.growsurf.com/developer-tools/rest-api/api-objects#reward) and [`ParticipantReward`](https://docs.growsurf.com/developer-tools/rest-api/api-objects#reward).
  * `data.reward.rewardId` represents the ID of the `CampaignReward` and will always be the same. You can find this ID from *Program Editor > 1. Rewards* and clicking the reward.
  * `data.reward.id` represents the ID of the `ParticipantReward` that was unlocked for the participant. This will be different for every new reward that the participant earns. You can find this ID by going to your admin dashboard and viewing the participant's rewards.
    {% endhint %}

Here is an example event of a `PARTICIPANT_REACHED_A_GOAL` event where the reward is for the referrer because `data.reward.isReferrer` is `true`. The person they referred is reflected in `data.participant.referee`.

If this reward was for the referred person, then `data.reward.isReferrer` would be `false`. And the person that referred them would be accessible from `data.participant.referrer`.

```json
{
  "event": "PARTICIPANT_REACHED_A_GOAL",
  "createdAt": 1558345202613,
  "data": {
    "participant": {
      "id": "x9a7uu",
      "email": "richard@piedpiper.com",
      "firstName": "Richard",
      "lastName": "Hendricks",
      "notes": "",
      "isWinner": true,
      "referralCount": 11,
      "monthlyReferralCount": 8,
      "prevMonthlyReferralCount": 0,
      "vanityKeys": [],
      "shareUrl": "http://piedpiper.com?grsf=x9a7uu",
      "impressionCount": 309,
      "uniqueImpressionCount": 285,
      "shareCount": 163,
      "createdAt": 1554431962667,
      "referralSource": "DIRECT",
      "fraudRiskLevel": "LOW",
      "fraudReasonCode": "UNIQUE_IDENTITY",
      "metadata": {
        "piedPiperUserId": "12a39-8aajd-1dwiq",
        "companyName": "Pied Piper, Inc",
        "teamSize": "1-10"
      },
      "unsubscribed": false,
      "referee": {
        "id": "uxjbxu",
        "createdAt": 1738485195346,
        "email": "i_was_referred@somesite.com",
        "firstName": "Billy",
        "lastName": "Smith",
        "notes": "",
        "isWinner": false,
        "referralCount": 0,
        "monthlyReferralCount": 0,
        "prevMonthlyReferralCount": 0,
        "vanityKeys": [],
        "shareUrl": "http://piedpiper.com?grsf=uxjbxu",
        "referralSource": "PARTICIPANT",
        "fraudRiskLevel": "LOW",
        "fraudReasonCode": "UNIQUE_IDENTITY",
        "impressionCount": 0,
        "uniqueImpressionCount": 0,
        "shareCount": 0,
        "metadata": {},
        "unsubscribed": false
      }
    },
    "reward": {
      "approved": true,
      "conversionsRequired": 1,
      "couponCode": "PROMO_20_OFF",
      "createdAt": 1542560101404,
      "approvedAt": 1659474941892,
      "fulfilledAt": null,
      "description": "Win a free t-shirt when you refer a friend to sign up to Pied Piper!",
      "imageUrl": "https://example.com/reward-image.png",
      "limit": 3,
      "title": "Early-Bird Reward",
      "isReferrer": true,
      "type": "SINGLE_SIDED",
      "rewardId": "crew_xlj123",
      "id": "prew_ccm2ue",
      "referredId": "ad3dfa",
      "referrerId": "x9a7uu",
      "metadata": {
        "foo": "bar",
        "amount": "$25",
        "points": 1000
      }
    },
    "campaign": {
      "id": "ct8f71",
      "name": "Middle Out Compression Campaign",
      "type": "REFERRAL",
      "currencyISO": "USD",
      "rewards": [
        {
          "title": "Early-Bird Reward",        
          "id": "crew_xlj123",
          "type": "SINGLE_SIDED",
          "description": "Win a free t-shirt when you refer a friend to sign up to Pied Piper!",
          "referralDescription": null,          
          "isActive": true,
          "isVisible": true,
          "isUnlimited": true,
          "limit": 3,          
          "limitDuration": "IN_TOTAL",
          "conversionsRequired": 1,
          "numberOfWinners": 3,
          "imageUrl": "https://example.com/reward-image.png",                    
          "order": null,
          "couponCode": "PROMO_20_OFF",
          "nextMilestonePrefix": "You are only",
          "nextMilestoneSuffix": "referrals away from receiving a nice reward!",
          "metadata": {
            "foo": "bar",
            "amount": "$25",
            "points": 1000
          }        
        }
      ]
    }
  }
}
```

***

## `NEW_PARTICIPANT_ADDED`

**Description:** When a new participant is added to the program (includes direct signups, referrals, and participants added/imported via admin dashboard).

Here is an example event of a `NEW_PARTICIPANT_ADDED` event where the newly added participant was referred. The person that referred them is reflected in `data.referrer`. If the participant was not referred, then `data.referrer` will not exist.

```json
{
  "event": "NEW_PARTICIPANT_ADDED",
  "createdAt": 1558345215720,
  "data": {
    "id": "p88y0a",
    "email": "gavin.belson@hooli.com",
    "firstName": "Gavin",
    "lastName": "Belson",
    "notes": "This is obviously our competitor trying out our product!",
    "isWinner": false,
    "shareUrl": "http://piedpiper.com?grsf=p88y0a",
    "referralCount": 0,
    "monthlyReferralCount": 0,
    "prevMonthlyReferralCount": 0,
    "vanityKeys": [],
    "impressionCount": 0,
    "uniqueImpressionCount": 0,
    "shareCount": 3,
    "createdAt": 1554479231190,
    "referralSource": "PARTICIPANT",
    "fraudRiskLevel": "LOW",
    "fraudReasonCode": "UNIQUE_IDENTITY",
    "referredBy": "x9a7uu",
    "referrer": {
      "id": "x9a7uu",
      "email": "richard@piedpiper.com",
      "firstName": "Richard",
      "lastName": "Hendricks",
      "notes": "",
      "isWinner": true,
      "referralCount": 11,
      "monthlyReferralCount": 8,
      "prevMonthlyReferralCount": 0,
      "vanityKeys": [],
      "shareUrl": "http://piedpiper.com?grsf=x9a7uu",
      "impressionCount": 309,
      "uniqueImpressionCount": 285,
      "shareCount": 163,
      "createdAt": 1554431962667,
      "referralSource": "PARTICIPANT",
      "fraudRiskLevel": "LOW",
      "fraudReasonCode": "UNIQUE_IDENTITY",
      "metadata": {
        "piedPiperUserId": "12a39-8aajd-1dwiq",
        "companyName": "Pied Piper, Inc",
        "teamSize": "1-10"
      },
      "unsubscribed": false
    },
    "metadata": {
      "piedPiperUserId": "au71p-121x9-88faa",
      "companyName": "Hooli, Inc",
      "teamSize": "10,000+"
    },
    "unsubscribed": false,
    "campaign": {
      "id": "ct8f71",
      "name": "Middle Out Compression Campaign",
      "type": "REFERRAL",
      "currencyISO": "USD",
      "rewards": [
        {
          "title": "Early-Bird Reward",        
          "id": "crew_xlj123",
          "type": "SINGLE_SIDED",
          "description": "Win a free t-shirt when you refer a friend to sign up to Pied Piper!",
          "referralDescription": null,          
          "isActive": true,
          "isVisible": true,
          "isUnlimited": true,
          "limit": 3,
          "limitDuration": "IN_TOTAL",
          "conversionsRequired": 1,
          "numberOfWinners": 3,
          "imageUrl": "https://example.com/reward-image.png",                    
          "order": null,
          "couponCode": "PROMO_20_OFF",
          "nextMilestonePrefix": "You are only",
          "nextMilestoneSuffix": "referrals away from receiving a nice reward!",
          "metadata": {
            "foo": "bar",
            "amount": "$25",
            "points": 1000
          }        
        }
      ]
    }    
  }
}
```

***

## `NEW_COMMISSION_ADDED`

<mark style="color:orange;">Affiliate programs only</mark>

**Description:** When a new commission is generated for an affiliate.

```json
{
  "event": "NEW_COMMISSION_ADDED",
  "createdAt": 1558345215720,
  "data": {
    "participant": {
      "id": "p88y0a",
      "email": "gavin.belson@hooli.com",
      "firstName": "Gavin",
      "lastName": "Belson",
      "notes": "",
      "isWinner": false,
      "shareUrl": "http://piedpiper.com?grsf=p88y0a",
      "referralCount": 1,
      "monthlyReferralCount": 0,
      "prevMonthlyReferralCount": 0,
      "vanityKeys": [],
      "impressionCount": 2,
      "uniqueImpressionCount": 2,
      "shareCount": 3,
      "createdAt": 1554479231190,
      "referralSource": "DIRECT",
      "fraudRiskLevel": "LOW",
      "metadata": {},
      "unsubscribed": false
    },
    "referredParticipant": {
      "id": "xh345d",
      "email": "dinesh@piedpiper.com",
      "firstName": "Dinesh",
      "lastName": "Chugtai",
      "notes": "",
      "isWinner": false,
      "shareUrl": "http://piedpiper.com?grsf=xh345d",
      "referralCount": 0,
      "monthlyReferralCount": 0,
      "prevMonthlyReferralCount": 0,
      "vanityKeys": [],
      "impressionCount": 0,
      "uniqueImpressionCount": 0,
      "shareCount": 0,
      "createdAt": 1554479231190,
      "referralSource": "PARTICIPANT",
      "fraudRiskLevel": "LOW",
      "metadata": {},
      "unsubscribed": false
    },
    "campaign": {
      "id": "ct8f71",
      "name": "Middle Out Compression Campaign",
      "type": "AFFILIATE",
      "currencyISO": "USD",
      "rewards": []
    },
    "commission": {
      "id": "comm_jp1ku7",
      "referrerId": "p88y0a",
      "referredId": "xh345d",
      "amount": 2500,
      "currencyISO": "USD",
      "saleAmount": 10000,
      "status": "APPROVED",
      "createdAt": 1731494175123,  
      "approvedAt": 1731580575123,
      "paidAt": null,
      "reversedAt": null,
      "payoutQueuedAt": null,
      "holdDuration": 7,
      "provider": "stripe",
      "amountInCampaignCurrency": 2500,
      "saleAmountInCampaignCurrency": 10000,
      "campaignCurrencyISO": "USD",
      "exchangeRateAt": 1731494175123,
      "fxError": null
    }
  }
}
```

***

## `COMMISSION_ADJUSTED`

<mark style="color:orange;">Affiliate programs only</mark>

**Description:** When an existing commission is adjusted (refunds, chargebacks, or refund cancellations).

```json
{
  "event": "COMMISSION_ADJUSTED",
  "createdAt": 1558345215720,
  "data": {
    "participant": {
      "id": "p88y0a",
      "email": "gavin.belson@hooli.com",
      "firstName": "Gavin",
      "lastName": "Belson",
      "notes": "",
      "isWinner": false,
      "shareUrl": "http://piedpiper.com?grsf=p88y0a",
      "referralCount": 1,
      "monthlyReferralCount": 0,
      "prevMonthlyReferralCount": 0,
      "vanityKeys": [],
      "impressionCount": 2,
      "uniqueImpressionCount": 2,
      "shareCount": 3,
      "createdAt": 1554479231190,
      "referralSource": "DIRECT",
      "fraudRiskLevel": "LOW",
      "metadata": {},
      "unsubscribed": false
    },
    "referredParticipant": {
      "id": "xh345d",
      "email": "dinesh@piedpiper.com",
      "firstName": "Dinesh",
      "lastName": "Chugtai",
      "notes": "",
      "isWinner": false,
      "shareUrl": "http://piedpiper.com?grsf=xh345d",
      "referralCount": 0,
      "monthlyReferralCount": 0,
      "prevMonthlyReferralCount": 0,
      "vanityKeys": [],
      "impressionCount": 0,
      "uniqueImpressionCount": 0,
      "shareCount": 0,
      "createdAt": 1554479231190,
      "referralSource": "PARTICIPANT",
      "fraudRiskLevel": "LOW",
      "metadata": {},
      "unsubscribed": false
    },
    "campaign": {
      "id": "ct8f71",
      "name": "Middle Out Compression Campaign",
      "type": "AFFILIATE",
      "currencyISO": "USD",
      "rewards": []
    },
    "adjustment": {
      "currencyISO": "USD",
      "originalCommissionAmount": 9900,
      "newCommissionAmount": 0,
      "commissionAdjustedAmount": -9900,
      "reason": "FULL_REFUND",
      "adjustedAt": 1766393352171
    },
    "adjustedCommission": {
      "id": "comm_jp1ku7",
      "referrerId": "p88y0a",
      "referredId": "xh345d",
      "amount": 2500,
      "currencyISO": "USD",
      "saleAmount": 10000,
      "status": "PENDING",
      "createdAt": 1731494175123,  
      "approvedAt": null,
      "paidAt": null,
      "reversedAt": null,
      "payoutQueuedAt": null,
      "holdDuration": 14,
      "provider": "stripe",
      "amountInCampaignCurrency": 2500,
      "saleAmountInCampaignCurrency": 10000,
      "campaignCurrencyISO": "USD",
      "exchangeRateAt": 1731494175123,
      "fxError": null
    }    
  }
}
```

***

## `NEW_PAYOUT_ISSUED`

<mark style="color:orange;">Affiliate programs only</mark>

**Description:** When a payout is successfully issued to an affiliate.

```json
{
  "event": "NEW_PAYOUT_ISSUED",
  "createdAt": 1558345215720,
  "data": {
    "participant": {
      "id": "p88y0a",
      "email": "gavin.belson@hooli.com",
      "firstName": "Gavin",
      "lastName": "Belson",
      "notes": "",
      "isWinner": false,
      "shareUrl": "http://piedpiper.com?grsf=p88y0a",
      "referralCount": 1,
      "monthlyReferralCount": 0,
      "prevMonthlyReferralCount": 0,
      "vanityKeys": [],
      "impressionCount": 2,
      "uniqueImpressionCount": 2,
      "shareCount": 3,
      "createdAt": 1554479231190,
      "referralSource": "DIRECT",
      "fraudRiskLevel": "LOW",
      "metadata": {},
      "unsubscribed": false
    },
    "campaign": {
      "id": "ct8f71",
      "name": "Middle Out Compression Campaign",
      "type": "AFFILIATE",
      "currencyISO": "USD",
      "rewards": []
    },
    "payout": {
      "id": "po_k11ps9",
      "participantId": "p88y0a",
      "commissionIds": [
        "comm_jp1ku7",
        "comm_a98s7z"
      ],
      "amount": 3600,
      "currencyISO": "USD",
      "status": "ISSUED",
      "createdAt": 1731494295334,  
      "issuedAt": 1731580575123,
      "failedAt": null,
      "provider": "paypal",
      "amountInCampaignCurrency": 3600,
      "campaignCurrencyISO": "USD",
      "exchangeRateAt": 1731580575217,
      "exchangeRate": 1.0,
      "fxError": null
    }    
  }
}
```

***

## `PARTICIPANT_FRAUD_STATUS_UPDATED`

**Description:** When an existing participant's fraud status changes.

This webhook event is emitted if either of the following happens:

* If you manually mark a participant as a fraudster or non-fraudster from the GrowSurf admin dashboard. [Learn more here](https://support.growsurf.com/article/195-what-does-the-growsurf-anti-fraud-system-entail).
* If GrowSurf's anti-fraud system automatically identifies a referrer as a fraudster after they tried referring someone.

Here is an example of a `PARTICIPANT_FRAUD_STATUS_UPDATED` event where you can check the participant's fraud status via `data.participant.fraudRiskLevel` (it will be one of the following options: `"LOW"`, `"MEDIUM"`, or `"HIGH"`). You can also check the fraud reason code via `data.participant.fraudReasonCode` (see the [`Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-objects#participant) object for all fraud reason code options).

```json
{
  "event": "PARTICIPANT_FRAUD_STATUS_UPDATED",
  "createdAt": 1558345215720,
  "data": {
    "participant": {
      "id": "p88y0a",
      "email": "gavin.belson@hooli.com",
      "firstName": "Gavin",
      "lastName": "Belson",
      "notes": "This is obviously our competitor trying out our product!",
      "isWinner": false,
      "shareUrl": "http://piedpiper.com?grsf=p88y0a",
      "referralCount": 0,
      "monthlyReferralCount": 0,
      "prevMonthlyReferralCount": 0,
      "vanityKeys": [],
      "impressionCount": 0,
      "uniqueImpressionCount": 0,
      "shareCount": 3,
      "createdAt": 1554479231190,
      "referralSource": "PARTICIPANT",
      "fraudRiskLevel": "HIGH",
      "fraudReasonCode": "REFERRAL_CHAIN_FRAUD",
      "referredBy": "x9a7uu",
      "referrer": {
        "id": "x9a7uu",
        "email": "richard@piedpiper.com",
        "firstName": "Richard",
        "lastName": "Hendricks",
        "notes": "",
        "isWinner": true,
        "referralCount": 11,
        "monthlyReferralCount": 8,
        "prevMonthlyReferralCount": 0,
        "vanityKeys": [],
        "shareUrl": "http://piedpiper.com?grsf=x9a7uu",
        "impressionCount": 309,
        "uniqueImpressionCount": 285,
        "shareCount": 163,
        "createdAt": 1554431962667,
        "referralSource": "PARTICIPANT",
        "fraudRiskLevel": "LOW",
        "fraudReasonCode": "UNIQUE_IDENTITY",
        "metadata": {
          "piedPiperUserId": "12a39-8aajd-1dwiq",
          "companyName": "Pied Piper, Inc",
          "teamSize": "1-10"
        },
        "unsubscribed": false
      },
      "metadata": {
        "piedPiperUserId": "au71p-121x9-88faa",
        "companyName": "Hooli, Inc",
        "teamSize": "10,000+"
      },
      "unsubscribed": false
    },
    "campaign": {
      "id": "ct8f71",
      "name": "Middle Out Compression Campaign",
      "type": "REFERRAL",
      "currencyISO": "USD",
      "rewards": [
        {
          "title": "Early-Bird Reward",        
          "id": "crew_xlj123",
          "type": "SINGLE_SIDED",
          "description": "Win a free t-shirt when you refer a friend to sign up to Pied Piper!",
          "referralDescription": null,          
          "isActive": true,
          "isVisible": true,
          "isUnlimited": true,
          "limit": 3,
          "limitDuration": "IN_TOTAL",
          "conversionsRequired": 1,
          "numberOfWinners": 3,
          "imageUrl": "https://example.com/reward-image.png",                    
          "order": null,
          "couponCode": "PROMO_20_OFF",
          "nextMilestonePrefix": "You are only",
          "nextMilestoneSuffix": "referrals away from receiving a nice reward!",
          "metadata": {
            "foo": "bar",
            "amount": "$25",
            "points": 1000
          }        
        }
      ]
    }    
  }
}
```

***

## `CAMPAIGN_ENDED`

**Description:** When the program ends.

{% hint style="info" %}
**Please note:** Only the first 1,000 will be returned in the `winners` Array.
{% endhint %}

```json
{
  "event": "CAMPAIGN_ENDED",
  "createdAt": 1558345152138,
  "data": {
    "id": "ct8f71",
    "name": "Middle-Out Compression Launch",
    "type": "REFERRAL",
    "participantCount": 5661,
    "startedAt": 1522432573250,
    "endedAt": 1533532422153,
    "status": "COMPLETE",
    "impressionCount": 11075,
    "referralCount": 1673,
    "winnerCount": 1673,
    "winners": [
      {
        "id": "x9a7uu",
        "email": "richard@piedpiper.com",
        "firstName": "Richard",
        "lastName": "Hendricks",
        "notes": "",
        "isWinner": true,
        "referralCount": 11,
        "monthlyReferralCount": 8,
        "prevMonthlyReferralCount": 0,
        "vanityKeys": [],
        "shareUrl": "http://piedpiper.com?grsf=x9a7uu",
        "impressionCount": 309,
        "uniqueImpressionCount": 285,        
        "shareCount": 163,
        "createdAt": 1554431962667,
        "referralSource": "PARTICIPANT",
        "fraudRiskLevel": "LOW",
        "fraudReasonCode": "UNIQUE_IDENTITY",        
        "metadata": {
          "piedPiperUserId": "12a39-8aajd-1dwiq",
          "companyName": "Pied Piper, Inc",
          "teamSize": "1-10"
        },
        "unsubscribed": false
      }
    ],
    "rewards": [
      {
        "title": "Early-Bird Reward",        
        "id": "crew_xlj123",
        "type": "SINGLE_SIDED",
        "description": "Win a free t-shirt when you refer a friend to sign up to Pied Piper!",
        "referralDescription": null,          
        "isActive": true,
        "isVisible": true,
        "isUnlimited": true,
        "limit": 3,
        "limitDuration": "IN_TOTAL",
        "conversionsRequired": 1,
        "numberOfWinners": 3,
        "imageUrl": "https://example.com/reward-image.png",                    
        "order": null,
        "couponCode": "PROMO_20_OFF",
        "nextMilestonePrefix": "You are only",
        "nextMilestoneSuffix": "referrals away from receiving a nice reward!",
        "metadata": {
          "foo": "bar",
          "amount": "$25",
          "points": 1000
        }        
      }
    ]    
  }
}
```


# Metadata

Use metadata to save any custom data to Participants and Rewards to make your referral program even more dynamic.

Certain GrowSurf objects, such as [`Participants`](https://docs.growsurf.com/developer-tools/rest-api/api-objects#participant) and [`Rewards`](https://docs.growsurf.com/developer-tools/rest-api/api-objects#reward) can have a special `metadata` parameter, which is useful for storing any custom information.

## Use Cases

Here are some examples of how you could use `metadata`:

* Issue different reward values to participants based on their different `metadata` properties. [Learn more here](https://support.growsurf.com/article/357-how-to-set-up-dynamic-rewards).
* If you need to save custom data to a participant to display or use later in your own application.
* Attach custom key/value data to rewards in your program to retrieve later via the REST API when automating a reward via Webhooks or Zapier.

***

## Overview

### **Participant metadata**

* Can be set via the program editor, admin dashboard, REST API, JavaScript Web API, and embeddable elements
* Can be retrieved via REST API and is available via Webhooks
* Can be viewed from your admin dashboard and when you download your participants list

### **Reward metadata**

* Can be set via the program editor
* Can be retrieved via JavaScript, REST API and is available via Webhooks
* Can be used in pre-populated social share and invite messages, and within GrowSurf emails

***

## Participant metadata <a href="#setting-participant-metadata" id="setting-participant-metadata"></a>

### Setting participant metadata

There are several different ways to save metadata to a participant.

#### **Program Editor**

**For referred participants**:

From *Program Editor > 5. Installation*, navigate to the automagic form detection setup section (the page with the title "*Choose forms from your site or web app to automatically track.*"). This form is for tracking referred people who came to your website through their friend's unique referral link.

Select a form and choose the input fields to save with each form submission. Any custom field that is not "Email", "First Name", or "Last Name" will be saved as metadata.

<figure><img src="https://docs.growsurf.com/~gitbook/image?url=https%3A%2F%2F2794996218-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LeklWo0yn03AhWro2Ux%252Fuploads%252Fe5hE7KzLLnxtONKiFrax%252Fimage.png%3Falt%3Dmedia%26token%3D489c6996-c79d-4b72-a710-fcb06a607f57&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=d1ca1fea&#x26;sv=2" alt=""><figcaption><p>Choose the fields you want to save as metadata for referred participants</p></figcaption></figure>

**For referrers (your users/customers):**

From *Program Editor > 2. Design*, you can update the Signup Form with custom fields. This signup form is intended for your users/customers who sign up to your referral program in order to refer their friends.

When a participant submits a new task from your referral portal, they will need to submit the custom fields as well, which will be saved as participant metadata.

<figure><img src="https://docs.growsurf.com/~gitbook/image?url=https%3A%2F%2F2794996218-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LeklWo0yn03AhWro2Ux%252Fuploads%252FPy2zi9LiXoiVFlXA8jFi%252Fimage.png%3Falt%3Dmedia%26token%3D16823dd7-c065-40a3-970a-f8d0688c39eb&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=1b7dd145&#x26;sv=2" alt=""><figcaption><p>Update the Signup Form in the campaign editor</p></figcaption></figure>

<figure><img src="https://docs.growsurf.com/~gitbook/image?url=https%3A%2F%2F2794996218-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LeklWo0yn03AhWro2Ux%252Fuploads%252FHPZEZDtmraCXiySwR3oW%252Fimage.png%3Falt%3Dmedia%26token%3D38ae38da-6952-4dd8-bfa9-080e834f415a&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b323216a&#x26;sv=2" alt=""><figcaption><p>When a participant signs up for the first time on your referral portal (or from the <a href="https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-form">Embedded Signup Form</a>), custom fields will be saved as metadata</p></figcaption></figure>

#### **Admin Dashboard**

When you are viewing a participant from the GrowSurf admin dashboard, you can add or update their metadata.

<figure><img src="https://docs.growsurf.com/~gitbook/image?url=https%3A%2F%2F2794996218-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LeklWo0yn03AhWro2Ux%252Fuploads%252FCovZ45wj8aNNyX47VhFh%252Fimage.png%3Falt%3Dmedia%26token%3D5548a602-03e3-4c84-a681-c55bf7323688&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=6f531cd5&#x26;sv=2" alt=""><figcaption><p>Update a participant in the admin dashboard</p></figcaption></figure>

#### **REST API**

You can use these REST API endpoints to add or update a participant's metadata:

**For adding new participants:**

* [`/POST Add Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant)

**For updating existing participants:**

* [`/POST Update Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail)

#### **JavaScript SDK**

You can use the JavaScript method [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#post-campaign-id-participant) to add metadata to a participant. Any keys other than `email`, `firstName`, and `lastName` will be saved as metadata. Metadata will only be set for new participants.

**Example**:

```javascript
growsurf.addParticipant({
  email: 'gavin@hooli.com',
  company: 'Hooli',
  subscriptionPlan: 'businessPlan'
}).then(participant => {
  // handle participant
});
```

{% hint style="warning" %}
**Note**: Participant metadata cannot be updated using the JavaScript SDK. You must use the REST API to update metadata for existing participants.
{% endhint %}

#### **Embeddable Elements**

You can pass in custom participant values into any [Embeddable Element](https://docs.growsurf.com/developer-tools/embeddable-elements) using the `data-grsf-metadata` attribute. Metadata will only be set for new participants.

**Example**:

```html
<div data-grsf-block-form
 data-grsf-email="gavin@hooli.com"
 data-grsf-metadata="{'company': 'Hooli', ''subscriptionPlan': 'businessPlan'}"></div>
```

{% hint style="warning" %}
**Note**: Participant metadata cannot be updated using embeddable elements. You must use the REST API to update metadata for existing participants.
{% endhint %}

### Using participant metadata

#### REST API

You can use these REST API endpoints to retrieve a participant's metadata:

* [`/GET Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#get-campaign-id-participant-participantidoremail)

#### Webhooks

Participant metadata is returned on all participant payloads in [Webhook events](https://docs.growsurf.com/developer-tools/webhooks/events-reference).

***

## Reward metadata

### Setting reward metadata

There is only one way to update reward metadata, from *Program Editor > 1. Rewards*.

<figure><img src="https://docs.growsurf.com/~gitbook/image?url=https%3A%2F%2F2794996218-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LeklWo0yn03AhWro2Ux%252Fuploads%252FzTCUqxDKBDVne4upke6I%252Fimage.png%3Falt%3Dmedia%26token%3D942d5e8a-1d54-4646-ac26-683b83c3f6f1&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=45b71059&#x26;sv=2" alt=""><figcaption><p>Add/edit reward metadata from the program editor</p></figcaption></figure>

### Using reward metadata <a href="#policies-1" id="policies-1"></a>

You can then reference this reward metadata in different places of the Program Editor for UI purposes. For example, metadata will be available as an option by clicking the "+ Personalize" dropdown in social sharing, invites, and emails.

#### JavaScript <a href="#policies-1" id="policies-1"></a>

If you are using the JavaScript SDK, you can also retrieve reward metadata by calling [`growsurf.getCampaign()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-campaign). This is useful for displaying any custom reward details in your UI.

#### Webhooks

Reward metadata is returned on all `campaign` payloads in [Webhook events](https://docs.growsurf.com/developer-tools/webhooks/events-reference). You can reference metadata when automating rewards using webhooks. This is useful so that your marketing team can make changes anytime to reward values in the future without getting developers involved.

***

### Tutorial

View the following guide to help you add reward metadata and reference it throughout participant-facing elements of your GrowSurf program.

<details>

<summary><strong>Guide to implementing reward metadata</strong></summary>

#### 1. Add metadata to a reward

* Go to *Campaign Editor > 1. Rewards* and click the Continue button.
* Open the reward you want to edit.
* Click "Advanced reward settings" and scroll to the Metadata section.
* Click "Add Metadata", and enter `rewardForReferrer` for the key, and `50` for the value.
* Click "Add Metadata" again, and enter `rewardForReferred` for the key, and `50` for the value.

<figure><img src="/files/mYohPv2tOzYVLtzonl0O" alt=""><figcaption></figcaption></figure>

***

#### 2. Update campaign design

* Go to *Campaign Editor > 3. Design*.
* Here are the sections you'll want to update with reward metadata:
  * **Header Content**
  * **Share (Social & Email Invites)**
  * **Referred Friend Motivators** **(Welcome Banner and Inline Welcome Message)**
* For each element in the sections above, click the "+ Personalize" button underneath each input field, and from the dropdown select the reward metadata you added from step 1 above. See the images below as examples.

**Header Content**

<figure><img src="/files/f8LDHOzygvckK8QgPGvl" alt=""><figcaption></figcaption></figure>

To explain this first example: The text `Sign up for Subank and receive ${{campaignReward['p6k82i']['rewardForReferrer']}}!` will be rendered as `Sign up for Subank and receive $50!`.

**Share**

<figure><img src="/files/BVhMqCjey2osUsMDV2JZ" alt=""><figcaption></figcaption></figure>

After you add reward metadata to a share message, see how it renders by clicking on the corresponding share button in the live preview section of the campaign editor.

**Referred Friend Motivators**

<figure><img src="/files/ICGcpxuKqmr6stpMycZz" alt=""><figcaption></figcaption></figure>

To explain this example, the `{{referrerName}} invited you to join Subank! Sign up today and get ${{campaignReward['p6k82i']['rewardForReferred']}}!` will be rendered as `Gavin B invited you to join Subank! Sign up today and get $50!`.

***

#### 3. Update campaign emails

* Go to *Campaign Editor > 3. Emails*.
* Open the "New Participant Reward" email.
* In the Email Body section, type in the following: `{{isReferrer ? ("You've just earned a $" + campaignReward["p6k82i"]["rewardForReferrer"] + " gift card for referring a friend!") : ("You just got a $" + campaignReward["p6k82i"]["rewardForReferred"] + " gift card for activating your account and making your first purchase!") }}`
* Preview the changes on the right-side section to make sure everything is rendering properly.
  * For referrers, the text would render like this: `You've just earned a $50 gift card for referring a friend!`.
  * For referred friends, the text would render like this: `You just got a $50 gift card for activating your account and making your first purchase!`
* Repeat the above steps for all emails that you want to reference reward metadata in.
  * Note: For other emails, you can simply click the "+ Personalize" button to insert reward metadata. The "New Participant Reward" email is the only special email type to use the `{{isReferrer ? ... : ... }}` syntax for in order to account for when emails are sent to both referrers and referred friends (when the reward won is a double-sided reward).

<figure><img src="/files/sSfzDRWP1sUXzs2U7uH8" alt=""><figcaption></figcaption></figure>

***

#### 4. Final review and testing

Make sure to thoroughly [test your campaign](https://support.growsurf.com/article/209-best-practices-for-testing-your-campaign) by signing up as both the referrer and a referred friend to ensure the reward metadata displays correctly in different elements.

</details>

## Policies <a href="#policies-1" id="policies-1"></a>

The following are the policies when creating or updating metadata.

| Policy                  | Limit            |
| ----------------------- | ---------------- |
| **Metadata Key**        | 40 characters    |
| **Metadata Value**      | 500 characters   |
| **Total Metadata Keys** | 50 keys / object |
| **Key Characters**      | Alphanumeric     |

{% hint style="info" %}
**Note the following:**

* All metadata keys will be converted to camelCase. For example, if you provide a key "My Metadata Key" that key will be converted to `myMetadataKey`.
* **Important:** Do not store any sensitive information (personally identifiable information, such as credit cards and social security numbers) as metadata within GrowSurf, as metadata rewards are accessible from the JavaScript SDK.
  {% endhint %}


# ActiveCampaign

Update ActiveCampaign contacts with their unique share link and referrer information.

## Sync with your ActiveCampaign List <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the ActiveCampaign integration card and enter your ActiveCampaign API URL and key ([click here to get your ActiveCampaign API URL and key](https://help.activecampaign.com/hc/en-us/articles/207317590-Getting-started-with-the-API#how-to-obtain-your-activecampaign-api-url-and-key)).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to ActiveCampaign only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to ActiveCampaign.
{% endhint %}

![](/files/-MKcOKKEaAydJgcpXcgu)

**Step 2:** Once connected, choose the ActiveCampaign list that you want to automatically sync to. GrowSurf will add/update your ActiveCampaign contacts every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

![](/files/-MKcOKKKYqZ7EKbLwPC7)

**Step 4:** Open your ActiveCampaign account, and go to *Lists > Manage Fields.*

For each GrowSurf custom field that you want available for ActiveCampaign contacts, you will need to manually click the edit icon next to each GrowSurf field (see screenshot below):

![](/files/-MUyRGjw2pamQ1XSnM8z)

Then in the *Customize the Field Options* window, check the same ActiveCampaign list that you selected in the GrowSurf campaign editor.

![](/files/-MKetPi8z4pnjKu9H00E)

For more help in editing custom contact fields, please see ActiveCampaign's help article [*How do I edit a custom contact field?*](https://help.activecampaign.com/hc/en-us/articles/115001623804-How-do-I-edit-a-custom-contact-field-)*.*

## Examples

[View our ActiveCampaign tutorials](https://docs.growsurf.com/additional-integrations/activecampaign/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Contact Fields** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new contact fields for your ActiveCampaign Contacts.

To use them, you'll first need to [follow step #4 in the instructions above](https://docs.growsurf.com/integrations/activecampaign#sync-with-your-activecampaign-list).

| **Field Name**                           | **Personalization Tag**                  | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | ---------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `%GROWSURF_SHARE_URL%`                   | TEXT     | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `%GROWSURF_PARTICIPANT_ID%`              | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `%GROWSURF_REFERRAL_STATUS_ID%`          | TEXT     | The referral status of the participant\*                                                                                                                                                                  | CREDIT\_PENDING                                            |
| **GrowSurf Participant First Name**      | `%GROWSURF_PARTICIPANT_FIRST_NAME%`      | TEXT     | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `%GROWSURF_PARTICIPANT_LAST_NAME%`       | TEXT     | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `%GROWSURF_REFERRER_FIRST_NAME%`         | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `%GROWSURF_REFERRER_LAST_NAME%`          | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `%GROWSURF_REFERRER_EMAIL%`              | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `%GROWSURF_TOTAL_REFERRAL_COUNT%`        | NUMBER   | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `%GROWSURF_MONTHLY_REFERRAL_COUNT%`      | NUMBER   | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `%GROWSURF_PREV_MONTHLY_REFERRAL_COUNT%` | NUMBER   | The participant's previous month referral count                                                                                                                                                           | 200                                                        |
| **GrowSurf Next Milestone**              | `%GROWSURF_NEXT_MILESTONE%`              | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone) an example here)         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `%GROWSURF_NEXT_MONTHLY_MILESTONE%`      | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `%GROWSURF_TOTAL_INVITE_COUNT%`          | NUMBER   | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `%GROWSURF_TOTAL_IMPRESSION_COUNT%`      | NUMBER   | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these personalization tags in your ActiveCampaign email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `%GROWSURF_SHARE_URL%` in your emails to provoke your subscribers to make referrals!

[​Learn more about ActiveCampaign personalization tags here.​](https://help.activecampaign.com/hc/en-us/articles/220709307-Personalization-Tags#how-personalization-tags-work)

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to ActiveCampaign, or if they are being added but their unique referral link isn't being synced to ActiveCampaign:**
  * Activity logs will denote if a participant was added to ActiveCampaign or if they were failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
* **If custom contact fields are not showing up for an ActiveCampaign contact:**
  * You will need to make sure to explicitly make them available for your ActiveCampaign list in order to show up. [Please reference step #4 in the instructions above](https://docs.growsurf.com/integrations/activecampaign#sync-with-your-activecampaign-list).
* **If a GrowSurf custom field personalization tag is showing up as red when sending out an email**:
  * You will need to make sure to explicitly make the custom field available for your ActiveCampaign list in order to use it as a personalization tag in your emails. [Please reference step #4 in the instructions above](https://docs.growsurf.com/integrations/activecampaign#sync-with-your-activecampaign-list).

[<br>](https://docs.growsurf.com/additional-integrations/mailchimp)


# Tutorials

We'll walk you through adding personalized referral program messaging to your ActiveCampaign emails.

When you connect your GrowSurf campaign to ActiveCampaign, you can easily embed a referral program into your ActiveCampaign emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <th> 
         <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
      </th>
   </tr>
   <tr style="background: #FFFFFF">
      <td style="padding: 20px; text-align: center;">
         <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
         <hr style="margin: 15px;">
         <p style="font-size: 16px;">Get $10 for every friend you refer to PrismJar with your personal referral link: 
            <a href="%GROWSURF_SHARE_URL%" style="color: #1673df; text-decoration: none;">%GROWSURF_SHARE_URL%</a>
         </p>
         <div> 
            <a href="mailto:?body=%GROWSURF_SHARE_URL%%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
            <a href="https://www.facebook.com/sharer/sharer.php?u=%GROWSURF_SHARE_URL%" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
            <a href="https://twitter.com/intent/tweet?url=%GROWSURF_SHARE_URL%&text=Join%20PrismJar%20and%20we%20both%20get%20$5%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
         </div>
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `%GROWSURF_SHARE_URL%%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `%GROWSURF_SHARE_URL%` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;">
         <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
         <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
      </td>
   </tr>
   <tr>
      <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
         <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
      </td>
   </tr>
   <tr>
      <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="padding: 20px; text-align: left;">
         <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
         <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
      </td>
   </tr>
   <tr>
      <td style="padding-left: 20px; padding-right: 20px;">
         <hr style="width:100%; text-align:left;">
      </td>
   </tr>
   <tr>
      <td style="padding: 20px;">
         <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
         <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
         <table border="0" cellpadding="0" style="padding-bottom: 20px;">
            <tr>
               <td style="padding: 10px;">
                  <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
               </td>
               <td style="padding: 10px; text-align: left;">
                  <h3 style="margin-bottom: 5px;">Spread the word</h3>
                  <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
               </td>
            </tr>
            <tr>
               <td style="padding: 10px;">
                  <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
               </td>
               <td style="padding: 10px; text-align: left;">
                  <h3 style="margin-bottom: 5px;">You'll get $10</h3>
                  <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
               </td>
            </tr>
            <tr>
               <td style="padding: 10px;">
                  <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
               </td>
               <td style="padding: 10px; text-align: left;">
                  <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
                  <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
               </td>
            </tr>
         </table>
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
         <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
         <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
      </td>
   </tr>
   <tr>
      <td style="text-align: center;">
         <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
      </td>
   </tr>
   <tr>
      <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
         <table border="0" cellpadding="0">
            <tr>
               <td style="width: 100%; text-align: left; line-height: 1.6">
                  <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p>
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
               </td>
            </tr>
         </table>
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="padding: 20px; text-align: center;">
         <h1 style="margin: 5px;">Give $100, Get $100</h1>
         <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
      </td>
   </tr>
   <tr>
      <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
         <p>Give $100, Get $100.</p>
         <p>Did you know that you can get $100 for referrals?</p>
         <p style="line-height: 1.6;">Simply share your unique referral link: 
            <a href="%GROWSURF_SHARE_URL%" style="color: #4f46e5; text-decoration: none;">%GROWSURF_SHARE_URL%</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
         </p>
      </td>
   </tr>
   <tr>
      <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="text-align: center; border-top: 0; border-bottom: 0; ">
         <div style="padding: 20px;">
         <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
         <div>
         <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
      </td>
   </tr>
   <tr>
      <td style="padding-bottom: 20px; font-size: 16px;">
         <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
      </td>
   </tr>
   <tr>
      <td style="padding-top: 0; font-size: 16px;">
         <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="%GROWSURF_SHARE_URL%" style="color: #ffffff;">%GROWSURF_SHARE_URL%</a></p>
      </td>
   </tr>
   <tr>
      <td style="font-size: 16px; padding-top: 20px;" align="center">
         <p style="color: #ffffff;">Or spread the word on social media:</p>
      </td>
   </tr>
   <tr>
      <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
         <a href="https://twitter.com/intent/tweet?url=%GROWSURF_SHARE_URL%&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
         </a>
         <a href="https://www.facebook.com/sharer/sharer.php?u=%GROWSURF_SHARE_URL%" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
         </a>
         <a href="mailto:?body=%GROWSURF_SHARE_URL%%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
         </a>
         <a href="https://www.linkedin.com/shareArticle?mini=true&url=%GROWSURF_SHARE_URL%" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
         </a>
         <a href="https://wa.me?text=%GROWSURF_SHARE_URL%" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
         </a>
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `%GROWSURF_SHARE_URL%%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `%GROWSURF_SHARE_URL%` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
   <tr>
      <td style="text-align: left; font-weight: 400; font-size: 16px;">
         <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
      </td>
   </tr>
   <tr>
      <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
   </tr>
   <tr>
      <td> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
     <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
     <tr>
       <td style="padding: 20px; background: #ffffff;">
         <table border="0" cellpadding="0" cellspacing="0">
           <tr>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">Spread the word</p>
               <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
             </td>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">You'll get $10</p>
               <p>Receive $10 for each friend your refer that makes their first deposit</p>
             </td>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">Your friends get $10</p>
               <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
             </td>
           </tr>
         </table>
       </td>
     </tr>
     <tr>
       <td style="text-align: center;"> 
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
      </td>
     </tr>
   </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Get your swag
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="%GROWSURF_SHARE_URL%" style="color: #8E4CED;">%GROWSURF_SHARE_URL%</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have %GROWSURF_TOTAL_REFERRAL_COUNT% referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="color: #8E4CED;">Check your status here</a>. %GROWSURF_NEXT_MILESTONE%
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `%GROWSURF_NEXT_MILESTONE%` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  %GROWSURF_TOTAL_REFERRAL_COUNT% referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="%GROWSURF_SHARE_URL%" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">%GROWSURF_SHARE_URL%</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>%GROWSURF_NEXT_MILESTONE%</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `%GROWSURF_TOTAL_REFERRAL_COUNT%`. In this example, you would display any one of these five images at a given time:
   1. If `%GROWSURF_TOTAL_REFERRAL_COUNT%` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `%GROWSURF_TOTAL_REFERRAL_COUNT%` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `%GROWSURF_TOTAL_REFERRAL_COUNT%` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `%GROWSURF_TOTAL_REFERRAL_COUNT%` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `%GROWSURF_TOTAL_REFERRAL_COUNT%` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `%GROWSURF_NEXT_MILESTONE%` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="%GROWSURF_SHARE_URL%" style="color: #8E4CED;">%GROWSURF_SHARE_URL%</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="%GROWSURF_SHARE_URL%" style="color: #F46A54;">%GROWSURF_SHARE_URL%</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=%EMAIL%&grsf_first_name=%FIRSTNAME%&grsf_last_name=%LASTNAME%" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your ActiveCampaign email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="%GROWSURF_SHARE_URL%" style="color: #F46A54;">%GROWSURF_SHARE_URL%</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Adjust

Preserve GrowSurf referral attribution in Adjust links for native mobile app referrals.

## How It Works

If you use Adjust, we recommend using an Adjust link as your GrowSurf campaign Share URL.

This is the URL that referred friends land on when they open up a referral link. Depending on the device they open the link on (web, iOS, or Android), they will either land on a webpage or your App Store / Google Play listing on mobile.

When a participant shares their referral link, the GrowSurf referral code must stay attached to the Adjust link. Your app then passes the Adjust deferred deep link URL into the GrowSurf mobile SDK before calling `addReferredParticipant()`.

***

## How to Set Up

**Step 1:** In GrowSurf, open *Campaign Editor > 5. Installation* and set your Share URL to the Adjust link that routes users to your app.

<figure><img src="/files/76iLLxsusTpH1PsOJvml" alt=""><figcaption></figcaption></figure>

**Step 2:** Staying within the same GrowSurf screen as the prior step, you need to append a `deep_link` query parameter to the Share URL. Depending on your Adjust link type, choose an option below.

{% tabs %}
{% tab title="Adjust Universal Link (branded domain)" %}
If your Adjust link uses a branded Universal Link domain (e.g., `acecraft.go.link`, `zuscoffee.go.link`, `villamarket.go.link`):

{% hint style="info" %}

## Get your app's deep link URL encoded

1. Get your app's deep link URL. For example, it looks something like `myapp://open`.
2. Use a [tool like this](https://meyerweb.com/eric/tools/dencoder/) to URL-encode it. Using the same example above, you should have something that looks like `myapp%3A%2F%2Fopen` .
3. Replace `myapp%3A%2F%2Fopen` in the examples below with your value from the previous step (leave `{{referralCode}}` as literal text — GrowSurf substitutes it for each participant's referral code at share time).
   {% endhint %}

**If your Adjust link has no query parameters yet, prefix with `?`:**

* Before: `https://zuscoffee.go.link/C0PHh`
* After: `https://zuscoffee.go.link/C0PHh?deep_link=myapp%3A%2F%2Fopen%3Fgrsf%3D{{referralCode}}`

**If your Adjust link already has query parameters (e.g., an `adj_t` token), prefix with `&`:**

* Before: `https://villamarket.go.link/?adj_t=kzdgn86`
* After: `https://villamarket.go.link/?adj_t=kzdgn86&deep_link=myapp%3A%2F%2Fopen%3Fgrsf%3D{{referralCode}}`
  {% endtab %}

{% tab title="Adjust standard tracker URL" %}
If your Adjust link uses the standard tracker URL format (e.g., `app.adjust.com`):

{% hint style="info" %}

## Get your app's deep link URL encoded

1. Get your app's deep link URL. For example, it looks something like `myapp://open`.
2. Use a [tool like this](https://meyerweb.com/eric/tools/dencoder/) to URL-encode it. Using the same example above, you should have something that looks like `myapp%3A%2F%2Fopen` .
3. Replace `myapp%3A%2F%2Fopen` in the examples below with your value from the previous step (leave `{{referralCode}}` as literal text — GrowSurf substitutes it for each participant's referral code at share time).
   {% endhint %}

**If your tracker URL has no query parameters yet, prefix with `?`:**

* Before: `https://app.adjust.com/abc123`
* After: `https://app.adjust.com/abc123?deep_link=myapp%3A%2F%2Fopen%3Fgrsf%3D{{referralCode}}`

**If your tracker URL already has query parameters (e.g., a campaign tag), prefix with `&`:**

* Before: `https://app.adjust.com/abc123?campaign=summer`
* After: `https://app.adjust.com/abc123?campaign=summer&deep_link=myapp%3A%2F%2Fopen%3Fgrsf%3D{{referralCode}}`
  {% endtab %}
  {% endtabs %}

{% hint style="info" %}
There's no configuration necessary in Adjust. GrowSurf substitutes `{{referralCode}}` with each participant's referral code at share time (e.g., `abc123`).
{% endhint %}

**Step 3:** Pass the Adjust deferred deep link URL into the GrowSurf attribution adapter before calling `addReferredParticipant()`.

{% tabs %}
{% tab title="iOS" %}

```swift
import GrowSurfAdjustAttribution

try await GrowSurfAdjustAttribution.handle(adjustDeferredDeepLinkURL, sdk: growsurf)
```

{% endtab %}

{% tab title="Android" %}

```kotlin
import com.growsurf.sdk.attribution.adjust.GrowSurfAdjustAttribution

GrowSurfAdjustAttribution.handle(adjustDeferredDeepLinkUri, growsurf)
```

{% endtab %}
{% endtabs %}

**Step 4:** Call `addReferredParticipant()` after the GrowSurf SDK has handled attribution. This method will validate pending attribution and creates a new referred participant record only when there is a valid referrer.

***

## iOS Deferred Deep Linking (New Installs)

This is the primary path for an app referral program — a referral targets people who don't have your app yet, so most referred installs are cold installs. On iOS it's best-effort even when configured (see the troubleshooting tips below), so pair it with a fallback such as manual referral-code entry.

For users who tap an Adjust link (and don't have your iOS app installed), the referral code only survives the install if Adjust **LinkMe** is enabled. iOS 14+ removed the IDFA/device matching (App Tracking Transparency), and iOS 15 Private Relay masks the click IP, which broke the probabilistic matching Adjust otherwise uses for cold-install deferred deep links. **LinkMe** is optional and off by default. Without it, an iOS user who installs from a referral link may open the app with no referral data, and `addReferredParticipant()` finds no referrer.

To enable it:

* **On your Adjust link:** add a LinkMe tag so the token is written at click time — `adj_linkme=1` for Universal/branded (`.go.link`) links, or `linkme=1` for standard tracker URLs.
* **In your app:** enable LinkMe on the Adjust config **before** starting the Adjust SDK. The exact call depends on your Adjust SDK major version — `ADJConfig.enableLinkMe()` in Adjust iOS SDK v5, or `setLinkMeEnabled(true)` in v4 (confirm against [Adjust's current LinkMe docs](https://help.adjust.com/en/article/linkme) for your version).

On iOS 16+, the user sees a one-time "Pasted from …" prompt on first launch when the SDK reads the LinkMe clipboard token. Without LinkMe, Adjust falls back to server-side, probabilistic matching, which is unreliable on modern iOS. The installed-app flow (an Adjust link that opens an app the user already has) does not need LinkMe.

As with every provider, GrowSurf reads `grsf` out of whatever deep link Adjust delivers — so a deferred referral survives only when LinkMe is enabled and the delivered `deep_link` still carries `grsf`.

***

## Additional Tips

* Test both flows before launching:
  * **Installed app flow:** Users who already have your app installed
  * **New install flow:** Users who don't have your app installed
* If the referral code is missing after app install, confirm that the deep link URL passed to `GrowSurfAdjustAttribution.handle` contains `grsf`, `ref`, or `referredBy`. The most common cause is that the `deep_link` parameter in your Adjust Share URL was not URL-encoded correctly, or `{{referralCode}}` was accidentally URL-encoded to `%7B%7BreferralCode%7D%7D` and was not substituted by GrowSurf.
* The `deep_link` value should URL-encode the `://`, `?`, and `=` characters of your app's deep link scheme, but `{{referralCode}}` itself must remain as literal text (not URL-encoded). For example, `myapp%3A%2F%2Fopen%3Fgrsf%3D{{referralCode}}` is correct; `myapp%3A%2F%2Fopen%3Fgrsf%3D%7B%7BreferralCode%7D%7D` is not.
* **iOS deferred (cold install) is best-effort.** Even when LinkMe is enabled, a referral can be missing after a *new* iOS install if the user declined the iOS "Paste from …" prompt on first launch, copied something else before opening the app (overwriting the clipboard token), or tapped the link from an in-app / non-Safari browser. Provide a fallback such as manual referral-code entry, and don't assume the user always lands on a specific screen. (Android's Play Install Referrer is deterministic and isn't affected by these.)
* See [iOS SDK Attribution Providers](/developer-tools/ios-sdk/attribution-providers), [Android SDK Attribution Providers](/developer-tools/android-sdk/attribution-providers), and [Getting Started for Native Mobile](/getting-started-for-native-mobile) for more details.


# Amplitude

Track and analyze referral program data alongside product analytics in Amplitude.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

After connecting, the Amplitude integration transmits data to your Amplitude account, enabling analysis and reporting on your referral program.

For referrers, when they are added to your campaign (e.g., they get a referral link generated) or if they click a social share button (like Facebook or LinkedIn), GrowSurf sends an Amplitude event. For referred friends, if they sign up using your Share URL, GrowSurf also sends an event.

{% hint style="success" %}
Under the hood, GrowSurf will load the Amplitude JavaScript library, identify participants (both referrers and referred friends) by their email address, and track events. Rest assured, if Amplitude is already installed, GrowSurf ensures the library is not loaded twice and prevents duplicate identity calls.
{% endhint %}

## Tracked Events

The following events will be emitted with the `growsurf_` prefix.

| Event                       | Description                            | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `growsurf_referral`         | \[Referred friend] New referral signup | <p>Records when a referred visitor signs up through a referral link.<br><br>This includes:</p><ul><li>Those who submit the form on your website that has referral tracking enabled (via the campaign editor)</li><li>Adding a referred participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul>                                                                                                                                                                                                                                                        |
| `growsurf_referral_trigger` | \[Referred friend] Referral triggered  | Records when a referred participant completes the desired qualifying action, which triggers a referral. Only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral).                                                                                                                                                                                                                                                                                                                                                                                                    |
| `growsurf_signup`           | \[Referrer] New referrer signup        | <p>Records when someone generates a referral link and joins the campaign as a participant.</p><p>This includes:</p><ul><li>Direct signups (someone entering in their email address on the GrowSurf form)</li><li>Passing in an email address via URL parameter <code>?grsf\_email</code></li><li>Passing in an email address via <code>data-grsf-email</code> attribute on an <a href="https://docs.growsurf.com/developer-tools/embeddable-elements">Embeddable Element</a></li><li>Adding a participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul> |
| `growsurf_share`            | \[Referred] Social media share         | Records when a referrer shares their link by clicking 'Copy Link' or clicking a social media button                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `growsurf_invite`           | \[Referrer] Email invite(s) sent       | Records when a referrer sends invitation(s) via email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Example Events

Events correspond with the events listed in the [`growsurf.subscribe()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) method. To see examples of the raw `JSON` data, please see the [*Example Response*](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) section.

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Amplitude integration card and enter your [Amplitude API key](https://amplitude.com/docs/apis/authentication).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Amplitude installed on your website, you do not need to enter in the Amplitude API key. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Amplitude installed.
{% endhint %}

<figure><img src="/files/p38zsPC8plVtnLFJJPkp" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Within your Amplitude account, make sure to whitelist the URLs where these events occur. These are primarily two locations: your referral portal (which might be part of your user portal or web app, or the [GrowSurf-hosted referral portal](https://support.growsurf.com/article/196-where-can-i-find-my-campaigns-dedicated-landing-page)) and the referred friend's landing page (the Share URL you enter in the *Campaign Editor > 5. Installation* step).
{% endhint %}

Once GrowSurf events get emitted, you will see them show up in *Amplitude > Live Events* (see image below).

<figure><img src="/files/47LRsPNapjNyzyHNVJJh" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Please allow up to 15 minutes of processing time for events to appear (in some cases where Amplitude is backed up, it can take longer).
{% endhint %}

Within Amplitude, if you click on a user, you'll be able to view specific details about the event.

<figure><img src="/files/qtpgy6iIqWpl1G0ublSj" alt=""><figcaption></figcaption></figure>

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If you are seeing a wrongly identified user:

There are 5 different ways that GrowSurf participants can be added to your campaign. Please make sure that the GrowSurf participant email address that you are passing in matches the one you were expecting for the Amplitude user:

* If you pass in a `data-grsf-email` attribute to a [GrowSurf embeddable element](https://docs.growsurf.com/developer-tools/embeddable-elements)
* If you pass in an email address via URL parameter `?grsf_email`
* If you are using [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant)
* If you enter an email address via the GrowSurf form
* If you are a referred friend and you submit the form that has referral tracking configured on it from the *Campaign Editor > 5. Installation* step

#### If you are not receiving events, but were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Amplitude.
* Make sure to whitelist the URL where events are being tracked (e.g, if your referrer clicks the Facebook share button from *<https://app.yoursite.com/refer>*, you'll want to make sure you whitelist that root domain. If a referred friend signs up on your Share URL, make sure to whitelist the Share URL as well).
* If you just submitted an event, make sure that you've allowed up to 15 minutes for Amplitude to process the event.

#### If you are receiving events, but were NOT expecting them:

* To ensure no non-GrowSurf-related events are sent to your Amplitude account, disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you're receiving events without a GrowSurf-related suffix (e.g., `growsurf_`), it indicates that GrowSurf may not be emitting these events. Please check other parts of your code to find where these events might be occurring.


# AppsFlyer

Preserve GrowSurf referral attribution in AppsFlyer OneLink campaigns for native mobile app referrals.

## How It Works

If you use AppsFlyer, we recommend using an AppsFlyer link as your GrowSurf campaign Share URL.

This is the URL that referred friends land on when they open up a referral link. Depending on the device they open the link on (web, iOS, or Android), they will either land on a webpage or your App Store / Google Play listing on mobile.

When a participant shares their referral link, the GrowSurf referral code must stay attached to the AppsFlyer link. Your app then passes the AppsFlyer deep link or conversion payload into the GrowSurf mobile SDK before calling `addReferredParticipant()`.

***

## How to Set Up

**Step 1:** In GrowSurf, open *Campaign Editor > 5. Installation* and set your Share URL to the AppsFlyer OneLink URL that routes users to your app.

<figure><img src="/files/76iLLxsusTpH1PsOJvml" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
For **new installs (deferred)** on iOS, the referral arrives through AppsFlyer Unified Deep Linking and `grsf` must ride in a `deep_link_value`/`deep_link_sub` field — see [iOS Deferred Deep Linking](#ios-deferred-deep-linking-new-installs) below.
{% endhint %}

**Step 2:** Pass the AppsFlyer callback payload into the GrowSurf attribution adapter before calling `addReferredParticipant()`.

{% tabs %}
{% tab title="iOS" %}

```swift
import GrowSurfAppsFlyerAttribution

try await GrowSurfAppsFlyerAttribution.handle(appsFlyerParams, sdk: growsurf)
```

{% endtab %}

{% tab title="Android" %}

```kotlin
import com.growsurf.sdk.attribution.appsflyer.GrowSurfAppsFlyerAttribution

GrowSurfAppsFlyerAttribution.handle(appsFlyerConversionData, growsurf)
```

{% endtab %}
{% endtabs %}

**Step 3:** Call `addReferredParticipant()` after the GrowSurf SDK has handled attribution. This method will validate pending attribution and creates a new referred participant record only when there is a valid referrer.

***

## iOS Deferred Deep Linking (New Installs)

This is the primary path for an app referral program — a referral targets people who don't have your app yet, so most referred installs are cold installs. On iOS it's best-effort even when configured (see the troubleshooting tips below), so pair it with a fallback such as manual referral-code entry.

For users who tap an AppsFlyer OneLink (and don't have your iOS app installed), the referral code survives the install through AppsFlyer **Unified Deep Linking (UDL)**, which resolves the click server-side on first launch (typically within a \~15-minute click-to-install window). Unlike Branch, Adjust, and Singular, AppsFlyer does not read the clipboard for standard deferred attribution, so there is no "Pasted from …" prompt — but you must wire up its deep-link delegate, and the referral code must ride in a field UDL exposes to new installs.

* **In your app:** set `AppsFlyerLib.shared().deepLinkDelegate` and implement the UDL callback (`didResolveDeepLink(_:)`). When AppsFlyer resolves the deferred link on first launch, forward the resolved deep-link values (a dictionary) into the GrowSurf adapter, then call `addReferredParticipant()`:

{% tabs %}
{% tab title="iOS" %}

```swift
import GrowSurfAppsFlyerAttribution

// Inside your AppsFlyer DeepLinkDelegate's didResolveDeepLink callback,
// once the resolved result status is "found":
try await GrowSurfAppsFlyerAttribution.handle(resolvedDeepLinkValues, sdk: growsurf)
```

{% endtab %}
{% endtabs %}

* **On your OneLink:** AppsFlyer UDL exposes only `deep_link_value` and `deep_link_sub1` through `deep_link_sub10` to a **new** install, so the GrowSurf referral code must ride in one of those fields — a query-string-only `grsf` is not guaranteed to survive a cold install. Map the GrowSurf code into `deep_link_value` or a `deep_link_sub` field in your OneLink template. (Confirm the exact delegate API against your installed AppsFlyer SDK version.)

GrowSurf reads `grsf` out of whatever deep link AppsFlyer delivers — so a deferred referral is recovered only when UDL is configured, delivers the deep link on first launch, and the link carries `grsf` in a UDL-exposed field. The installed-app flow (a OneLink that opens an app the user already has) does not need UDL wiring.

***

## Additional Tips

* Test both flows before launching:
  * **Installed app flow:** Users who already have your app installed
  * **New install flow:** Users who don't have your app installed — on iOS this requires the [iOS Deferred Deep Linking](#ios-deferred-deep-linking-new-installs) setup above
* If the referral code is missing after a new install on iOS, confirm your OneLink carries the GrowSurf code in `deep_link_value` or `deep_link_sub1`–`deep_link_sub10` and that UDL is wired up — see [iOS Deferred Deep Linking](#ios-deferred-deep-linking-new-installs).
* **iOS deferred (cold install) is best-effort.** AppsFlyer resolves deferred links server-side (no clipboard). A referral can be missing after a *new* iOS install if the install happened more than \~15 minutes after the click (outside the UDL window — use the `onConversionDataSuccess` / Extended DDL fallback for longer gaps), if `grsf` wasn't placed in `deep_link_value` or `deep_link_sub1`–`deep_link_sub10`, or if the UDL delegate (`didResolveDeepLink`) wasn't wired. Provide a fallback such as manual referral-code entry. (Android's Play Install Referrer is deterministic and isn't affected by these.)
* See [iOS SDK Attribution Providers](/developer-tools/ios-sdk/attribution-providers), [Android SDK Attribution Providers](/developer-tools/android-sdk/attribution-providers), and [Getting Started for Native Mobile](/getting-started-for-native-mobile) for more details.


# AWeber

Update/add AWeber subscribers with their unique share link and referrer information.

## Sync with your AWeber List

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to AWeber* button.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to AWeber only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to AWeber.
{% endhint %}

![](/files/-MUw1EpTune7TN_j2l2h)

**Step 2:** Log in to AWeber

![](/files/-MUw1sndmflUwh--hZU1)

![](/files/-MUxyTXvJ95MPKnhGnRb)

**Step 3:** Once connected, select an AWeber account and then select an AWeber list that you want to automatically sync to. GrowSurf will add/update your AWeber subscribers every time a new participant is added or referred to your referral campaign.

## Examples

[View our AWeber tutorials](https://docs.growsurf.com/additional-integrations/aweber/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Fields** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new subscriber fields for your AWeber lists.

{% hint style="danger" %}
AWeber has a max limit on the number of custom fields that are allowed per subscriber/list. You can add up to 25 custom fields per list.

Please note that deleting a custom field will also delete any data already stored in that field for all of the subscribers on your list.
{% endhint %}

{% hint style="danger" %}
AWeber does not allow custom fields with the word "name" or "email". Because of this restriction, GrowSurf has shortened "name" to "n" and "email" to "e" within various custom fields. See the list below for more details.
{% endhint %}

| **Field Name**                           | **Variables**                                  | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | ---------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | {!custom GrowSurf Share URL}                   | TEXT     | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | {!custom GrowSurf Participant ID}              | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | {!custom GrowSurf Referral Status}             | TEXT     | The referral status of the participant\*                                                                                                                                                                  | CREDIT\_PENDING                                            |
| **GrowSurf Participant First N**         | {!custom GrowSurf Participant First N}         | TEXT     | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last N**          | {!custom GrowSurf Participant Last N}          | TEXT     | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First N**            | {!custom GrowSurf Referrer First N}            | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last N**             | {!custom GrowSurf Referrer Last N}             | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer E**                  | {!custom GrowSurf Referrer E}                  | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | {!custom GrowSurf Total Referral Count}        | NUMBER   | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | {!custom GrowSurf Monthly Referral Count}      | NUMBER   | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | {!custom GrowSurf Prev Monthly Referral Count} | NUMBER   | The participant's previous month referral count                                                                                                                                                           | 200                                                        |
| **GrowSurf Next Milestone**              | {!custom GrowSurf Next Milestone}              | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | {!custom GrowSurf Next Monthly Milestone}      | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | {!custom GrowSurf Total Invite Count}          | NUMBER   | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | {!custom GrowSurf Total Impression Count}      | NUMBER   | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these new subscriber fields in your AWeber email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `{{ subscriber.custom_field['growsurf_share_url'] }}` in your emails to provoke your subscribers to make referrals!​

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to AWeber, or if they are being added but their unique referral link isn't being synced to AWeber:**
  * Activity logs will denote if a participant was added to AWeber or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your AWeber emails.

When you connect your GrowSurf campaign to AWeber, you can easily embed a referral program into your AWeber emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your AWeber email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{!custom GrowSurf Share URL}" style="color: #1673df; text-decoration: none;">{!custom GrowSurf Share URL}</a>
      </p>
      <div> 
        <a href="mailto:?body={!custom GrowSurf Share URL}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
        <a href="https://www.facebook.com/sharer/sharer.php?u={!custom GrowSurf Share URL}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
        <a href="https://twitter.com/intent/tweet?url={!custom GrowSurf Share URL}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11, replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color
4. At line 15, replace the text `{!custom GrowSurf Share URL}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{!custom GrowSurf Share URL}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your AWeber email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;">
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%; max-width: 300px;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center">
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your AWeber email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="padding: 20px; text-align: left;">
         <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
         <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
      </td>
   </tr>
   <tr>
      <td style="padding-left: 20px; padding-right: 20px;">
         <hr style="width:100%; text-align:left;">
      </td>
   </tr>
   <tr>
      <td style="padding: 20px;">
         <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
         <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
         <table border="0" cellpadding="0" style="padding-bottom: 20px;">
            <tr>
               <td style="padding: 10px;">
                  <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
               </td>
               <td style="padding: 10px; text-align: left;">
                  <h3 style="margin-bottom: 5px;">Spread the word</h3>
                  <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
               </td>
            </tr>
            <tr>
               <td style="padding: 10px;">
                  <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
               </td>
               <td style="padding: 10px; text-align: left;">
                  <h3 style="margin-bottom: 5px;">You'll get $10</h3>
                  <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
               </td>
            </tr>
            <tr>
               <td style="padding: 10px;">
                  <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
               </td>
               <td style="padding: 10px; text-align: left;">
                  <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
                  <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
               </td>
            </tr>
         </table>
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your AWeber email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
         <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
         <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
      </td>
   </tr>
   <tr>
      <td style="text-align: center;">
         <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
      </td>
   </tr>
   <tr>
      <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
         <table border="0" cellpadding="0">
            <tr>
               <td style="width: 100%; text-align: left; line-height: 1.6">
                  <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p>
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
               </td>
            </tr>
         </table>
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your AWeber email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="padding: 20px; text-align: center;">
         <h1 style="margin: 5px;">Give $100, Get $100</h1>
         <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
      </td>
   </tr>
   <tr>
      <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
         <p>Give $100, Get $100.</p>
         <p>Did you know that you can get $100 for referrals?</p>
         <p style="line-height: 1.6;">Simply share your unique referral link: 
            <a href="{!custom GrowSurf Share URL}" style="color: #4f46e5; text-decoration: none;">{!custom GrowSurf Share URL}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
         </p>
      </td>
   </tr>
   <tr>
      <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your AWeber email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
   <tr>
      <td style="text-align: center; border-top: 0; border-bottom: 0; ">
         <div style="padding: 20px;">
         <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
         <div>
         <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
      </td>
   </tr>
   <tr>
      <td style="padding-bottom: 20px; font-size: 16px;">
         <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
      </td>
   </tr>
   <tr>
      <td style="padding-top: 0; font-size: 16px;">
         <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{!custom GrowSurf Share URL}" style="color: #ffffff;">{!custom GrowSurf Share URL}</a></p>
      </td>
   </tr>
   <tr>
      <td style="font-size: 16px; padding-top: 20px;" align="center">
         <p style="color: #ffffff;">Or spread the word on social media:</p>
      </td>
   </tr>
   <tr>
      <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
         <a href="https://twitter.com/intent/tweet?url={!custom GrowSurf Share URL}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
         </a>
         <a href="https://www.facebook.com/sharer/sharer.php?u={!custom GrowSurf Share URL}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
         </a>
         <a href="mailto:?body={!custom GrowSurf Share URL}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
         </a>
         <a href="https://www.linkedin.com/shareArticle?mini=true&url={!custom GrowSurf Share URL}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
         </a>
         <a href="https://wa.me?text={!custom GrowSurf Share URL}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
         <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
         </a>
      </td>
   </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{!custom GrowSurf Share URL}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{!custom GrowSurf Share URL}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your AWeber email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your AWeber email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
     <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
     <tr>
       <td style="padding: 20px; background: #ffffff;">
         <table border="0" cellpadding="0" cellspacing="0">
           <tr>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">Spread the word</p>
               <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
             </td>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">You'll get $10</p>
               <p>Receive $10 for each friend your refer that makes their first deposit</p>
             </td>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">Your friends get $10</p>
               <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
             </td>
           </tr>
         </table>
       </td>
     </tr>
     <tr>
       <td style="text-align: center;"> 
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
      </td>
     </tr>
   </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your AWeber email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{!custom GrowSurf Share URL}" style="color: #8E4CED;">{!custom GrowSurf Share URL}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {!custom GrowSurf Total Referral Count} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="color: #8E4CED;">Check your status here</a>. {!custom GrowSurf Next Milestone}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{!custom GrowSurf Next Milestone}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your AWeber email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {!custom GrowSurf Total Referral Count} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{!custom GrowSurf Share URL}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{!custom GrowSurf Share URL}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{!custom GrowSurf Next URL}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{!custom GrowSurf Total Referral Count}`. In this example, you would display any one of these five images at a given time:
   1. If `{!custom GrowSurf Total Referral Count}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{!custom GrowSurf Total Referral Count}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{!custom GrowSurf Total Referral Count}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{!custom GrowSurf Total Referral Count}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{!custom GrowSurf Total Referral Count}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{!custom GrowSurf Next Milestone}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your AWeber email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{!custom GrowSurf Share URL}" style="color: #8E4CED;">{!custom GrowSurf Share URL}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your AWeber email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{!custom GrowSurf Share URL}" style="color: #F46A54;">{!custom GrowSurf Share URL}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!email}&grsf_first_name={!firstname}&grsf_last_name={!lastname}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your AWeber email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{!custom GrowSurf Share URL}" style="color: #F46A54;">{!custom GrowSurf Share URL}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Bask Health

Bask Health customers can integrate a customer referral program with minimal effort.

{% hint style="info" %}
**Note:** This integration is managed by Bask Health. For assistance, please reach out to [GrowSurf support](http://app.growsurf.com/settings#contact_support) to schedule a call where we can help walk you through technical setup.
{% endhint %}

Follow the instructions below to set up a customer-to-customer referral program for your Bask Health Storefront.

## Set up your GrowSurf campaign <a href="#set-up-your-growsurf-campaign" id="set-up-your-growsurf-campaign"></a>

**Step 1:** Sign up for a free GrowSurf trial account [here](http://app.growsurf.com/signup) and create your first campaign.

**Step 2:** Once you get to the Installation section in the Campaign Editor, select "Sign Up + Qualifying Action" in the first screen (if you went through the quickstart onboarding process, this option is already selected for you so you can move on to the next step). Then click *Continue*.

<figure><img src="/files/r1kGWMlPRYkzKDTcVEFA" alt=""><figcaption></figcaption></figure>

**Step 3:** For the referral tracking method, select "Programmatically using the GrowSurf API". Then click *Continue*.

<figure><img src="/files/hlOzJDdfTd1klGo2G60V" alt=""><figcaption></figcaption></figure>

**Step 4**: For the Share URL, enter your Bask Health-hosted page that contains your questionnaire. This is a page that your new prospective patients would go through to qualify and sign up. Then click *Continue*.

{% hint style="warning" %}
**Tip:** Your questionnaire page may be something like `https://join.yoursite.com/start-online-visit` or `https://enroll.yoursite.com/start-online-visit/commercial`. Here is an example of what that page may look like:

<img src="/files/iCP0S13jsvYtmbz3u1FL" alt="" data-size="original">
{% endhint %}

<figure><img src="/files/F1Zrwj4LLBV6HL0f2q0v" alt=""><figcaption></figcaption></figure>

**Step 5:** In the final installation page, ignore all of the steps and scroll to the bottom of the page and click *Finish and Publish Campaign*.

<figure><img src="/files/RMqxfKVSbyRNoJ0h8lMs" alt=""><figcaption></figcaption></figure>

***

## Connect GrowSurf to Bask Health <a href="#connect-growsurf-to-bask-health" id="connect-growsurf-to-bask-health"></a>

**Step 1:** [Log in](https://app.growsurf.com/signin) to your GrowSurf admin dashboard for your program and navigate to *Integrations > Bask Health*. Open up the Bask Health integration card. You'll need to enter these values later into your Bask Health Storefront.

<figure><img src="/files/lkgs3GeP57WL48XIMgJ0" alt=""><figcaption></figcaption></figure>

**Step 2:** [Log in](https://app.bask.health/login) to your Bask Health Storefront and click on *Settings.*

<figure><img src="/files/py9tw4X8kUkbJdRMIVVI" alt=""><figcaption></figcaption></figure>

**Step 3:** Navigate to *Integrations* and install GrowSurf.

<figure><img src="/files/bA3dJAfzM4Dfz9Xw9a1t" alt=""><figcaption></figcaption></figure>

**Step 4:** Enter the GrowSurf API key and campaign ID from Step 1. Then check the "Manual opt-in for referral program" checkbox and click *Connect*.

<figure><img src="/files/NS7H51Jlpmgr6bQCvlLB" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Once you are connected**:

Referrals will only be added to your campaign after all of these events occur: (1) the online questionnaire is completed, and (2) doctor approval is received. You can confirm successful referrals by viewing *Referrals* *> Referrals* in your GrowSurf admin portal.
{% endhint %}

***

## Set up reward automation

When a referral is triggered (e.g, your referral gets doctor approval in Bask Health), GrowSurf can issue the referrer and/or referred friend fixed credits in your Bask Health Storefront, which will show up on their next checkout.

Here's how to set that up:

**Step 1:** [Log in](https://app.bask.health/login) to your Bask Health Storefront and navigate to *Settings > Integrations > GrowSurf.*

**Step 2:** Copy the Webhook URL (it may look something like `https://api.bask.ninja/webhook/growsurf/events`)

<figure><img src="/files/GgCOnQOFe7ZzICwodPG7" alt="" width="305"><figcaption></figcaption></figure>

**Step 3:** Copy the Webhook Secret (it may look something like `2213100a-b7dc-42fc-764d-2861626e44d1`)

<figure><img src="/files/Q6obGBQf2hafWrv4wkCf" alt="" width="304"><figcaption></figcaption></figure>

**Step 4:** [Log in](https://app.growsurf.com/signin) to your GrowSurf account and navigate to *Campaign Editor > 4. Options > Integrations > Webhooks* and click "Show advanced webhook settings". Then enter the following detail&#x73;*:*

* Paste the Webhook URL (from step 2)
* Paste the Webhook Secret (from step 3)
* For the webhook events, make sure only this event is selected: *New Participant Reward*

<figure><img src="/files/EKvMwrelMIqL3fOjjl7D" alt=""><figcaption></figcaption></figure>

**Step 5:** Navigate to the Rewards tab in the GrowSurf Campaign Editor, then click the *Continue* button.

<figure><img src="/files/0CgRquKf5cO9ORlS5no3" alt=""><figcaption></figcaption></figure>

**Step 6:** Next to your reward, click the three-dot dropdown menu and then click *Edit.*

<figure><img src="/files/h5vxRDQo4GR6ty3WRo4n" alt=""><figcaption></figcaption></figure>

**Step 7:** Click the *Advanced reward settings* toggl&#x65;*,* then click the *Add metadata* button.

* For the first field, enter `rewardAmount`
* For the second field, enter the credit amount that you want to provide to winners (e.g, `50`). Make sure this field is a number.

<figure><img src="/files/c2AzOMBia2C33L3KyHTH" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Bask Health will then automatically apply Bask credits to the referrer and/or referrer(s) on their next checkout based on your `rewardAmount`.
{% endhint %}

{% hint style="info" %}
**Looking for alternative rewards?**

Instead of issuing credits within Bask Health, you can also send cash payouts (via PayPal), gift cards (via Tango Card), or any other custom rewards (via Zapier or Webhooks) to referrers and/or referred friends:

* View the [PayPal integration](https://docs.growsurf.com/integrations/paypal#payouts) to automate cash payouts.
* View the [Tango Card integration](https://docs.growsurf.com/integrations/tango-card#how-to-connect-to-tango-card) to automate gift cards.
* View the [Zapier integration](https://docs.growsurf.com/integrations/zapier) or [Webhooks integration](https://docs.growsurf.com/developer-tools/webhooks) to automate any other custom rewards.
  {% endhint %}

***

## Set up a referral portal

A referral portal allows your existing customers to grab their referral link, start sharing via social channels, and track the status of who they referred.

To see the different options, navigate to your [GrowSurf admin dashboard](https://app.growsurf.com/dashboard), and click on *Campaign Actions > View How to Share.* You will then be able to view the different ways you can set up a referral portal.

{% hint style="success" %}
We recommend using the GrowSurf-hosted referral portal, as it’s the easiest and fastest option. Simply share your referral portal URL (formatted as `https://grow.surf/YOUR_CAMPAIGN_ID`) with your customers. They can visit the link and start sharing their referral immediately.
{% endhint %}

***

## Test your referral program

Once you have everything set up, [follow this testing guide](https://support.growsurf.com/article/209-best-practices-for-testing-your-campaign) to ensure that your referral flow and reward automations work as you expected them to.


# Bento

Update Bento people with their unique share link and referrer information.

## Sync with your Bento List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Bento integration card, and enter your Bento Publishable Key, Secret Key, and Site UUID (to retrieve these values, [log in to Bento](https://app.bentonow.com/) then navigate to *Settings > API Keys*).

{% hint style="info" %}
**IMPORTANT**: Because the GrowSurf data sync to Bento only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Bento.
{% endhint %}

<figure><img src="/files/H0DxyF1EtpRtWGLqTNP4" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, choose a Bento tag that you want to automatically sync to. GrowSurf will add/update your Bento people every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

<figure><img src="/files/PWa0dqWycCE96pG3q4Dg" alt=""><figcaption></figcaption></figure>

## Examples

[View our Bento tutorials](https://docs.growsurf.com/additional-integrations/bento/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Person Attributes** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these person attributes for your Bento people.

| **Person Attribute**                     | **Attribute Name**                               | **Attribute Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | ------------------------------------------------ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `{{ visitor.grsf_share_url }}`                   | TEXT               | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `{{ visitor.grsf_participant_id }}`              | TEXT               | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `{{ visitor.grsf_referral_status }}`             | TEXT               | The referral status of the participant\*                                                                                                                                                                  | CREDIT\_PENDING                                            |
| **GrowSurf Participant First Name**      | `{{ visitor.grsf_participant_first_name }}`      | TEXT               | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `{{ visitor.grsf_participant_last_name }}`       | TEXT               | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `{{ visitor.grsf_referrer_first_name }}`         | TEXT               | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `{{ visitor.grsf_referrer_last_name }}`          | TEXT               | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `{{ visitor.grsf_referrer_email }}`              | TEXT               | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `{{ visitor.grsf_total_referral_count }}`        | NUMBER             | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `{{ visitor.grsf_monthly_referral_count }}`      | NUMBER             | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `{{ visitor.grsf_prev_monthly_referral_count }}` | NUMBER             | The participant's previous month referral count                                                                                                                                                           | 20                                                         |
| **GrowSurf Next Milestone**              | `{{ visitor.grsf_next_milestone }}`              | TEXT               | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `{{ visitor.grsf_next_monthly_milestone }}`      | TEXT               | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `{{ visitor.grsf_total_invite_count }}`          | NUMBER             | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `{{ visitor.grsf_total_impression_count }}`      | NUMBER             | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral, and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window, so their referrer did not receive referral credit).

You can use these new properties in your Bento email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `{{ visitor.grsf_share_url }}` in your emails to provoke your people to make referrals!

[Click here to learn more about how to personalize Bento emails.​](https://help.brevo.com/hc/en-us/articles/360001008200-Personalize-your-email-with-contact-attributes)

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Bento, or if they are being added but their unique referral link isn't being synced to Bento:**
  * Activity logs will denote if a participant was added to Bento or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your Bento emails.

When you connect your GrowSurf campaign to Bento, you can easily embed a referral program into your Bento emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Bento email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{{ visitor.grsf_share_url }}" style="color: #1673df; text-decoration: none;">{{ visitor.grsf_share_url }}</a>
      </p>
      <div> 
      <a href="mailto:?body={{ visitor.grsf_share_url }}20Share%20URL%7D%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ visitor.grsf_share_url }}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
      <a href="https://twitter.com/intent/tweet?url={{ visitor.grsf_share_url }}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{{`` ``visitor.grsf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ visitor.grsf_share_url }}` encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Bento email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Bento email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Bento email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p>
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{email}}&grsf_first_name={{first_name}}&grsf_last_name={{last_name}}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td> 
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Bento email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="{{ visitor.grsf_share_url }}" style="color: #4f46e5; text-decoration: none;">{{ visitor.grsf_share_url }}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Bento email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;">
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{ visitor.grsf_share_url }}" style="color: #ffffff;">{{ visitor.grsf_share_url }}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{ visitor.grsf_share_url }}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ visitor.grsf_share_url }}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{ visitor.grsf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ visitor.grsf_share_url }}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{ visitor.grsf_share_url }}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{ visitor.grsf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ visitor.grsf_share_url }}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Bento email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
    <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 11, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Bento email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Bento email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Get your swag
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{ visitor.grsf_share_url }}" style="color: #8E4CED;">{{ visitor.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{ visitor.grsf_total_referral_count }} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="color: #8E4CED;">Check your status here</a>. {{ visitor.grsf_next_milestone }}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{ visitor.grsf_next_milestone }}`is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Bento email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{ visitor.grsf_total_referral_count }} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{ visitor.grsf_share_url }}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{ visitor.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{ visitor.grsf_next_milestone }}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{ visitor.grsf_total_referral_count }}`. In this example, you would display any one of these five images at a given time:\*
   1. If `{{ visitor.grsf_total_referral_count }}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{ visitor.grsf_total_referral_count }}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{ visitor.grsf_total_referral_count }}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{ visitor.grsf_total_referral_count }}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{ visitor.grsf_total_referral_count }}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{ visitor.grsf_next_milestone }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Bento email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{ visitor.grsf_share_url }}" style="color: #8E4CED;">{{ visitor.grsf_share_url }}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Bento email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{ visitor.grsf_share_url }}" style="color: #F46A54;">{{ visitor.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ visitor.email }}&grsf_first_name={{ visitor.first_name }}&grsf_last_name={{ visitor.last_name }}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Bento email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{ visitor.grsf_share_url }}" style="color: #F46A54;">{{ visitor.grsf_share_url }}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Branch

Preserve GrowSurf referral attribution in Branch links for native mobile app referrals.

## How It Works

If you use Branch, we recommend using a Branch link as your GrowSurf campaign Share URL.

This is the URL that referred friends land on when they open up a referral link. Depending on the device they open the link on (web, iOS, or Android), they will either land on a webpage or your App Store / Google Play listing on mobile.

When a participant shares their referral link, the GrowSurf referral code must stay attached to the Branch link. Your app then passes the Branch deep link payload into the GrowSurf mobile SDK before calling `addReferredParticipant()`.

***

## How to Set Up

**Step 1:** In GrowSurf, open *Campaign Editor > 5. Installation* and set your Share URL to the Branch link that routes users to your app.

<figure><img src="/files/76iLLxsusTpH1PsOJvml" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
There's no configuration necessary in Branch, because Branch will automatically preserve `grsf` URL parameters in redirects.
{% endhint %}

**Step 2:** Pass the Branch callback payload into the GrowSurf attribution adapter before calling `addReferredParticipant()`.

{% tabs %}
{% tab title="iOS" %}

```swift
import GrowSurfBranchAttribution

try await GrowSurfBranchAttribution.handle(branchParams, sdk: growsurf)
```

{% endtab %}

{% tab title="Android" %}

```kotlin
import com.growsurf.sdk.attribution.branch.GrowSurfBranchAttribution

GrowSurfBranchAttribution.handle(branchParams, growsurf)
```

{% endtab %}
{% endtabs %}

**Step 3:** Call `addReferredParticipant()` after the GrowSurf SDK has handled attribution. This method will validate pending attribution and creates a new referred participant record only when there is a valid referrer.

***

## iOS Deferred Deep Linking (New Installs)

This is the primary path for an app referral program — a referral targets people who don't have your app yet, so most referred installs are cold installs. On iOS it's best-effort even when configured (see the troubleshooting tips below), so pair it with a fallback such as manual referral-code entry.

For users who tap a Branch link (and don't have your iOS app installed), the referral code only survives the install if Branch **NativeLink** is set up. iOS 14+ removed the device matching Branch previously used for deferred installs (and iOS 15 Private Relay masked the click IP), so on modern iOS the referral is carried by an encrypted clipboard token (NativeLink) instead. Without it, an iOS user who installs from a referral link opens the app with no referral data, and `addReferredParticipant()` finds no referrer.

To enable it:

* **In the Branch dashboard:** turn on **NativeLink** (Configuration → Enable NativeLink), and make sure your link is **not web-only** — the iOS redirect must be allowed to open/install the app (not `$web_only` / a forced web URL), so Branch can write its NativeLink token on the click.
* **In your app:** call `checkPasteboardOnInstall()` **before** `initSession()` so the SDK reads that token on first launch:

{% tabs %}
{% tab title="iOS" %}

```swift
Branch.getInstance().checkPasteboardOnInstall() // must be called BEFORE initSession
Branch.getInstance().initSession(launchOptions: launchOptions) { params, _ in
    Task { try? await GrowSurfBranchAttribution.handle(params ?? [:], sdk: growsurf) }
}
```

{% endtab %}
{% endtabs %}

On iOS 16+, a silent clipboard read still works but always surfaces Apple's one-time "Pasted from …" prompt on first launch. If you'd rather show an explicit, user-tappable paste button instead of reading silently, Branch offers **`BranchPasteControl`** (built on Apple's `UIPasteControl`) for iOS 16+ — which approach to use is a Branch SDK decision that depends on your Branch SDK version, so follow Branch's current iOS NativeLink documentation for the exact API.

NativeLink only carries the referral if `grsf` is present in the Branch link payload it restores. GrowSurf reads `grsf` out of whatever deep link Branch delivers, so deferred attribution survives a cold install only when NativeLink is enabled and the resolved Branch link still contains `grsf`. The installed-app flow (a Branch link that opens an app the user already has) does not need NativeLink.

***

## Additional Tips

* Test both flows before launching:
  * **Installed app flow:** Users who already have your app installed
  * **New install flow:** Users who don't have your app installed
* If the referral code is missing after app install, confirm that Branch deep link data contains `grsf`, `ref`, `referredBy`, or `~referring_link`.
* **iOS deferred (cold install) is best-effort.** Even when NativeLink is set up correctly, a referral can be missing after a *new* iOS install if the user declined the iOS "Paste from …" prompt on first launch, copied something else before opening the app (overwriting the clipboard token), or tapped the link from an in-app / non-Safari browser. Provide a fallback such as manual referral-code entry, and don't assume the user always lands on a specific screen. (Android's Play Install Referrer is deterministic and isn't affected by these.)
* See [iOS SDK Attribution Providers](/developer-tools/ios-sdk/attribution-providers), [Android SDK Attribution Providers](/developer-tools/android-sdk/attribution-providers), and [Getting Started for Native Mobile](/getting-started-for-native-mobile) for more details.


# Brevo

Update Brevo contacts with their unique share link and referrer information.

## Sync with your Brevo List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Brevo integration card, and enter your Brevo API secret ([click here to get your Brevo private API key](https://app.brevo.com/settings/keys/api)).

{% hint style="info" %}
**IMPORTANT**: Because the GrowSurf data sync to Brevo only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Brevo.
{% endhint %}

<figure><img src="/files/m7pH7KcAjduiWJvPcOhG" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
**IMPORTANT**: If you receive an error while connecting, this may be because Brevo is blocking API calls made by unknown IP addresses. Visit [Brevo > Security > Authorized IPs](https://app.brevo.com/security/authorised_ips) and perform one of the following options below:

* **Option A (Recommended)**: Whitelist GrowSurf's IP address by following the steps below:\
  \
  1\. Click "Add authorized IP address" (see image below).

  <figure><img src="/files/7WWte4JjRKx0PbCsYAo5" alt=""><figcaption></figcaption></figure>

  \
  2\. Add the IP address `68.183.250.67`. \\
* **Option B**: You can also deactivate "Blocking of unknown IP addresses" to allow all IP addresses (see image below).

  <figure><img src="/files/ahd7qYONP4yoZZ9cf7Kd" alt=""><figcaption></figcaption></figure>

{% endhint %}

**Step 2:** Once connected, choose the Brevo list that you want to automatically sync to. GrowSurf will add/update your Brevo contacts every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

<figure><img src="/files/dVXg9QuZitsxMUiF44u3" alt=""><figcaption></figcaption></figure>

## Examples

[View our Brevo tutorials](https://docs.growsurf.com/additional-integrations/sendinblue/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Contact Attributes** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these contact attributes for your Brevo contacts.

| **Contact Attribute**                    | **Attribute Name**                               | **Attribute Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | ------------------------------------------------ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `{{ contact.GRSF_SHARE_URL }}`                   | TEXT               | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `{{ contact.GRSF_PARTICIPANT_ID }}`              | TEXT               | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `{{ contact.GRSF_REFERRAL_STATUS }}`             | TEXT               | The referral status of the participant\*                                                                                                                                                                  | CREDIT\_PENDING                                            |
| **GrowSurf Participant First Name**      | `{{ contact.GRSF_PARTICIPANT_FIRST_NAME }}`      | TEXT               | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `{{ contact.GRSF_PARTICIPANT_LAST_NAME }}`       | TEXT               | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `{{ contact.GRSF_REfERRER_FIRST_NAME }}`         | TEXT               | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `{{ contact.GRSF_REFERRER_LAST_NAME }}`          | TEXT               | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `{{ contact.GRSF_REFERRER_EMAIL }}`              | TEXT               | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `{{ contact.GRSF_TOTAL_REFERRAL_COUNT }}`        | NUMBER             | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `{{ contact.GRSF_MONTHLY_REFERRAL_COUNT }}`      | NUMBER             | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `{{ contact.GRSF_PREV_MONTHLY_REFERRAL_COUNT }}` | NUMBER             | The participant's previous month referral count                                                                                                                                                           | 20                                                         |
| **GrowSurf Next Milestone**              | `{{ contact.GRSF_NEXT_MILESTONE }}`              | TEXT               | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `{{ contact.GRSF_NEXT_MONTHLY_MILESTONE }}`      | TEXT               | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `{{ contact.GRSF_TOTAL_INVITE_COUNT }}`          | NUMBER             | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `{{ contact.GRSF_TOTAL_IMPRESSION_COUNT }}`      | NUMBER             | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral, and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window, so their referrer did not receive referral credit).

You can use these new properties in your Brevo email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include`{{ contact.GRSF_SHARE_URL }}` in your emails to provoke your contacts to make referrals!

[Click here to learn more about how to personalize Brevo emails.​](https://help.brevo.com/hc/en-us/articles/360001008200-Personalize-your-email-with-contact-attributes)

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Brevo, or if they are being added but their unique referral link isn't being synced to Brevo:**
  * Activity logs will denote if a participant was added to Brevo or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your Brevo emails.

When you connect your GrowSurf campaign to Brevo, you can easily embed a referral program into your Brevo emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Brevo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{{ contact.GRSF_SHARE_URL }}" style="color: #1673df; text-decoration: none;">{{ contact.GRSF_SHARE_URL }}</a>
      </p>
      <div> 
      <a href="mailto:?body={{ contact.GRSF_SHARE_URL }}20Share%20URL%7D%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ contact.GRSF_SHARE_URL }}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
      <a href="https://twitter.com/intent/tweet?url={{ contact.GRSF_SHARE_URL }}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{{ contact.GRSF_SHARE_URL }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ contact.GRSF_SHARE_URL }}` encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Brevo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Brevo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Brevo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p>
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{email}}&grsf_first_name={{first_name}}&grsf_last_name={{last_name}}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td> 
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Brevo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="{{ contact.GRSF_SHARE_URL }}" style="color: #4f46e5; text-decoration: none;">{{ contact.GRSF_SHARE_URL }}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Brevo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;">
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{ contact.GRSF_SHARE_URL }}" style="color: #ffffff;">{{ contact.GRSF_SHARE_URL }}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{ contact.GRSF_SHARE_URL }}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ contact.GRSF_SHARE_URL }}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{ contact.GRSF_SHARE_URL }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ contact.GRSF_SHARE_URL }}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{ contact.GRSF_SHARE_URL }}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{ contact.GRSF_SHARE_URL }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ contact.GRSF_SHARE_URL }}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Brevo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
    <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 11, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Brevo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Brevo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Get your swag
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{ contact.GRSF_SHARE_URL }}" style="color: #8E4CED;">{{ contact.GRSF_SHARE_URL }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{ contact.GRSF_TOTAL_REFERRAL_COUNT }} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="color: #8E4CED;">Check your status here</a>. {{ contact.GRSF_NEXT_MILESTONE }}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{ contact.GRSF_NEXT_MILESTONE }}`is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Brevo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{ contact.GRSF_TOTAL_REFERRAL_COUNT }} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{ contact.GRSF_SHARE_URL }}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{ contact.GRSF_SHARE_URL }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{ contact.GRSF_NEXT_MILESTONE }}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{ contact.GRSF_TOTAL_REFERRAL_COUNT }}`. In this example, you would display any one of these five images at a given time:\*
   1. If `{{ contact.GRSF_TOTAL_REFERRAL_COUNT }}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{ contact.GRSF_TOTAL_REFERRAL_COUNT }}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{ contact.GRSF_TOTAL_REFERRAL_COUNT }}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{ contact.GRSF_TOTAL_REFERRAL_COUNT }}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{ contact.GRSF_TOTAL_REFERRAL_COUNT }}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{ contact.GRSF_NEXT_MILESTONE }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Brevo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{ contact.GRSF_SHARE_URL }}" style="color: #8E4CED;">{{ contact.GRSF_SHARE_URL }}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Brevo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{ contact.GRSF_SHARE_URL }}" style="color: #F46A54;">{{ contact.GRSF_SHARE_URL }}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.EMAIL }}&grsf_first_name={{ contact.FIRSTNAME }}&grsf_last_name={{ contact.LASTNAME }}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g., `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Brevo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{ contact.GRSF_SHARE_URL }}" style="color: #F46A54;">{{ contact.GRSF_SHARE_URL }}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g., `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Cal.com

Add referral tracking to your Cal.com form to automatically recognize new leads that come through referrals.

{% hint style="info" %}
**Please note the following requirements to make Cal.com work with GrowSurf**:

* Your form must be embedded on your own webpage (you cannot use the stand-alone `https://cal.com/xxxx/xxxx` webpage).
  {% endhint %}

## Prep Your Form <a href="#prep-your-form" id="prep-your-form"></a>

If you have an embedded Cal.com form on your website that you want to add referral tracking to, follow these instructions:‌

**Step 1:** Open the GrowSurf campaign editor and navigate to the *Installation* tab.‌

**Step 2:** Continue through the installation steps until you reach the referral tracking method section (see image below).​‌

<figure><img src="/files/fadeNaurt0FxYriwPZ4D" alt=""><figcaption></figcaption></figure>

**Step 3:** Click the Cal.com icon and follow your campaign-specific instructions (see image below).‌

<figure><img src="/files/PIdTc1u4ZZcSWOtRYS8u" alt=""><figcaption></figcaption></figure>

**Step 4:** Once your Cal.com form has been prepped, continue on with the rest of the GrowSurf installation process.‌

## Additional Tips <a href="#additional-tips" id="additional-tips"></a>

* While following your campaign-specific Cal.com instructions in the GrowSurf campaign editor, you may skip any steps that you have already completed from previous setup in Cal.com.
* If you run into issues or have any questions, please reach out to [GrowSurf support](https://support.growsurf.com/) for assistance.


# Calendly

Add referral tracking to your Calendly form to automatically recognize new leads that come through referrals.

{% hint style="info" %}
**Please note the following requirements to make Calendly work with GrowSurf**:

* A *Calendly Pro* account is required.
* Your form must be embedded on your own webpage (you cannot use the stand-alone `https://calendly.com/xxxx/xxxx` webpage).
  {% endhint %}

## Prep Your Form

If you have an embedded Calendly form on your website that you want to add referral tracking to, follow these instructions:

**Step 1:** Open the GrowSurf campaign editor and navigate to the *Installation* tab.

**Step 2:** Continue through the installation steps until you reach the referral tracking method section (see image below).

![](/files/-Mfdn3Rgi1HSrre8W03T)

**Step 3:** Click the Calendly icon and follow your campaign-specific instructions (see image below).

![](/files/-MfdnyE2a7YRdIFUc1sI)

**Step 4:** Once your Calendly form has been prepped, continue on with the rest of the GrowSurf installation process.

## Additional Tips

* While following your campaign-specific Calendly instructions in the GrowSurf campaign editor, you may skip any steps that you have already completed from previous setup in Calendly.
* If you run into issues or have any questions, please reach out to [GrowSurf support](https://support.growsurf.com/) for assistance.


# Campaign Monitor

Update/add Campaign Monitor subscribers with their unique share link and referrer information.

## Sync with your Campaign Monitor List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to Campaign Monitor* button.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Campaign Monitor only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Campaign Monitor.
{% endhint %}

![](/files/-MQdQdreSMEMQxw6xvyA)

**Step 2:** Log in to Campaign Monitor

![](/files/-MQjX07w_DrsvaGRrdFC)

![](/files/-MQjhJ1MYcQRboX3ctFv)

**Step 3:** Once connected, choose a Campaign Monitor client and then select a Campaign Monitor list that you want to automatically sync to. GrowSurf will add/update your Campaign Monitor subscribers every time a new participant is added or referred to your referral campaign.

![](/files/-MQjkkrvtXbhIao0XbP0)

## Examples

[View our Campaign Monitor tutorials](https://docs.growsurf.com/additional-integrations/campaign-monitor/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Subscriber Fields** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new subscriber fields for your Campaign Monitor lists.

{% hint style="danger" %}
Campaign Monitor has a max limit on the number of custom fields that are allowed per subscriber/list. You can add up to 50 custom fields per list.

Please note that deleting a custom field will also delete any data already stored in that field for all of the subscribers on your list.
{% endhint %}

| **Field Name**                           | **Personalization Tag**              | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | ------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `[GrowSurfShareURL]`                 | TEXT     | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `[GrowSurfParticipantID]`            | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `[GrowSurfReferralStatus]`           | TEXT     | The referral status of the participant\*                                                                                                                                                                  | CREDIT\_PENDING                                            |
| **GrowSurf Participant First Name**      | `[GrowSurfParticipantFirstName]`     | TEXT     | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `[GrowSurfParticipantLastName]`      | TEXT     | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `[GrowSurfReferrerFirstName]`        | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `[GrowSurfReferrerLastName]`         | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `[GrowSurfReferrerEmail]`            | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `[GrowSurfTotalReferralCount]`       | NUMBER   | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `[GrowSurfMonthlyReferralCount]`     | NUMBER   | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `[GrowSurfPrevMonthlyReferralCount]` | NUMBER   | The participant's previous month referral count                                                                                                                                                           | 200                                                        |
| **GrowSurf Next Milestone**              | `[GrowSurfNextMilestone]`            | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `[GrowSurfNextMonthlyMilestone]`     | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `[GrowSurfTotalInviteCount]`         | NUMBER   | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `[GrowSurfTotalImpressionCount]`     | NUMBER   | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these new subscriber fields in your Campaign Monitor email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `[GrowSurfShareURL]` in your emails to provoke your subscribers to make referrals!​

[For more information about Campaign Monitor\`s personalization tags click here.](https://help.campaignmonitor.com/personalize-emails-with-subscriber-custom-fields)

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Campaign Monitor, or if they are being added but their unique referral link isn't being synced to Campaign Monitor:**
  * Activity logs will denote if a participant was added to Campaign Monitor or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
* **If an existing participant's information is not being synced within Campaign Monitor (e.g. referral counts, impression counts, etc) this is likely because Campaign Monitor is preventing it and returning an error to GrowSurf "***Subscriber was added too many times too quickly, try again later.***"**
  * The good news is we will continue to retry the sync with a progress backoff until our requests to their API are successful. This means that your participants' information in Campaign Monitor will eventually reflect their information within GrowSurf.


# Tutorials

We'll walk you through adding personalized referral program messaging to your Campaign Monitor emails.

When you connect your GrowSurf campaign to Campaign Monitor, you can easily embed a referral program into your Campaign Monitor emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="[GrowSurfShareURL]" style="color: #1673df; text-decoration: none;">[GrowSurfShareURL]</a>
      </p>
      <div> 
        <a href="mailto:?body=[GrowSurfShareURL]%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
        <a href="https://www.facebook.com/sharer/sharer.php?u=[GrowSurfShareURL]" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
        <a href="https://twitter.com/intent/tweet?url=[GrowSurfShareURL]&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11, replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `[GrowSurfShareURL]%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `[GrowSurfShareURL]` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
           <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
           </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
     <td style="text-align: center;">
        <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
     </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
       <h1 style="margin: 5px;">Give $100, Get $100</h1>
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="[GrowSurfShareURL]" style="color: #4f46e5; text-decoration: none;">[GrowSurfShareURL]</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
       <div style="padding: 20px;"> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
       <div>
       <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="[GrowSurfShareURL]" style="color: #ffffff;">[GrowSurfShareURL]</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url=[GrowSurfShareURL]&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u=[GrowSurfShareURL]" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body=[GrowSurfShareURL]%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url=[GrowSurfShareURL]" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text=[GrowSurfShareURL]" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `[GrowSurfShareURL]%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `[GrowSurfShareURL]` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
    <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="[GrowSurfShareURL]" style="color: #8E4CED;">[GrowSurfShareURL]</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have [GrowSurfTotalReferralCount] referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="color: #8E4CED;">Check your status here</a>. [GrowSurfNextMilestone]
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `[GrowSurfNextMilestone]` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  [GrowSurfTotalReferralCount] referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="[GrowSurfShareURL]" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">[GrowSurfShareURL]</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>[GrowSurfNextMilestone]</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `[GrowSurfTotalReferralCount]`. In this example, you would display any one of these five images at a given time:
   1. If `[GrowSurfTotalReferralCount]` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `[GrowSurfTotalReferralCount]` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `[GrowSurfTotalReferralCount]` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `[GrowSurfTotalReferralCount]` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `[GrowSurfTotalReferralCount]` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `[GrowSurfNextMilestone]` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="[GrowSurfShareURL]" style="color: #8E4CED;">[GrowSurfShareURL]</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="[GrowSurfShareURL]" style="color: #F46A54;">[GrowSurfShareURL]</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[email]&grsf_first_name=[firstname]&grsf_last_name=[lastname]" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Campaign Monitor email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="[GrowSurfShareURL]" style="color: #F46A54;">[GrowSurfShareURL]</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Chargebee

Trigger referrals on new Chargebee charges or automatically apply Chargebee coupons or credits as rewards.

## Referral Trigger

### **Description**

When you connect your Chargebee account to your GrowSurf campaign and enable *Referral Trigger*, GrowSurf will automatically detect and trigger referrals on new Chargebee charges.

GrowSurf will check if the Chargebee customer's email address matches a GrowSurf participant's email address. If a match is found, then a referral will trigger, giving referral credit to the referrer and unlocking any rewards, if applicable.

Even if the Chargebee customer's email address changes, GrowSurf will track those changes to ultimately ensure the referral trigger ties back to the referrer.

Here's how to set up Chargebee referral triggers:

### How to Set Up

{% hint style="warning" %}
**Important Note:** Unless your campaign is configured to add participants automagically ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), you'll need to make sure you first call JavaScript [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant) or REST API [`/POST Add Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant) to add new participant&#x73;**.**
{% endhint %}

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Chargebee integration card and enter your [Chargebee site](https://www.chargebee.com/docs/1.0/sites-intro.html), [Chargebee API key](https://www.chargebee.com/docs/2.0/api_keys.html), and [Chargebee product catalog version](https://www.chargebee.com/docs/2.0/product-catalog.html) for both live and test mode.

<figure><img src="/files/KHU43DStNRDdIKvzIYWm" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have *Referral Trigger* enabled by default. Enter your webhook username and webhook password. Click [here](https://www.chargebee.com/docs/2.0/webhook_settings.html#configure-webhooks) for instructions on how to configure webhooks.

<figure><img src="/files/FyQVkox3WsILJpo8NgNI" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important Note:** At a minimum, the following events should be selected for your Chargebee webhook:

* Customer Changed
* Payment Succeeded
* Payment Refunded
* Transaction Created
* Credit Note Created

Remember to toggle on "Exclude card information from webhook call"
{% endhint %}

<figure><img src="/files/zsdvTc7ohicaP7ylxpnN" alt=""><figcaption></figcaption></figure>

**(Optional) Step 3:** You can add a referral trigger hold period by toggling the *Show advanced settings* section.

{% hint style="info" %}
**Note:** The referral trigger hold period is useful for preventing fraud and helps minimize losses due to refunds and chargebacks. During this hold period, if there is a refund or chargeback, the referral trigger will be cancelled completely.
{% endhint %}

### Chargebee Metadata

GrowSurf will also update metadata for Chargebee customers who trigger referrals.

| **Metadata Key**                           | **Description**                                                          | **Example**                                                         |
| ------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------- |
| **GrowSurf Participant ID**                | The referred Chargebee customer's participant ID                         | `xyz456`                                                            |
| **GrowSurf Participant Referred By URL**   | The URL of the participant who referred the Chargebee customer           | `https://growsurf.com/dashboard/campaign/abc123/participant/xyz456` |
| **GrowSurf Participant Referred By Email** | The email address of the participant who referred the Chargebee customer | `bob@loblaw.com`                                                    |

### Test Mode

Our Chargebee integration comes with a test mode that allows you to test triggering referrals without using live payments. When you toggle *Test Mode* on, GrowSurf will also process all test mode payments made in your Chargebee account.

{% hint style="warning" %}
Important note: When you go live with your campaign, please make sure to switch back to live mode. Otherwise, referrals will not be triggered in live mode while test mode is enabled.
{% endhint %}

### Troubleshooting Tips

* When testing out the Chargebee Referral Trigger integration, make sure to view participants' activity logs for details that can help you troubleshoot any issues.
* If you were expecting a referral to be triggered in live mode, double-check that you do not have test mode enabled.
* If your Chargebee customer changes their email address and then makes a payment in Chargebee (which triggers a referral), there needs to be at least a few minutes between those events, or else the referral trigger will not register. This is because GrowSurf relies on Chargebee sending out a webhook event which notifies GrowSurf of the Chargebee customer's new email address.

## Coupons/Credits

### **Description**

When a GrowSurf participant unlocks a reward, apply a coupon or credit to a Chargebee customer subscription.

Even if the Chargebee customer's email address changes, GrowSurf will track those changes to ultimately ensure the Chargebee coupon/credit gets applied to the right Chargebee customer.

### How to Set Up

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Chargebee integration card and enter your [Chargebee site](https://www.chargebee.com/docs/1.0/sites-intro.html), [Chargebee API key](https://www.chargebee.com/docs/2.0/api_keys.html), and [Chargebee product catalog version](https://www.chargebee.com/docs/2.0/product-catalog.html).

{% hint style="info" %}
You must first select a default currency for your GrowSurf campaign in order to use Chargebee.\
\
Your default currency determines whether Chargebee coupons or credits can be applied to your Chargebee subscriptions. For example, if your default currency is USD then the coupon or credit that you set up can only be redeemed for Chargebee subscriptions that are using USD.
{% endhint %}

<figure><img src="/files/KHU43DStNRDdIKvzIYWm" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have *Referral Trigger* enabled by default. You can disable it if you only want to automate rewards using Chargebee *Coupons/Credits*.

<figure><img src="/files/FyQVkox3WsILJpo8NgNI" alt=""><figcaption></figcaption></figure>

**Step 3:** Click the *Coupons/Credits* tab and connect a reward(s) to Chargebee by clicking the *Connect a Reward* button.

{% hint style="info" %}
**Note:** When you connect to Chargebee, *Referral Trigger* will be enabled by default. If you are triggering referrals another way, disable the toggle in the *Referral Trigger* tab.
{% endhint %}

<figure><img src="/files/7zcWaUjEbqyZTlaffU47" alt=""><figcaption></figcaption></figure>

Click on either *Coupon* or *Credit.* If coupon is selected, enter the details of the coupon including the name, type, and discount. You can also click *Show advanced coupon* settings to view more customization settings.

{% hint style="info" %}
**Advanced feature tip: Issue different reward amounts by using dynamic rewards**

Dynamic rewards let you offer different reward values based on specific attributes of the referred friend (such as the pricing plan they signed up for) or referrer (such as their partner status).

For example, you can award $50 in credits to winners when their referral signs up for your base plan or $100 in credits when they sign up for a higher-costing plan.

[Learn more →](https://support.growsurf.com/article/357-how-to-set-up-dynamic-rewards)
{% endhint %}

<figure><img src="/files/XfYyeADrV87Q3fMgSOD8" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** By default, coupons are recommended. However, if you want rewards to be stackable (e.g, $10 off for every referred friend), you will want to use credits.
{% endhint %}

If credit is selected, enter the details of the credit including the description and credit amount, which is applied to the customer's promotional credits every time this reward is unlocked.

<figure><img src="/files/dePdwTUi5S3QgttzNRJJ" alt=""><figcaption></figcaption></figure>

Then hit Save. Now, anytime this reward is unlocked by a winning participant, a Chargebee coupon or credit will also be applied to the Chargebee subscription associated with the GrowSurf participant email address.

{% hint style="info" %}
With double-sided rewards, you have full flexibility in choosing who gets the coupon or credit reward: (1) just the referrer, (2) just the referred person, (3) or both referrer and referred person.
{% endhint %}

Once you save the reward, you should see a green dot, indicating that the Chargebee *Coupons/Credits* integration is enabled.

<figure><img src="/files/MoucEQVEg6EFWvhncTZI" alt=""><figcaption></figcaption></figure>

### Chargebee Metadata

GrowSurf will pass metadata when a coupon or credit is applied to a Chargebee subscription.

| **Metadata Key**                           | **Description**                                                                    | **Example**                                                                   |
| ------------------------------------------ | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| **GrowSurf Participant ID**                | The GrowSurf participant that unlocked the Chargebee coupon                        | `xyz456`                                                                      |
| **GrowSurf Participant URL**               | The URL of the GrowSurf participant that unlocked the Chargebee coupon             | `https://growsurf.com/dashboard/campaign/abc123/participant/xyz456`           |
| **GrowSurf Participant Referred By URL**   | The referred by URL of the GrowSurf participant that unlocked the Chargebee coupon | `https://growsurf.com/dashboard/campaign/abc123/participant/xyz456/undefined` |
| **GrowSurf Participant Referred By Email** | The email address of the participant's referrer                                    | `gavin.belson@hoolie.io`                                                      |

### Test Mode

Our Chargebee integration comes with a test mode that allows you to test coupons/credits without using live coupons/credits. When you toggle *Test Mode* on, GrowSurf will apply coupons/credits only to your Chargebee account in Test Mode. It is important to note that Chargebee coupons/credits created in test mode will only apply to Chargebee subscriptions that exist within your Chargebee account when test mode is toggled on.

To enable test mode, toggle the *Test Mode* switch at the bottom-right, then connect a reward(s).

<figure><img src="/files/9IFl0OFbTzANynqPbC81" alt=""><figcaption></figcaption></figure>

Please note that the rewards you connect, while Test Mode is enabled, are completely separate from the rewards you connect while in live mode.

<figure><img src="/files/xgFJWWcYZg0ADlxHQrY7" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important note:** When you go live with your campaign, please make sure to switch back to live mode. Otherwise, coupons/credits will not be issued in live mode while test mode is enabled.
{% endhint %}

### Troubleshooting Tips

If there is an issue with applying Chargebee coupons or credits, GrowSurf will send out a notification email to the campaign owner. The issue will also be stated in the participant's detail page when you view their reward or when you view the participant's activity logs.

Here are some common reasons why there may be failures:

* The customer with the associated GrowSurf participant email address does not exist in Chargebee (please make sure to live or test mode depending on if you have toggled on Test Mode in the GrowSurf Chargebee integration)
* If dynamic reward rules are enabled for the Chargebee reward, there may have been no matching rule found.
* If you were expecting a coupon/credit to be applied in live mode, double-check that you do not have test mode enabled.
* If your Chargebee customer changes their email address right before the Chargebee reward gets applied, they may not receive it. This is because GrowSurf relies on Chargebee sending out a webhook event which notifies GrowSurf of the Chargebee customer's new email address, but if there is not at least a few minutes before the reward event, GrowSurf will not know about the Chargebee customer's email change.

If there was a failure, you will need to manually issue the Chargebee reward from your [Chargebee dashboard](https://app.chargebee.com/).

#### Other notes:

* If you have manual reward approval enabled for your campaign: Chargebee coupons/credits will only be issued to the winner(s) only after you approve the reward.
* If the referral was triggered recently (or if the reward was approved recently), please allow for a few minutes of server processing before viewing the participant's reward from your GrowSurf admin dashboard. During this time, the data displayed for the participant's reward may not be accurate.

## Upfront Discounts

The **Upfront Discount** feature lets you create a campaign-wide coupon that is instantly available to referred friends, before they make a purchase (e.g., "Get 20% off your first invoice"). This is useful for giving referred visitors a discount code they can apply at your Chargebee customer signup or checkout flow.

### How It Works

1. In the GrowSurf campaign editor, go to *1. Rewards* and create a **Double-Sided** reward and enable **"Give the referred friend their reward upfront instead of after they complete the qualifying action"**. Save your changes.
2. Go to *4. Options > Integrations,* connect to Chargebee, then click "Connect a Reward" and link your rewards. For your Double-Sided reward, select "Both the referrer and referred friend."
3. Save changes. GrowSurf will automatically create a coupon on your Chargebee site. The coupon ID is also the code customers use.
4. When a referred visitor lands on your site, the promotion code is available via the GrowSurf JavaScript method [`growsurf.getUpfrontDiscount()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-upfront-discount).
5. When the referral triggers (e.g., the first-time purchase happens), only the **referrer** earns a reward. The referred friend's reward is not duplicated since it was already delivered upfront.

### Applying the Upfront Discount

You can retrieve the upfront discount using the JavaScript method [`growsurf.getUpfrontDiscount()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-upfront-discount) then apply it to your new referred customer:

```js
const discount = growsurf.getUpfrontDiscount('chargebee');
if (discount) {
  console.log(discount.promotionCode); // e.g., "grsf-a1b2c3d4"
  console.log(discount.couponId);      // Chargebee coupon ID
}
```

### Notes

* Upfront discount is only available for **Double-Sided** rewards with a referred friend coupon (not referrer rewards or credits).
* The upfront toggle is set on the reward in *Campaign Editor > 1. Rewards*. The Chargebee integration settings will show the generated coupon code as read-only.
* If you change the referred friend coupon settings in the Chargebee integration, the coupon is automatically re-synced. (Behind the scenes, we delete the old coupon and create a new one. Your existing Chargebee customers who already have the old coupon applied will remain unaffected).
* Upfront discounts cannot be used with [dynamic rewards](https://support.growsurf.com/article/357-how-to-set-up-dynamic-rewards). If you are using dynamic rewards, we recommend creating a single-sided reward and utilizing [`growsurf.validateReferrer()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#validate-referrer) then applying your own coupon code for referred visitors.


# Constant Contact

Update Constant Contact contacts with their unique share link and referrer information.

## Sync with your Constant Contact List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to Constant Contact* button.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Constant Contact only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Constant Contact.
{% endhint %}

![](/files/-MO82rlXrL18XlBFxuoJ)

**Step 2:** Log in to Constant Contact and authorize GrowSurf

![](/files/-MO82w59WBVfzXe8s3pF)

**Step 3:** Once connected, choose the Constant Contact list that you want to automatically sync to. GrowSurf will add/update your Constant Contact contacts every time a new participant is added or referred to your referral campaign.

![](/files/-MO91kZ9GdDYk93djgdN)

## Examples

[View our Constant Contact tutorials](https://docs.growsurf.com/additional-integrations/constant-contact/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Contact Fields** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these custom contact fields for your Constant Contact contacts.

| **Custom Field**                         | **Variables**                                     | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | ------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `[[custom.growsurf_share_url]]`                   | TEXT     | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `[[custom.growsurf_participant_id]]`              | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `[[custom.growsurf_referral_status]]`             | TEXT     | The referral status of the participant\*                                                                                                                                                                  |                                                            |
| **GrowSurf Participant First Name**      | `[[custom.growsurf_participant_first_name]]`      | TEXT     | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `[[custom.growsurf_participant_last_name]]`       | TEXT     | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `[[custom.growsurf_referrer_first_name]]`         | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `[[custom.growsurf_referrer_last_name]]`          | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `[[custom.growsurf_referrer_email]]`              | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `[[custom.growsurf_total_referral_count]]`        | NUMBER   | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `[[custom.growsurf_monthly_referral_count]]`      | NUMBER   | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `[[custom.growsurf_prev_monthly_referral_count]]` | NUMBER   | The participant's previous month referral count                                                                                                                                                           | 200                                                        |
| **GrowSurf Next Milestone**              | `[[custom.growsurf_next_milestone]]`              | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `[[custom.growsurf_next_monthly_milestone]]`      | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `[[custom.growsurf_total_invite_count]]`          | NUMBER   | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `[[custom.growsurf_total_impression_count]]`      | NUMBER   | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these contact fields in your Constant Contact email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `[[custom.growsurf_share_url]]` in your emails to provoke your contacts to make referrals!

[​​For more information about Constant Contact Merge Tags click here](https://knowledgebase.constantcontact.com/articles/KnowledgeBase/pro-39884-Merge-Tag-Overview-All-Tags-How-To-Use-Them?lang=en_US).

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Constant Contact, or if they are being added but their unique referral link isn't being synced to Constant Contact:**
  * Activity logs will denote if a participant was added to Constant Contact or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).

[<br>](https://docs.growsurf.com/additional-integrations/mailchimp)


# Tutorials

We'll walk you through adding personalized referral program messaging to your Constant Contact emails.

When you connect your GrowSurf campaign to Constant Contact, you can easily embed a referral program into your Constant Contact emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="[[custom.growsurf_share_url]]" style="color: #1673df; text-decoration: none;">[[custom.growsurf_share_url]]</a>
      </p>
      <div> 
        <a href="mailto:?body=[[custom.growsurf_share_url]]%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
        <a href="https://www.facebook.com/sharer/sharer.php?u=[[custom.growsurf_share_url]]" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
        <a href="https://twitter.com/intent/tweet?url=[[custom.growsurf_share_url]]&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11, replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `[[custom.growsurf_share_url]]%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `[[custom.growsurf_share_url]]` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
      <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
       <h1 style="margin: 5px;">Give $100, Get $100</h1>
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="[[custom.growsurf_share_url]]" style="color: #4f46e5; text-decoration: none;">[[custom.growsurf_share_url]]</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
       <div style="padding: 20px;"> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
       <div>
       <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="[GrowSurfShareURL]" style="color: #ffffff;">[GrowSurfShareURL]</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url=[[custom.growsurf_share_url]]&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u=[[custom.growsurf_share_url]]" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body=[[custom.growsurf_share_url]]%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url=[[custom.growsurf_share_url]]" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text=[[custom.growsurf_share_url]]" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `[[custom.growsurf_share_url]]%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `[[custom.growsurf_share_url]]` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="[[custom.growsurf_share_url]]" style="color: #8E4CED;">[[custom.growsurf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have [[grsf_total_referral_count]] referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="color: #8E4CED;">Check your status here</a>. [[custom.growsurf_next_milestone]]
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `[[custom.growsurf_next_milestone]]` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  [[custom.growsurf_total_referral_count]] referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="[[custom.growsurf_share_url]]" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">[[custom.growsurf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>[[custom.growsurf_next_milestone]]</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `[[custom.growsurf_total_referral_count]]`. In this example, you would display any one of these five images at a given time:\*
   1. If `[[custom.growsurf_total_referral_count]]` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `[[custom.growsurf_total_referral_count]]` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `[[custom.growsurf_total_referral_count]]` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `[[custom.growsurf_total_referral_count]]` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `[[custom.growsurf_total_referral_count]]` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `[[custom.growsurf_next_milestone]]` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

*\*NOTE: It is not possible to display different reward images in Constant Contact in a single email. You will have to create multiple emails with each having a different image URL based on`[[custom.growsurf_total_referral_count]]`.*

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="[[custom.growsurf_share_url]]" style="color: #8E4CED;">[[custom.growsurf_share_url]]</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="[[custom.growsurf_share_url]]" style="color: #F46A54;">[[custom.growsurf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAILADDRESS]]&grsf_first_name=[[FIRSTNAME]]&grsf_last_name=[[LASTNAME]]" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image in your email.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Constant Contact email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="[[custom.growsurf_share_url]]" style="color: #F46A54;">[[custom.growsurf_share_url]]</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# ConvertKit

Update ConvertKit subscribers with their unique share link and referrer information.

## Sync with ConvertKit <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the ConvertKit integration card and enter your ConvertKit API secret ([click here to get your ConvertKit API secret](https://app.convertkit.com/account/edit)).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to ConvertKit only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to ConvertKit.
{% endhint %}

![](/files/-MSTk_iXRph36DWsbcRG)

**Step 2:** Once connected, choose the ConvertKit tag that you want to automatically sync to. GrowSurf will add/update your ConvertKit subscribers every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

![](/files/-MSTsYwC1RIYk7QwZzxZ)

## Examples

[View our ConvertKit tutorials](https://docs.growsurf.com/additional-integrations/convertkit/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Subscriber Fields** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new Subscriber fields for your ConvertKit Subscribers.

| **Field Name**                       | **Field Shortcode**                                 | **Type** | **Description**                                                                                                                                                                                        | **Example**                                                |
| ------------------------------------ | --------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| **GRSF Share URL**                   | `{{ subscriber.grsf_share_url }}`                   | TEXT     | The participant's unique referral link                                                                                                                                                                 | <https://growsurf.com?grsf=absc123>                        |
| **GRSF Participant ID**              | `{{ subscriber.grsf_participant_id }}`              | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                   | abc123                                                     |
| **GRSF Referral Status**             | `{{ subscriber.grsf_referral_status }}`             | TEXT     | The referral status of the participant\*                                                                                                                                                               | CREDIT\_PENDING                                            |
| **GRSF Participant First Name**      | `{{ subscriber.grsf_participant_first_name }}`      | TEXT     | The participant's first name                                                                                                                                                                           | Bob                                                        |
| **GRSF Participant Last Name**       | `{{ subscriber.grsf_participant_last_name }}`       | TEXT     | The participant's last name                                                                                                                                                                            | Loblaw                                                     |
| **GRSF Referrer First Name**         | `{{ subscriber.grsf_referrer_first_name }}`         | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                           | Gavin                                                      |
| **GRSF Referrer Last Name**          | `{{ subscriber.grsf_referrer_last_name }}`          | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                            | Belson                                                     |
| **GRSF Referrer Email**              | `{{ subscriber.grsf_referrer_email }}`              | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                        | <gavin.belson@hoolie.io>                                   |
| **GRSF Total Referral Count**        | `{{ subscriber.grsf_total_referral_count }}`        | NUMBER   | The participant's all-time referral count                                                                                                                                                              | 0                                                          |
| **GRSF Monthly Referral Count**      | `{{ subscriber.grsf_monthly_referral_count }}`      | NUMBER   | The participant's current month referral count                                                                                                                                                         | 19                                                         |
| **GRSF Prev Monthly Referral Count** | `{{ subscriber.grsf_prev_monthly_referral_count }}` | NUMBER   | The participant's previous month referral count                                                                                                                                                        | 200                                                        |
| **GRSF Next Milestone**              | `{{ subscriber.grsf_next_milestone }}`              | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards.[ See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GRSF Next Monthly Milestone**      | `{{ subscriber.grsf_next_monthly_milestone }}`      | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GRSF Total Invite Count**          | `{{ subscriber.grsf_total_invite_count }}`          | NUMBER   | The participant's all-time invite count                                                                                                                                                                | 112                                                        |
| **GRSF Total Impression Count**      | `{{ subscriber.grsf_total_impression_count }}`      | NUMBER   | The participant's all-time impression count                                                                                                                                                            | 150                                                        |

\**GRSF Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these subscriber fields in your ConvertKit email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `{{ subscriber.grsf_share_url }}` in your emails to provoke your subscribers to make referrals!

[​Learn more about personalizing ConvertKit emails here](https://help.convertkit.com/en/articles/2502501-conditional-email-content-based-on-tags).​

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to ConvertKit, or if they are being added but their unique referral link isn't being synced to ConvertKit:**
  * Activity logs will denote if a participant was added to ConvertKit or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).

[<br>](https://docs.growsurf.com/additional-integrations/mailchimp)


# Tutorials

We'll walk you through adding personalized referral program messaging to your ConvertKit emails.

When you connect your GrowSurf campaign to ConvertKit, you can easily embed a referral program into your ConvertKit emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{{ subscriber.grsf_share_url }}" style="color: #1673df; text-decoration: none;">{{ subscriber.grsf_share_url }}</a>
      </p>
      <div> 
        <a href="mailto:?body={{ subscriber.grsf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
        <a href="https://www.facebook.com/sharer/sharer.php?u={{ subscriber.grsf_share_url }}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
        <a href="https://twitter.com/intent/tweet?url={{ subscriber.grsf_share_url }}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11, replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{{ subscriber.grsf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ subscriber.grsf_share_url }}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
     <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39 and 39, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
      <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="{{ subscriber.grsf_share_url }}" style="color: #4f46e5; text-decoration: none;">{{ subscriber.grsf_share_url }}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{ subscriber.grsf_share_url }}" style="color: #ffffff;">{{ subscriber.grsf_share_url }}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{ subscriber.grsf_share_url }}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ subscriber.grsf_share_url }}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{ subscriber.grsf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ subscriber.grsf_share_url }}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{ subscriber.grsf_share_url }}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{ subscriber.grsf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ subscriber.grsf_share_url }}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
          <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
     <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.grsf_participant_first_name }}&grsf_last_name=
" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{ subscriber.grsf_share_url }}" style="color: #8E4CED;">{{ subscriber.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{ subscriber.grsf_total_referral_count }} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="color: #8E4CED;">Check your status here</a>. {{ subscriber.grsf_next_milestone }}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{ subscriber.grsf_next_milestone }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{ subscriber.grsf_total_referral_count }} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{ subscriber.grsf_share_url }}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{ subscriber.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{ subscriber.grsf_next_milestone }}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{ subscriber.grsf_total_referral_count }}`. In this example, you would display any one of these five images at a given time:
   1. If `{{ subscriber.grsf_total_referral_count }}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{ subscriber.grsf_total_referral_count }}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{ subscriber.grsf_total_referral_count }}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{ subscriber.grsf_total_referral_count }}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{ subscriber.grsf_total_referral_count }}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{ subscriber.grsf_next_milestone }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{ subscriber.grsf_share_url }}" style="color: #8E4CED;">{{ subscriber.grsf_share_url }}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=
" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{ subscriber.grsf_share_url }}" style="color: #F46A54;">{{ subscriber.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email_address }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name=" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your ConvertKit email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{ subscriber.grsf_share_url }}" style="color: #F46A54;">{{ subscriber.grsf_share_url }}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Customer.io

Add/update Customer.io people with their unique share link and referrer information.

## Sync with Customer.io <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Customer.io integration card and enter your Customer.io Site ID and Tracking API Key ([click here to get your Customer.io Site ID and Tracking API key](https://fly.customer.io/settings/api_credentials)).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Customer.io only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Customer.io.
{% endhint %}

![](/files/-MbwOQZUA28_TuIUKZhf)

**Step 2:** Once connected, GrowSurf will add/update your Customer.io people every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

![](/files/-Mbwgkt3cWn-lKr9jMD9)

## Examples

[View our Customer.io tutorials](https://docs.growsurf.com/additional-integrations/customerio/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Attributes** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new attributes for your Customer.io people.

| **Attribute Name**                     | **Attribute Tag**                               | **Type** | **Description**                                                                                                                                                                                        | **Example**                                                |
| -------------------------------------- | ----------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| **`grsf_share_url`**                   | `{{customer.grsf_share_url}}`                   | TEXT     | The participant's unique referral link                                                                                                                                                                 | <https://growsurf.com?grsf=absc123>                        |
| **`grsf_participant_id`**              | `{{customer.grsf_participant_id}}`              | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                   | abc123                                                     |
| **`grsf_referral_status`**             | `{{customer.grsf_participant_id}}`              | TEXT     | The referral status of the participant\*                                                                                                                                                               |                                                            |
| **`grsf_participant_first_name`**      | `{{customer.grsf_participant_first_name}}`      | TEXT     | The participant's first name                                                                                                                                                                           | Bob                                                        |
| **`grsf_participant_last_name`**       | `{{customer.grsf_participant_last_name}}`       | TEXT     | The participant's last name                                                                                                                                                                            | Loblaw                                                     |
| **`grsf_referrer_first_name`**         | `{{customer.grsf_referrer_first_name}}`         | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                           | Gavin                                                      |
| **`grsf_referrer_last_name`**          | `{{customer.grsf_referrer_last_name}}`          | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                            | Belson                                                     |
| **`grsf_referrer_email`**              | `{{customer.grsf_referrer_email}}`              | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                        | <gavin.belson@hoolie.io>                                   |
| **`grsf_total_referral_count`**        | `{{customer.grsf_total_referral_count}}`        | NUMBER   | The participant's all-time referral count                                                                                                                                                              | 0                                                          |
| **`grsf_monthly_referral_count`**      | `{{customer.grsf_monthly_referral_count}}`      | NUMBER   | The participant's current month referral count                                                                                                                                                         | 19                                                         |
| **`grsf_prev_monthly_referral_count`** | `{{cusotmer.grsf_prev_monthly_referral_count}}` | NUMBER   | The participant's previous month referral count                                                                                                                                                        | 200                                                        |
| **`grsf_next_milestone`**              | `{{customer.grsf_next_milestone}}`              | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards.[ See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **`grsf_next_monthly_milestone`**      | `{{customer.grsf_next_monthly_milestone}}`      | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **`grsf_total_invite_count`**          | `{{customer.grsf_total_invite_count}}`          | NUMBER   | The participant's all-time invite count                                                                                                                                                                | 112                                                        |
| **`grsf_total_impression_count`**      | `{{customer.grsf_total_impression_count}}`      | NUMBER   | The participant's all-time impression count                                                                                                                                                            | 150                                                        |

\*grsf\_r*eferral\_status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these attributes in your Customer.io email templates. Whether you launch a new marketing campaign or have an automated Customer.io campaign going on, make sure to always include `{{customer.grsf_share_url}}` in your emails to provoke your people to make referrals!

[​Learn more about Customer.io emails here](https://customer.io/docs/2-email-basics/).​

## **Backfilling Data** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

If you want to backfill your Customer.io people with GrowSurf participant attributes, the way to accomplish this is by following these steps:

1. Connect your GrowSurf campaign to the Customer.io integration
2. In your Customer.io portal, export your Customer.io people as a CSV file. [Follow the instructions here](https://customer.io/docs/exporting-users/#exporting-everyone).
3. Import the CSV file into your GrowSurf dashboard. Once the import has completed, your Customer.io people will have their GrowSurf participant attributes automatically synced.

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Customer.io, or if they are being added but their unique referral link isn't being synced to Customer.io:**
  * Activity logs will denote if a participant was added to Customer.io or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your Customer.io emails.

When you connect your GrowSurf campaign to Customer.io, you can easily embed a referral program into your Customer.io emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Customer.io email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{{customer.grsf_share_url}}" style="color: #1673df; text-decoration: none;">{{customer.grsf_share_url}}</a>
      </p>
      <div> 
        <a href="mailto:?body={{customer.grsf_share_url}}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
        <a href="https://www.facebook.com/sharer/sharer.php?u={{customer.grsf_share_url}}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
        <a href="https://twitter.com/intent/tweet?url={{customer.grsf_share_url}}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11, replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color
4. At line 15, replace the text `{{customer.grsf_share_url}}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{customer.grsf_share_url}}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$10%20:)` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Customer.io email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Customer.io email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39 and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Customer.io email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Customer.io email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
         <a href="{{customer.grsf_share_url}}" style="color: #4f46e5; text-decoration: none;">{{customer.grsf_share_url}}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
        <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Customer.io email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;">
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{customer.grsf_share_url}}" style="color: #ffffff;">{{customer.grsf_share_url}}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{customer.grsf_share_url}}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{customer.grsf_share_url}}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{customer.grsf_share_url}}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{customer.grsf_share_url}}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{customer.grsf_share_url}}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{customer.grsf_share_url}}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{customer.grsf_share_url}}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Customer.io email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Customer.io email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
   </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Customer.io email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{customer.grsf_share_url}}" style="color: #8E4CED;">{{customer.grsf_share_url}}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{customer.grsf_total_referral_count}} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="color: #8E4CED;">Check your status here</a>. {{customer.grsf_next_milestone}}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{customer.grsf_next_milestone}}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Customer.io email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{customer.grsf_total_referral_count}} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{customer.grsf_share_url}}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{customer.grsf_share_url}}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{customer.grsf_next_milestone}}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{customer.grsf_total_referral_count}}`. In this example, you would display any one of these five images at a given time:
   1. If `{{customer.grsf_total_referral_count}}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{customer.grsf_total_referral_count}}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{customer.grsf_total_referral_count}}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{customer.grsf_total_referral_count}}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{customer.grsf_total_referral_count}}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{customer.grsf_next_milestone}}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Customer.io email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{customer.grsf_share_url}}" style="color: #8E4CED;">{{customer.grsf_share_url}}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Customer.io email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{customer.grsf_share_url}}" style="color: #F46A54;">{{customer.grsf_share_url}}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{customer.email}}&grsf_first_name={{customer.first_name}}&grsf_last_name={{customer.last_name}}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurfReferral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Customer.io email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{customer.grsf_share_url}}" style="color: #F46A54;">{{customer.grsf_share_url}}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Drip

Update/add Drip people with their unique share link and referrer information.

## Sync with Drip <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to Drip* button.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Drip only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Drip.
{% endhint %}

![](/files/-MTbjhz0AdA6kDlu6jzv)

**Step 2:** Sign in to Drip

![](/files/-MTbp8Xze-FBP6wMKyxN)

**Step 3:** Once connected, choose the Drip account and Drip tag that you want to automatically sync to. GrowSurf will add/update your Drip people every time a new participant is added or referred to your referral campaign.

## Examples

[View our Drip tutorials](https://docs.growsurf.com/additional-integrations/drip/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Fields**

GrowSurf will automatically create these new custom fields for your Drip people.

| **Field Name**                       | **Identifier**                                      | **Value** | **Description**                                                                                                                                                                                        | **Example**                                                |
| ------------------------------------ | --------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| **GRSF Share URL**                   | `{{ subscriber.grsf_share_url }}`                   | TEXT      | The participant's unique referral link                                                                                                                                                                 | <https://growsurf.com?grsf=absc123>                        |
| **GRSF Participant ID**              | `{{ subscriber.grsf_participant_id }}`              | TEXT      | The participant's unique GrowSurf ID                                                                                                                                                                   | abc123                                                     |
| **GRSF Referral Status**             | `{{ subscriber.grsf_participant_id }}`              | TEXT      | The referral status of the participant\*                                                                                                                                                               | CREDIT\_PENDING                                            |
| **GRSF Participant First Name**      | `{{ subscriber.grsf_participant_first_name }}`      | TEXT      | The participant's first name                                                                                                                                                                           | Bob                                                        |
| **GRSF Participant Last Name**       | `{{ subscriber.grsf_participant_last_name }}`       | TEXT      | The participant's last name                                                                                                                                                                            | Loblaw                                                     |
| **GRSF Referrer First Name**         | `{{ subscriber.grsf_referrer_first_name }}`         | TEXT      | The first name of the participant's referrer (if applicable)                                                                                                                                           | Gavin                                                      |
| **GRSF Referrer Last Name**          | `{{ subscriber.grsf_referrer_last_name }}`          | TEXT      | The last name of the participant's referrer (if applicable)                                                                                                                                            | Belson                                                     |
| **GRSF Referrer Email**              | `{{ subscriber.grsf_referrer_email }}`              | TEXT      | The email address of the participant's referrer (if applicable)                                                                                                                                        | <gavin.belson@hoolie.io>                                   |
| **GRSF Total Referral Count**        | `{{ subscriber.grsf_total_referral_count }}`        | NUMBER    | The participant's all-time referral count                                                                                                                                                              | 0                                                          |
| **GRSF Monthly Referral Count**      | `{{ subscriber.grsf_monthly_referral_count }}`      | NUMBER    | The participant's current month referral count                                                                                                                                                         | 19                                                         |
| **GRSF Prev Monthly Referral Count** | `{{ subscriber.grsf_prev_monthly_referral_count }}` | NUMBER    | The participant's previous month referral count                                                                                                                                                        | 200                                                        |
| **GRSF Next Milestone**              | `{{ subscriber.grsf_next_milestone }}`              | TEXT      | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GRSF Next Monthly Milestone**      | `{{ subscriber.grsf_next_monthly_milestone }}`      | TEXT      | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GRSF Total Invite Count**          | `{{ subscriber.grsf_total_invite_count }}`          | NUMBER    | The participant's all-time invite count                                                                                                                                                                | 112                                                        |
| **GRSF Total Impression Count**      | `{{ subscriber.grsf_total_impression_count }}`      | NUMBER    | The participant's all-time impression count                                                                                                                                                            | 150                                                        |

\**GRSF Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these custom fields in your Drip email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `{{ subscriber.grsf_share_url }}` in your emails to provoke your people to make referrals!

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Drip, or if they are being added but their unique referral link isn't being synced to Drip:**
  * Activity logs will denote if a participant was added to Drip or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your Drip emails.

When you connect your GrowSurf campaign to Drip, you can easily embed a referral program into your Drip emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/pZSyIUaFVg2Yv8pcZNz0)

### Copy/paste this HTML code into your Drip email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{{ subscriber.grsf_share_url }}" style="color: #1673df; text-decoration: none;">{{ subscriber.grsf_share_url }}</a>
      </p>
      <div> 
         <a href="mailto:?body={{ subscriber.grsf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u={{ subscriber.grsf_share_url }}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url={{ subscriber.grsf_share_url }}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
     </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{{ subscriber.grsf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ subscriber.grsf_share_url }}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Drip email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Drip email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Drip email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
      <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Drip email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
         <a href="{{ subscriber.grsf_share_url }}" style="color: #4f46e5; text-decoration: none;">{{ subscriber.grsf_share_url }}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Drip email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
       <div style="padding: 20px;">
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
       <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{ subscriber.grsf_share_url }}" style="color: #ffffff;">{{ subscriber.grsf_share_url }}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{ subscriber.grsf_share_url }}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ subscriber.grsf_share_url }}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{ subscriber.grsf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ subscriber.grsf_share_url }}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{ subscriber.grsf_share_url }}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{ subscriber.grsf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ subscriber.grsf_share_url }}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Drip email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Drip email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
     <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
     <tr>
       <td style="padding: 20px; background: #ffffff;">
         <table border="0" cellpadding="0" cellspacing="0">
           <tr>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">Spread the word</p>
               <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
             </td>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">You'll get $10</p>
               <p>Receive $10 for each friend your refer that makes their first deposit</p>
             </td>
             <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
               <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
               <p style="font-weight: 700;">Your friends get $10</p>
               <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
             </td>
           </tr>
         </table>
       </td>
     </tr>
     <tr>
       <td style="text-align: center;"> 
         <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
      </td>
     </tr>
   </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Drip email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{ subscriber.grsf_share_url }}" style="color: #8E4CED;">{{ subscriber.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{ subscriber.grsf_total_referral_count }} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="color: #8E4CED;">Check your status here</a>. {{ subscriber.grsf_next_milestone }}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{ subscriber.grsf_next_milestone }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Drip email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{ subscriber.grsf_total_referral_count }} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{ subscriber.grsf_share_url }}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{ subscriber.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{ subscriber.grsf_next_milestone }}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{ subscriber.grsf_total_referral_count }}`. In this example, you would display any one of these five images at a given time:
   1. If `{{ subscriber.grsf_total_referral_count }}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{ subscriber.grsf_total_referral_count }}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{ subscriber.grsf_total_referral_count }}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{ subscriber.grsf_total_referral_count }}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{ subscriber.grsf_total_referral_count }}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{ subscriber.grsf_next_milestone }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Drip email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{ subscriber.grsf_share_url }}" style="color: #8E4CED;">{{ subscriber.grsf_share_url }}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Drip email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{ subscriber.grsf_share_url }}" style="color: #F46A54;">{{ subscriber.grsf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ subscriber.email }}&grsf_first_name={{ subscriber.first_name }}&grsf_last_name={{ subscriber.last_name }}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Drip email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{ subscriber.grsf_share_url }}" style="color: #F46A54;">{{ subscriber.grsf_share_url }}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# EmailOctopus

Update EmailOctopus contacts with their unique share link and referrer information.

## Sync with your EmailOctopus List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the EmailOctopus integration card and enter your EmailOctopus API key ([click here to get your EmailOctopus private API key](https://emailoctopus.com/api-documentation)).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to EmailOctopus only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to EmailOctopus.
{% endhint %}

![](/files/-MTw_tn-TiFypWe4d1DM)

**Step 2:** Once connected, choose the EmailOctopus list that you want to automatically sync to. GrowSurf will add/update your EmailOctopus contacts every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

![](/files/-MTwbUY-VgbWsOi_53BL)

## Examples

[View our EmailOctopus tutorials](https://docs.growsurf.com/additional-integrations/emailoctopus/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Fields** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these custom fields for your EmailOctopus contacts.

| Field label                              | **Tag**                        | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | ------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `GrowSurfShareURL`             | TEXT     | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `GrowSurfParticipantID`        | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `GrowSurfReferralStatus`       | TEXT     | The referral status of the participant\*                                                                                                                                                                  | CREDIT\_PENDING                                            |
| **GrowSurf Participant First Name**      | `GrowSurfParticipantFirstName` | TEXT     | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `GrowSurfParticipantLastName`  | TEXT     | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `GrowSurfReferrerFirstName`    | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `GrowSurfReferrerLastName`     | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `GrowSurfReferrerEmail`        | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `GrowSurfTotalReferralCount`   | NUMBER   | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `GrowSurfMonthlyReferralCount` | NUMBER   | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `PrevMonthlyReferralCount`     | NUMBER   | The participant's previous month referral count                                                                                                                                                           | 20                                                         |
| **GrowSurf Next Milestone**              | `GrowSurfNextMilestone`        | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `GrowSurfNextMonthlyMilestone` | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `GrowSurfTotalInviteCount`     | NUMBER   | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `GrowSurfTotalImpressionCount` | NUMBER   | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these new tags in your EmailOctopus email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include`GrowSurfShareURL` in your emails to provoke your contacts to make referrals!

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to EmailOctopus, or if they are being added but their unique referral link isn't being synced to EmailOctopus:**
  * Activity logs will denote if a participant was added to EmailOctopus or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your EmailOctopus emails.

When you connect your GrowSurf campaign to EmailOctopus, you can easily embed a referral program into your EmailOctopus emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
         <a href="{{GrowSurfShareURL}}" style="color: #1673df; text-decoration: none;">{{GrowSurfShareURL}}</a>
      </p>
      <div> 
         <a href="mailto:?body={{GrowSurfShareURL}}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u={{GrowSurfShareURL}}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url={{GrowSurfShareURL}}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{{GrowSurfShareURL}}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{GrowSurfShareURL}}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="{{GrowSurfShareURL}}" style="color: #4f46e5; text-decoration: none;">{{GrowSurfShareURL}}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
    <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;">
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{GrowSurfShareURL}}" style="color: #ffffff;">{{GrowSurfShareURL}}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{GrowSurfShareURL}}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{GrowSurfShareURL}}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{GrowSurfShareURL}}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{GrowSurfShareURL}}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{GrowSurfShareURL}}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text {`{GrowSurfShareURL}}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{GrowSurfShareURL}}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 1, replace `#ffffff` with your own brand color.
2. At line 4, replace all instances of `PrismJar` with your own brand name.
3. At line 8, replace `#1673df` with your own brand color.
4. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
5. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
   </tr>
  </td>
 </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                   Get your swag 
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{GrowSurfShareURL}}" style="color: #8E4CED;">{{GrowSurfShareURL}}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{GrowSurfTotalReferralCount}} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="color: #8E4CED;">Check your status here</a>. {{GrowSurfNextMilestone}}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{GrowSurfNextMilestone}}`is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{GrowSurfTotalReferralCount}} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                   Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{GrowSurfShareURL}}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{GrowSurfShareURL}}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{GrowSurfNextMilestone}}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{GrowSurfTotalReferralCount}}`. In this example, you would display any one of these five images at a given time:
   1. If `{{GrowSurfTotalReferralCount}}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{GrowSurfTotalReferralCount}}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{GrowSurfTotalReferralCount}}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{GrowSurfTotalReferralCount}}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{GrowSurfTotalReferralCount}}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{GrowSurfNextMilestone}}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{GrowSurfShareURL}}" style="color: #8E4CED;">{{GrowSurfShareURL}}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{GrowSurfShareURL}}" style="color: #F46A54;">{{GrowSurfShareURL}}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{EmailAddress}}&grsf_first_name={{FirstName}}&grsf_last_name={{LastName}}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurfReferral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your EmailOctopus email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{GrowSurfShareURL}}" style="color: #F46A54;">{{GrowSurfShareURL}}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Fullstory

Track and analyze referral program data alongside product analytics in Fullstory.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

After connecting, the Fullstory integration transmits data to your Fullstory account, enabling analysis and reporting on your referral program.

For referrers, when they are added to your campaign (e.g., they get a referral link generated) or if they click a social share button (like Facebook or LinkedIn), GrowSurf sends a Fullstory event. For referred friends, if they sign up using your Share URL, GrowSurf also sends an event.

{% hint style="success" %}
Under the hood, GrowSurf will load the Fullstory JavaScript library, identify participants (both referrers and referred friends) by their email address, and track events. Rest assured, if Fullstory is already installed, GrowSurf ensures the library is not loaded twice and prevents duplicate identity calls.
{% endhint %}

## Tracked Events

The following events will be emitted with the `growsurf_` prefix.

| Event                       | Description                            | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `growsurf_referral`         | \[Referred friend] New referral signup | <p>Records when a referred visitor signs up through a referral link.<br><br>This includes:</p><ul><li>Those who submit the form on your website that has referral tracking enabled (via the campaign editor)</li><li>Adding a referred participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul>                                                                                                                                                                                                                                                        |
| `growsurf_referral_trigger` | \[Referred friend] Referral triggered  | Records when a referred participant completes the desired qualifying action, which triggers a referral. Only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral).                                                                                                                                                                                                                                                                                                                                                                                                    |
| `growsurf_signup`           | \[Referrer] New referrer signup        | <p>Records when someone generates a referral link and joins the campaign as a participant.</p><p>This includes:</p><ul><li>Direct signups (someone entering in their email address on the GrowSurf form)</li><li>Passing in an email address via URL parameter <code>?grsf\_email</code></li><li>Passing in an email address via <code>data-grsf-email</code> attribute on an <a href="https://docs.growsurf.com/developer-tools/embeddable-elements">Embeddable Element</a></li><li>Adding a participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul> |
| `growsurf_share`            | \[Referred] Social media share         | Records when a referrer shares their link by clicking 'Copy Link' or clicking a social media button                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `growsurf_invite`           | \[Referrer] Email invite(s) sent       | Records when a referrer sends invitation(s) via email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Example Events

Events correspond with the events listed in the [`growsurf.subscribe()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) method. To see examples of the raw `JSON` data, please see the [*Example Response*](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) section.

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Fullstory integration card and enter your [Fullstory Org ID](https://help.fullstory.com/hc/en-us/articles/360047075853-How-do-I-find-my-Fullstory-Org-Id).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Fullstory installed on your website, you do not need to enter the Fullstory Org ID. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Fullstory installed.
{% endhint %}

<figure><img src="/files/yhozNpTqENw2ffTFqkeE" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Within your Fullstory account, make sure to whitelist the URLs where these events occur. These are primarily two locations: your referral portal (which might be part of your user portal or web app or the [GrowSurf-hosted referral portal](https://support.growsurf.com/article/196-where-can-i-find-my-campaigns-dedicated-landing-page)) and the referred friend's landing page (the Share URL you enter in the *Campaign Editor > 5. Installation* step).
{% endhint %}

Once GrowSurf events get emitted, you will see them show up in *Fullstory > Metrics.*

{% hint style="info" %}
**Note:** Please allow up to 15 minutes of processing time for events to appear (in some cases where Fullstory is backed up, it can take longer).
{% endhint %}

***

## How to View Events In Fullstory

Once events are emitted to Fullstory, you'll need to follow these instructions below to set up a metric page for each event.

**Step 1**: From FullStory, click the *Create* button on the left-side nav menu.

<figure><img src="/files/3hIYsBv7ALyDFBeJjoyg" alt=""><figcaption></figcaption></figure>

**Step 2:** For the title, enter "GrowSurf Share Metrics".

**Step 3**: Scroll to the *Metric Filters* section and select the following for the *Event* dropdown:

* In the first dropdown, select "Custom Event"
* In the second dropdown, choose `growsurf_share` (if you don't see this option, you'll want to make sure there is at least one `growsurf_share` event that exists as Fullstory will auto-generate this option).

Your screen should now look like this:

<figure><img src="/files/7JB9UYAmLGiK3NAayQd6" alt=""><figcaption></figcaption></figure>

**Step 4:** In the top-right, click the *Save* button. You should now be able to see the metrics dashboard like the image below:

<figure><img src="/files/pc9z6zQKRki7OXoSGdEn" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Tip:** If you scroll to the *Session Playlist* section of the metric page, you'll be able to see session replays of users who performed actions.
{% endhint %}

**Step 5:** For each GrowSurf tracking event, you'll want to repeat steps 1 to 4 to add each metric.

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If you are seeing a wrongly identified user:

There are 5 different ways that GrowSurf participants can be added to your campaign. Please make sure that the GrowSurf participant email address that you are passing in matches the one you were expecting for the Fullstory user:

* If you pass in a `data-grsf-email` attribute to a [GrowSurf embeddable element](https://docs.growsurf.com/developer-tools/embeddable-elements)
* If you pass in an email address via URL parameter `?grsf_email`
* If you are using [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant)
* If you enter an email address via the GrowSurf form
* If you are a referred friend and you submit the form that has referral tracking configured on it from the *Campaign Editor > 5. Installation* step

#### If you are not receiving events, but were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Fullstory.
* Make sure to whitelist the URL where events are being tracked (e.g, if your referrer clicks the Facebook share button from *<https://app.yoursite.com/refer>*, you'll want to make sure you whitelist that root domain. If a referred friend signs up on your Share URL, make sure to whitelist the Share URL as well).
* If you just submitted an event, make sure that you've allowed up to 15 minutes for Fullstory to process the event.

#### If you are receiving events, but were NOT expecting them:

* To ensure no non-GrowSurf-related events are sent to your Fullstory account, disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you're receiving events without a GrowSurf-related suffix (e.g., `growsurf_`), it indicates that GrowSurf may not be emitting these events. Please check other parts of your code to find where these events might be occurring.


# GetResponse

Update GetResponse subscribers with their unique share link and referrer information.

## Sync with your GetResponse List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to GetResponse* button.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to GetResponse only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to GetResponse.
{% endhint %}

![](/files/-MNBXS02TprgNOZ-3MPe)

**Step 2:** Log in to GetResponse and authorize GrowSurf

![](/files/-MNBXfaIp49tIFPG0TtT)

**Step 3:** Once connected, choose the GetResponse list that you want to automatically sync to. GrowSurf will add/update your GetResponse Contacts every time a new participant is added or referred to your referral campaign.

![](/files/-MNBbnUmQzXii3Du4POi)

## Examples

[View our GetResponse tutorials](https://docs.growsurf.com/additional-integrations/getresponse/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Contact Fields** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new contact fields for your GetResponse Contacts.

| **Field Code**                       | **Type**                               | **Text** | **Description**                                                                                                                                                                                        | **Example**                                                |
| ------------------------------------ | -------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| **GRSF Share URL**                   | `[[grsf_share_url]]`                   | TEXT     | The participant's unique referral link                                                                                                                                                                 | <https://growsurf.com?grsf=absc123>                        |
| **GRSF Participant ID**              | `[[grsf_participant_id]]`              | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                   | abc123                                                     |
| **GRSF Referral Status**             | `[[grsf_participant_id]]`              | TEXT     | The referral status of the participant\*                                                                                                                                                               | CREDIT\_PENDING                                            |
| **GRSF Participant First Name**      | `[[grsf_participant_first_name]]`      | TEXT     | The participant's first name                                                                                                                                                                           | Bob                                                        |
| **GRSF Participant Last Name**       | `[[grsf_participant_last_name]]`       | TEXT     | The participant's last name                                                                                                                                                                            | Loblaw                                                     |
| **GRSF Referrer First Name**         | `[[grsf_referrer_first_name]]`         | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                           | Gavin                                                      |
| **GRSF Referrer Last Name**          | `[[grsf_referrer_last_name]]`          | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                            | Belson                                                     |
| **GRSF Referrer Email**              | `[[grsf_referrer_email]]`              | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                        | <gavin.belson@hoolie.io>                                   |
| **GRSF Total Referral Count**        | `[[grsf_total_referral_count]]`        | NUMBER   | The participant's all-time referral count                                                                                                                                                              | 0                                                          |
| **GRSF Monthly Referral Count**      | `[[grsf_monthly_referral_count]]`      | NUMBER   | The participant's current month referral count                                                                                                                                                         | 19                                                         |
| **GRSF Prev Monthly Referral Count** | `[[grsf_prev_monthly_referral_count]]` | NUMBER   | The participant's previous month referral count                                                                                                                                                        | 200                                                        |
| **GRSF Next Milestone**              | `[[grsf_next_milestone]]`              | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GRSF Next Monthly Milestone**      | `[[grsf_next_monthly_milestone]]`      | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GRSF Total Invite Count**          | `[[grsf_total_invite_count]]`          | NUMBER   | The participant's all-time invite count                                                                                                                                                                | 112                                                        |
| **GRSF Total Impression Count**      | `[[grsf_total_impression_count]]`      | NUMBER   | The participant's all-time impression count                                                                                                                                                            | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these contact fields in your GetResponse email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `[[grsf_share_url]]` in your emails to provoke your subscribers to make referrals!

​[Learn more about GetResponse merge fields here.](http://help.mailerlite.com/article/show/108704-how-to-create-and-use-custom-fields)​

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to GetResponse, or if they are being added but their unique referral link isn't being synced to GetResponse:**
  * Activity logs will denote if a participant was added to GetResponse or if they were failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
* **If the new participant is being added to GetResponse, but not all of their custom Contact fields are showing up:**
  * GetResponse does not allow custom Contact fields to be saved as empty values. If there is a custom GrowSurf field(s) missing from your Contact, that means a valid value was never provided when the participant was added/updated in GetResponse.


# Tutorials

We'll walk you through adding personalized referral program messaging to your GetResponse emails.

When you connect your GrowSurf campaign to GetResponse, you can easily embed a referral program into your GetResponse emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your GetResponse email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
         <a href="[[grsf_share_url]]" style="color: #1673df; text-decoration: none;">[[grsf_share_url]]</a>
      </p>
      <div> 
         <a href="mailto:?body=[[grsf_share_url]]%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u=[[grsf_share_url]]" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url=[[grsf_share_url]]&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `[[grsf_share_url]]%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `[[grsf_share_url]]` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your GetResponse email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your GetResponse email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your GetResponse email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your GetResponse email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="[[grsf_share_url]]" style="color: #4f46e5; text-decoration: none;">[[grsf_share_url]]</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your GetResponse email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;">
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="[[grsf_share_url]]" style="color: #ffffff;">[[grsf_share_url]]</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url=[[grsf_share_url]]&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u=[[grsf_share_url]]" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body=[[grsf_share_url]]%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url=[[grsf_share_url]]" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text=[[grsf_share_url]]" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `[[grsf_share_url]]%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `[[grsf_share_url]]` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your GetResponse email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 11, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your GetResponse email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
   </tr>
  </td>
 </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your GetResponse email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="[[grsf_share_url]]" style="color: #8E4CED;">[[grsf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have [[grsf_total_referral_count]] referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="color: #8E4CED;">Check your status here</a>. [[grsf_next_milestone]]
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `[[grsf_next_milestone]]` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your GetResponse email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  [[grsf_total_referral_count]] referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="[[grsf_share_url]]" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">[[grsf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>[[grsf_next_milestone]]</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `[[grsf_total_referral_count]]`. In this example, you would display any one of these five images at a given time:
   1. If `[[grsf_total_referral_count]]` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `[[grsf_total_referral_count]]` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `[[grsf_total_referral_count]]` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `[[grsf_total_referral_count]]` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `[[grsf_total_referral_count]]` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `[[grsf_next_milestone]]` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your GetResponse email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="[[grsf_share_url]]" style="color: #8E4CED;">[[grsf_share_url]]</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your GetResponse email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="[[grsf_share_url]]" style="color: #F46A54;">[[grsf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[email]]&grsf_first_name=[[firstname]]&grsf_last_name=[[lastname]]" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image in your email.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your GetResponse email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="800">
        <tr>
          <td style="padding-left: 87px; padding-top: 150px">
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="45px" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a <br> friend! Copy and share your unique link: <a href="https://husto.com?grsf=abc123" style="color: #F46A54;">https://husto.com?grsf=abc123</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.

## Example 14

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your GetResponse email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="[[grsf_share_url]]" style="color: #F46A54;">[[grsf_share_url]]</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Google Ads

Retarget referred visitors and track referral events in Google Ads to optimize your ad campaigns.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

The Google Ads integration lets you retarget website visitors who arrive through referral links and track their conversions. Once connected, Google Ads will track these referred visitors and conversions when they submit their email addresses on your website.

{% hint style="success" %}
Under the hood, GrowSurf loads the Google Ads library for event tracking. If Google Ads is already installed, GrowSurf intelligently avoids loading it twice.
{% endhint %}

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Google Ads integration card and enter your [Google Ads conversion ID](https://support.google.com/tagmanager/answer/6105160?hl=en\&sjid=10459907078839107427-AP).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Google Ads installed on your website, you do not need to enter in the Google Ads conversion ID. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Google Ads installed.
{% endhint %}

<figure><img src="/files/fYuiI5gcDamRgeapzCKb" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Make sure that your campaign Share URL (found in the *Campaign Editor > 5. Installation* step) is a part of your Google Ads account. Also, if you are tracking conversions when a referred friend submits their email address, make sure the URL that this event happens is also a part of your Google Ads account.
{% endhint %}

**Step 3:** In your Google Ads account, you will need to add the following two conversion actions (You can skip this step if you have both "Track conversion event" checkboxes toggled off). Follow the instructions in [How to Add Conversion Actions In Google Ads](#how-to-add-conversion-actions-in-google-a-ds).

* `growsurf_referral_signup` - This conversion event represents when a referred visitor submits their email address on the form on your website that has referral tracking on it.
* `growsurf_referral_trigger` - This conversion event represents when a participant completes a qualifying action, like making a purchase (Note: this only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral)from the front-end).

***

## How to Add Conversion Actions In Google Ads

<details>

<summary>Open instructions</summary>

You'll need to complete steps 1-10 below for each event `growsurf_referral_signup` and `growsurf_referral_trigger`.

1. Log into your [Google Ads account](https://ads.google.com).
2. Click the top-left "Create" circular button (see image below)

   <figure><img src="/files/dC8jMNM5avAEGJbbXNkO" alt=""><figcaption></figcaption></figure>
3. Choose "Conversion action" in the dropdown.
4. Choose "Website" as the conversion source.
5. Enter your website (where the conversion event will happen).
6. Select "Add a conversion action manually" (see image below).

   <figure><img src="/files/1TY63XNCTTJssfypnDsX" alt=""><figcaption></figcaption></figure>
7. In the "Goal Category" dropdown, choose one of the following:
   1. For `growsurf_referral_signup`, we recommend using "Sign-up" (or choose a different category that best represents a referred visitor signing up).
   2. For `growsurf_referral_trigger`, we recommend using "Purchase" (or choose a different category that best represents when a referred participant completes a qualifying action, which triggers a referral).
8. For the "Value", choose one of the following:
   1. For `growsurf_referral_signup`, enter a value that represents how much a referred visitor signing up is worth.
   2. For `growsurf_referral_trigger`, enter a value that represents how much a referred participant completing a qualifying action is worth.
9. For the "Count", choose "Only one conversion".
10. Click the blue *Done* button at the bottom of the window.

    <figure><img src="/files/CNd49GQOVf7kPg5gS5M6" alt=""><figcaption></figcaption></figure>
11. Make sure that you repeat steps 1-10 above for `growsurf_referral_trigger` as well. Your screen should look like this image:

    <figure><img src="/files/V50fq3k9vc8pFum2fecy" alt=""><figcaption></figcaption></figure>
12. Click the blue *Save and continue* button at the bottom of the page.
13. Click the *Done* butto&#x6E;*.*

</details>

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If Google Ads events are NOT occurring, but you were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Google Ads.
* Make sure your campaign Share URL (and the page where the referral submits their email address, if you are tracking conversions) is a part of your Google Ads account. You can find the campaign Share URL in the *Campaign Editor > 5. Installation* step.
* If you are testing conversions being tracked, make sure that you've allowed up to 24-48 hours for Google Ads to process the events.
* To troubleshoot if the Google ads script (Tag Manager) is loading on your website, you'll want to make sure you that you visit a participant's referral link first.

#### If Google Ad events are occurring, but you were NOT expecting them:

* If you want to prevent Google Ads from being loaded completely, you must disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you see Google Ads network requests being made on your website and you have the integration completely disabled, GrowSurf may not be emitting these events. Check other parts of your code to find where these events might be happening.


# Google Analytics

Track and analyze referral program data alongside product analytics in Google Analytics.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

After connecting, the Google Analytics integration transmits data to your Google Analytics (GA4) account, enabling analysis and reporting on your referral program.

For referrers, when they are added to your campaign (e.g., they get a referral link generated) or if they click a social share button (like Facebook or LinkedIn), GrowSurf sends a Google Analytics event. For referred friends, if they sign up using your Share URL, GrowSurf also sends an event.

{% hint style="success" %}
Under the hood, GrowSurf will load the Google Analytics JavaScript library, set user properties (for both referrers and referred friends), and track events. Rest assured, if Google Analytics is already installed, GrowSurf ensures the library is not loaded twice and prevents duplicate identity calls.
{% endhint %}

## Tracked Events

The following events will be emitted with the `growsurf_` prefix.

| Event                       | Description                            | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `growsurf_referral`         | \[Referred friend] New referral signup | <p>Records when a referred visitor signs up through a referral link.<br><br>This includes:</p><ul><li>Those who submit the form on your website that has referral tracking enabled (via the campaign editor)</li><li>Adding a referred participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul>                                                                                                                                                                                                                                                        |
| `growsurf_referral_trigger` | \[Referred friend] Referral triggered  | Records when a referred participant completes the desired qualifying action, which triggers a referral. Only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral).                                                                                                                                                                                                                                                                                                                                                                                                    |
| `growsurf_signup`           | \[Referrer] New referrer signup        | <p>Records when someone generates a referral link and joins the campaign as a participant.</p><p>This includes:</p><ul><li>Direct signups (someone entering in their email address on the GrowSurf form)</li><li>Passing in an email address via URL parameter <code>?grsf\_email</code></li><li>Passing in an email address via <code>data-grsf-email</code> attribute on an <a href="https://docs.growsurf.com/developer-tools/embeddable-elements">Embeddable Element</a></li><li>Adding a participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul> |
| `growsurf_share`            | \[Referred] Social media share         | Records when a referrer shares their link by clicking 'Copy Link' or clicking a social media button                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `growsurf_invite`           | \[Referrer] Email invite(s) sent       | Records when a referrer sends invitation(s) via email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Example Events

Events correspond with the events listed in the [`growsurf.subscribe()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) method. To see examples of the raw `JSON` data, please see the [*Example Response*](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) section.

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Google Analytics integration card and enter your [Google Analytics measurement ID](https://support.google.com/analytics/answer/12270356?hl=en).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Google Analytics installed on your website, you do not need to enter in the Google Analytics measurement ID. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Google Analytics installed.
{% endhint %}

<figure><img src="/files/LouzggKcxaY1bUk4ylsP" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Within your Google Analytics account, make sure to whitelist the URLs where these events occur. These are primarily two locations: your referral portal (which might be part of your user portal or web app, or the [GrowSurf-hosted referral portal](https://support.growsurf.com/article/196-where-can-i-find-my-campaigns-dedicated-landing-page)) and the referred friend's landing page (the Share URL you enter in the *Campaign Editor > 5. Installation* step).
{% endhint %}

Once GrowSurf events get emitted, you will see them show up in *Google Analytics > Reports > Events.*

{% hint style="info" %}
**Note:** Please allow up to 24-48 hours of processing time for events to appear (in some cases where Google Analytics is backed up, it can take longer).
{% endhint %}

***

## How to View Events In Google Analytics

Once events are emitted to Google Analytics, you'll need to follow these instructions below to set up a metric page for each event.

**Step 1**: From Google Analytics, navigate to *Reports > Events* and click *Add filter.*

**Step 2:** Set the filter conditions to the following values:

* For *Dimension*, select "Event Category"
* For *Match Type*, select "contains"
* For *Value*, select "GrowSurf" (if you don't see this option, you'll want to make sure there is at least one GrowSurf event that exists as Google Analytics will auto-generate this option. This could take 24-48 hours)

Your screen should now look like this:

<figure><img src="/files/P4q9DVA30IObqVzj7Zxr" alt=""><figcaption></figcaption></figure>

**Step 3**: Click the bottom-right *Apply* button.

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If you are not receiving events, but were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Google Analytics.
* Make sure to whitelist the URL where events are being tracked (e.g, if your referrer clicks the Facebook share button from *<https://app.yoursite.com/refer>*, you'll want to make sure you whitelist that root domain. If a referred friend signs up on your Share URL, make sure to whitelist the Share URL as well).
* If you just submitted an event, make sure that you've allowed up to 24-48 hours for Google Analytics to process the event.

#### If you are receiving events, but were NOT expecting them:

* To ensure no non-GrowSurf-related events are sent to your Google Analytics account, disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you're receiving events without a GrowSurf-related suffix (e.g., `growsurf_`), it indicates that GrowSurf may not be emitting these events. Please check other parts of your code to find where these events might be occurring.


# Heap

Track and analyze referral program data alongside product analytics in Heap.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

After connecting, the Heap integration transmits data to your Heap account, enabling analysis and reporting on your referral program.

For referrers, when they are added to your campaign (e.g., they get a referral link generated) or if they click a social share button (like Facebook or LinkedIn), GrowSurf sends an Heap event. For referred friends, if they sign up using your Share URL, GrowSurf also sends an event.

{% hint style="success" %}
Under the hood, GrowSurf will load the Heap JavaScript library, identify participants (both referrers and referred friends) by their email address, and track events. Rest assured, if Heap is already installed, GrowSurf ensures the library is not loaded twice and prevents duplicate identity calls.
{% endhint %}

## Tracked Events

The following events will be emitted with the `growsurf_` prefix.

| Event                       | Description                            | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `growsurf_referral`         | \[Referred friend] New referral signup | <p>Records when a referred visitor signs up through a referral link.<br><br>This includes:</p><ul><li>Those who submit the form on your website that has referral tracking enabled (via the campaign editor)</li><li>Adding a referred participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul>                                                                                                                                                                                                                                                        |
| `growsurf_referral_trigger` | \[Referred friend] Referral triggered  | Records when a referred participant completes the desired qualifying action, which triggers a referral. Only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral).                                                                                                                                                                                                                                                                                                                                                                                                    |
| `growsurf_signup`           | \[Referrer] New referrer signup        | <p>Records when someone generates a referral link and joins the campaign as a participant.</p><p>This includes:</p><ul><li>Direct signups (someone entering in their email address on the GrowSurf form)</li><li>Passing in an email address via URL parameter <code>?grsf\_email</code></li><li>Passing in an email address via <code>data-grsf-email</code> attribute on an <a href="https://docs.growsurf.com/developer-tools/embeddable-elements">Embeddable Element</a></li><li>Adding a participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul> |
| `growsurf_share`            | \[Referred] Social media share         | Records when a referrer shares their link by clicking 'Copy Link' or clicking a social media button                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `growsurf_invite`           | \[Referrer] Email invite(s) sent       | Records when a referrer sends invitation(s) via email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Example Events

Events correspond with the events listed in the [`growsurf.subscribe()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) method. To see examples of the raw `JSON` data, please see the [*Example Response*](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) section (Note that event objects will be flattened before being sent to Heap).

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Heap integration card and enter your [Heap App ID](https://help.heap.io/getting-started/getting-started-faqs/whats-the-difference-between-the-app-id-and-env-id-in-heap/).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Heap installed on your website, you do not need to enter in the Heap App ID. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Heap installed.
{% endhint %}

<figure><img src="/files/6S8uVJYUKIcrf2xf2SuM" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Within your Heap account, make sure to whitelist the URLs where these events occur. These are primarily two locations: your referral portal (which might be part of your user portal or web app, or the [GrowSurf-hosted referral portal](https://support.growsurf.com/article/196-where-can-i-find-my-campaigns-dedicated-landing-page)) and the referred friend's landing page (the Share URL you enter in the *Campaign Editor > 5. Installation* step).
{% endhint %}

Once GrowSurf events get emitted, you will see them show up in Heap *> Data > Live data feed*.

To view only GrowSurf-related data, filter results by setting `participant.id` to "is defined" (see image below).

<figure><img src="/files/Tb4hEUxJUl1olvG2Kmob" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Please allow up to 15 minutes of processing time for events to appear (in some cases where Heap is backed up, it can take longer).
{% endhint %}

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If you are seeing a wrongly identified user:

There are 5 different ways that GrowSurf participants can be added to your campaign. Please make sure that the GrowSurf participant email address that you are passing in matches the one you were expecting for the Heap user:

* If you pass in a `data-grsf-email` attribute to a [GrowSurf embeddable element](https://docs.growsurf.com/developer-tools/embeddable-elements)
* If you pass in an email address via URL parameter `?grsf_email`
* If you are using [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant)
* If you enter an email address via the GrowSurf form
* If you are a referred friend and you submit the form that has referral tracking configured on it from the *Campaign Editor > 5. Installation* step

#### If you are not receiving events, but were expecting them:

* Please make sure you are using the [Heap App ID](https://help.heap.io/getting-started/getting-started-faqs/whats-the-difference-between-the-app-id-and-env-id-in-heap/) from your *Production* environment (and not your *Heap Env ID*).
* Make sure you do not have any ad-blockers or browser extensions blocking requests to Heap.
* Make sure to whitelist the URL where events are being tracked (e.g, if your referrer clicks the Facebook share button from *<https://app.yoursite.com/refer>*, you'll want to make sure you whitelist that root domain. If a referred friend signs up on your Share URL, make sure to whitelist the Share URL as well).
* If you just submitted an event, make sure that you've allowed up to 15 minutes for Heap to process the event.

#### If you are receiving events, but were NOT expecting them:

* To ensure no non-GrowSurf-related events are sent to your Heap account, disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you're receiving events without a GrowSurf-related suffix (e.g., `growsurf_`), it indicates that GrowSurf may not be emitting these events. Please check other parts of your code to find where these events might be occurring.


# Help Scout

View Help Scout customers' referral information right within Help Scout.

## Connect to Help Scout <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to Help Scout* button.

![](/files/-MfrohFTu5r9HuHzQJUH)

**Step 2:** Once connected, you should now see two fields called "Callback URL" and "Secret Key" that will be used later in **Step 6***.*

![](/files/-MfroynhjGPkCo3r61cn)

**Step 3:** Log into your [Help Scout](http://secure.helpscout.net/) account and navigate to *Manage > Apps.*

![](/files/-MfrpQ8zksk4OI--O0pG)

**Step 4:** Scroll to the bottom of the page and click *Build a Custom App.*

![](/files/-Mfrpal8SSUw6wLn3zSM)

**Step 5:** Click on the *Create App* button on the left-hand side.

![](/files/-MfrplfmvkWgUF0Rr_SN)

**Step 6:** For *App Name* type "GrowSurf", and for *Content Type* select "Dynamic Content". From **Step 2** above, copy and paste the Callback URL and Secret Key values into their respective fields. Lastly, check the Help Scout mailbox where you want the GrowSurf app displayed.

You should now see a screen that looks like the one below:

![](/files/-MfrpuK_485Wsyk0Hkv0)

**Step 7:** Click the *Save* button. Now, anytime you have a GrowSurf participant who has the same email address of a Help Scout customer, their GrowSurf information will be displayed directly within Help Scout.

## Using GrowSurf in Help Scout

When you open up a customer ticket in your Help Scout mailbox, you will see the GrowSurf participant's properties being displayed on the right-hand side.

![](/files/-MfrqtYdZIpVu4CXv6il)

Here are some examples of how to use the GrowSurf app within Help Scout:

* Implement a formal protocol with your support team to end Help Scout conversations by providing your customers with their *GrowSurf Share URL*. An example canned response could be the following:

  `"Thank you for contacting us today! Please let me know if you have any further questions. If you're enjoying your experience with us, we are running a referral program where you and a friend can both receive $50. Here is your unique link that you can directly share: https://yoursite.com?grsfb=abc123`
* Troubleshoot issues related to your GrowSurf referral program directly within Help Scout by viewing the participant's details such as their referrer information, and their total and monthly referral counts.


# HubSpot

Trigger referrals on HubSpot deal stage changes and update/add HubSpot contacts with their unique share link and referrer information.

## Referral Trigger

### Description

When you connect your HubSpot account to your GrowSurf campaign and enable *Referral Trigger*, GrowSurf will automatically detect and trigger referrals on HubSpot deal stage changes.

GrowSurf will check if the HubSpot deal's associated contacts' email addresses match a GrowSurf participant's email address. If a match is found, then a referral will trigger, giving referral credit to the referrer and unlocking any rewards, if applicable.

Here's how to set up HubSpot referral triggers:

### **How to Set Up**

{% hint style="warning" %}
**Important Note:** Unless your campaign is configured to add participants automagically ([see image](https://files.gitbook.com/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), you'll need to make sure you first call JavaScript [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant) or REST API [`/POST Add Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant) to add new participant&#x73;**.**
{% endhint %}

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, click the *Connect to HubSpot* button.

![](/files/-McuA_iGt_GuBPhVbIgF)

**Step 2:** Once connected, toggle the switch to enable the *Referral Trigger*.

![](/files/-McuB89oeuTfSAufwNvj)

**Step 3:** Select a HubSpot pipeline, then select a deal stage.

![](/files/-McuBTXIWOzbenfsmLeK)

**(Optional) Step 4:** You can add a referral trigger hold period by toggling the *Show advanced settings* section.

{% hint style="info" %}
**Note:** The referral trigger hold period is useful for making sure that deals that fall through do not count as referrals. During this hold period, if a deal does not retain the stage you selected, the referral trigger will be canceled completely.
{% endhint %}

![](/files/-McuBgItALd_HDNShn2s)

### Troubleshooting Tips

* When testing out the HubSpot Referral Trigger integration, make sure to view participants' activity logs for details that can help you troubleshoot any issues.
* HubSpot events (e.g. changing of a stage in a deal) that are sent to GrowSurf are sent asynchronously and could take up to one minute or longer depending on load. Until the event is received GrowSurf cannot process the event and trigger the referral. Furthermore, we use a message queue to process these events. If you do not see a referral trigger right away please be patient.

## Sync Data

### **Description**

When new GrowSurf participants are added to your campaign, they will automatically be added/updated as HubSpot contacts with a new property group *GrowSurf.* Their unique share link and referrer information will be available for use in emails and reports.

### How to Set Up

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to HubSpot* button

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to HubSpot only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to HubSpot.
{% endhint %}

![](/files/-LmOlCN4iy6AakjEDPHv)

**Step 2:** Choose a HubSpot account

![](/files/-LmOlJ67NDlYYLe2Afn0)

Once you have successfully connected to HubSpot, GrowSurf will automatically create a new contact property group called *GrowSurf* in your HubSpot account that contains new contact properties (see image below). You can confirm these contact properties in the *Settings > Contact Properties* page in your Hubspot account.

![](/files/-LmOlUsmlURIt_Kt6tBc)

### Examples

[View our HubSpot tutorials](https://docs.growsurf.com/additional-integrations/hubspot/tutorial) to see different kinds of examples that you can copy/paste into your email templates.

### Contact Properties

GrowSurf will automatically create these new contact properties for your HubSpot contacts.

| **Contact properties**                            | **Field type**   | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                  |
| ------------------------------------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| GrowSurf Share URL                                | Single-line text | text     | The participant's unique Share URL (contains their unique GrowSurf ID)                                                                                                                                    | `https://piedpiper.com?grsf=d77a8j`                          |
| GrowSurf Participant ID                           | Single-line text | text     | The participant's unique GrowSurf ID                                                                                                                                                                      | `d77a8j`                                                     |
| GrowSurf Referral Status                          | Single-line text | text     | The referral status of the participant\*                                                                                                                                                                  | `CREDIT_PENDING`                                             |
| GrowSurf Referrer Email                           | Single-line text | text     | The email of the participant's referrer                                                                                                                                                                   | `gavin@hooli.com`                                            |
| GrowSurf Referrer First Name                      | Single-line text | text     | The first name of the participant's referrer                                                                                                                                                              | `Gavin`                                                      |
| GrowSurf Referrer Last Name                       | Single-line text | text     | The last name of the participant's referrer                                                                                                                                                               | `Belson`                                                     |
| GrowSurf Participant First Name                   | Single-line text | text     | The participant's First Name                                                                                                                                                                              | `Bob`                                                        |
| GrowSurf Participant Last Name                    | Single-line text | text     | The participant's Last Name                                                                                                                                                                               | `Loblaw`                                                     |
| GrowSurf Total Referral Count                     | Number           | number   | The participant's all-time referral count                                                                                                                                                                 | `0`                                                          |
| GrowSurf Monthly Referral Count                   | Number           | number   | The participant's current month referral count                                                                                                                                                            | `19`                                                         |
| <p>GrowSurf</p><p>Prev Monthly Referral Count</p> | Number           | number   | The participant's previous month referral count                                                                                                                                                           | `200`                                                        |
| GrowSurf Next Milestone                           | Single-line text | text     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | `You are only 2 referrals away from winning a free t-shirt!` |
| GrowSurf Next Monthly Milestone                   | Single-line text | text     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | `You are only 2 referrals away from winning a free t-shirt!` |
| GrowSurf Total Invite Count                       | Number           | number   | The participant's all-time invite count                                                                                                                                                                   | `112`                                                        |
| GrowSurf Total Impression Count                   | Number           | number   | The participant's all-time impression count                                                                                                                                                               | `150`                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

\* HubSpot has rate limiting in place for all plans. Please make sure that you are not hitting those limits by following their limits. [Learn more here](https://developers.hubspot.com/apps/api_guidelines).

[Learn more about Hubspot's property fields here.](https://knowledge.hubspot.com/contacts/property-field-types-in-hubspot)

### Troubleshooting Tips

* **If the new participant isn't being added to HubSpot, or if they are being added but their unique referral link isn't being synced to HubSpot:**
  * Activity logs will denote if a participant was added to HubSpot or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
* **If a Hubspot contact has multiple email addresses, GrowSurf will only sync participant data to one HubSpot contact:**
  * Each of your HubSpot contacts is uniquely identifiable by their primary email address. Similarly, all GrowSurf participants are uniquely identified by their email address. When GrowSurf adds a new primary contact or updates an existing primary contact within your Hubspot account, only the email address associated with the GrowSurf participant will be updated, reflecting their GrowSurf participant information.


# Tutorials

We'll walk you through adding personalized referral program messaging to your HubSpot emails.

When you connect your GrowSurf campaign to HubSpot, you can easily embed a referral program into your HubSpot emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

{% hint style="info" %}
Please note for HubSpot-specific HTML email templates you must include the required [HubL tags](https://developers.hubspot.com/docs/cms/hubl/variables?_ga=2.182616229.2003358577.1611128666-490284502.1609174873) and [CAN-SPAM](https://knowledge.hubspot.com/articles/kcs_article/email/what-information-is-required-in-the-can-spam-footer?_ga=2.194537133.1045629725.1592832066-1824339173.1557508910) tokens.
{% endhint %}

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your HubSpot email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
    <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{{ contact.growsurf_share_url }}" style="color: #1673df; text-decoration: none;">{{ contact.growsurf_share_url }}</a>
      </p>
      <div> 
        <a href="mailto:?body={{ contact.growsurf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
        <a href="https://www.facebook.com/sharer/sharer.php?u={{ contact.growsurf_share_url }}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
        <a href="https://twitter.com/intent/tweet?url={{ contact.growsurf_share_url }}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 12, replace `#1673df` with your own brand color.
3. At line 15, replace the text `{{ contact.growsurf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ contact.growsurf_share_url }}` only to the encoded message
4. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your HubSpot email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your HubSpot email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p><a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;"><div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div></td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">  
            <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your HubSpot email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
     </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your HubSpot email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
       <h1 style="margin: 5px;">Give $100, Get $100</h1>
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
         <a href="{{ contact.growsurf_share_url }}" style="color: #4f46e5; text-decoration: none;">{{ contact.growsurf_share_url }}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your HubSpot email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; "> <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{ contact.growsurf_share_url }}" style="color: #ffffff;">{{ contact.growsurf_share_url }}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{ contact.growsurf_share_url }}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ contact.growsurf_share_url }}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> </a>
      <a href="mailto:?body={{ contact.growsurf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ contact.growsurf_share_url }}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> </a>
      <a href="https://wa.me?text={{ contact.growsurf_share_url }}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{ contact.growsurf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ contact.growsurf_share_url }}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your HubSpot email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
    <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your HubSpot email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
  </tr>
   </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your HubSpot email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Get your swag
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{ contact.growsurf_share_url }}" style="color: #8E4CED;">{{ contact.growsurf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{ contact.growsurf_total_referral_count }} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="color: #8E4CED;">Check your status here</a>. {{ contact.growsurf_next_milestone }}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{ contact.growsurf_next_milestone }}`is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your HubSpot email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{ contact.growsurf_total_referral_count }} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{ contact.growsurf_share_url }}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{ contact.growsurf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{ contact.growsurf_next_milestone }}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{ contact.growsurf_total_referral_count }}`. In this example, you would display any one of these five images at a given time:
   1. If `{{ contact.growsurf_total_referral_count }}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{ contact.growsurf_total_referral_count }}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{ contact.growsurf_total_referral_count }}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{ contact.growsurf_total_referral_count }}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{ contact.growsurf_total_referral_count }}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{ contact.growsurf_next_milestone }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your HubSpot email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{ contact.growsurf_share_url }}" style="color: #8E4CED;">{{ contact.growsurf_share_url }}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your HubSpot email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{ contact.growsurf_share_url }}" style="color: #F46A54;">{{ contact.growsurf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your HubSpot email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{ contact.growsurf_share_url }}" style="color: #F46A54;">{{ contact.growsurf_share_url }}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Intercom

Update Intercom contacts with their unique share link and referrer information.

## Sync with Intercom <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to Intercom* button.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Intercom only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Intercom.
{% endhint %}

![](/files/-Mea9XP1dOmIWjFL5Sbo)

**Step 2:** Log in to Intercom

![](/files/-MeaWpFWtXbM72CQVPvB)

**Step 3:** Once connected, choose an Intercom Tag that you want to automatically sync to. GrowSurf will update/add Intercom contacts with their unique share link and referrer information every time a new participant is added or referred to your referral campaign.

![](/files/-Mea_odFpDKPR_UnCxnh)

## Examples

[View our Intercom tutorials](https://docs.growsurf.com/additional-integrations/intercom/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Contact Attributes** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new contact attributes for your Intercom contacts.

| **Contact Attributes**                     | **Tag**                                                  | **Type** | **Description**                                                                                                                                                                                        | **Example**                                                |
| ------------------------------------------ | -------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| **`growsurf_share_url`**                   | `{{ custom_data.growsurf_share_url }}`                   | TEXT     | The participant's unique referral link                                                                                                                                                                 | <https://growsurf.com?grsf=absc123>                        |
| **`growsurf_participant_id`**              | `{{ custom_data.growsurf_participant_id }}`              | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                   | abc123                                                     |
| **`growsurf_referral_status`**             | `{{ custom_data.growsurf_referral_status }}`             | TEXT     | The referral status of the participant\*                                                                                                                                                               | CREDIT\_PENDING                                            |
| **`growsurf_participant_first_name`**      | `{{ custom_data.growsurf_participant_first_name }}`      | TEXT     | The participant's first name                                                                                                                                                                           | Bob                                                        |
| **`growsurf_participant_last_name`**       | `{{ custom_data.growsurf_participant_last_name }}`       | TEXT     | The participant's last name                                                                                                                                                                            | Loblaw                                                     |
| **`growsurf_referrer_first_name`**         | `{{ custom_data.growsurf_referrer_first_name }}`         | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                           | Gavin                                                      |
| **`growsurf_referrer_last_name`**          | `{{ custom_data.growsurf_referrer_last_name }}`          | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                            | Belson                                                     |
| **`growsurf_referrer_email`**              | `{{ custom_data.growsurf_referrer_email }}`              | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                        | <gavin.belson@hoolie.io>                                   |
| **`growsurf_total_referral_count`**        | `{{ custom_data.growsurf_total_referral_count }}`        | NUMBER   | The participant's all-time referral count                                                                                                                                                              | 0                                                          |
| **`growsurf_monthly_referral_count`**      | `{{ custom_data.growsurf_monthly_referral_count }}`      | NUMBER   | The participant's current month referral count                                                                                                                                                         | 19                                                         |
| **`growsurf_prev_monthly_referral_count`** | `{{ custom_data.growsurf_prev_monthly_referral_count }}` | NUMBER   | The participant's previous month referral count                                                                                                                                                        | 200                                                        |
| **`growsurf_next_milestone`**              | `{{ custom_data.growsurf_next_milestone }}`              | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **`growsurf_next_monthly_milestone`**      | `{{ custom_data.grsf_next_monthly_milestone }}`          | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **`growsurf_total_invite_count`**          | `{{ custom_data.grsf_total_invite_count }}`              | NUMBER   | The participant's all-time invite count                                                                                                                                                                | 112                                                        |
| **`growsurf_total_impression_count`**      | `{{ custom_data.grsf_total_impression_count }}`          | NUMBER   | The participant's all-time impression count                                                                                                                                                            | 150                                                        |

\*g*rowsurf\_referral\_status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these attributes in your Intercom email templates. Whether you launch a new marketing campaign or have an automated Intercom campaign going on, make sure to always include `{{ custom_data.growsurf_share_url }}`in your emails to provoke your people to make referrals!

​[​Learn more about Intercom emails here](https://www.intercom.com/help/en/articles/247-create-custom-email-templates).​

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Intercom or if they are being added but their unique referral link isn't being synced to Intercom:**
  * Activity logs on your GrowSurf participant's detail page will denote if they were added to Intercom (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
* **If you cannot see the GrowSurf participant's custom attributes within Intercom:**
  * To see custom attributes within your Intercom contact details you must first add them within your [Intercom Qualification Settings](https://app.intercom.com/a/apps/ba5inddz/settings/qualification-settings). Click the blue "Add Data" button at the bottom within these settings and add the GrowSurf attributes you wish to see. Once added, navigate back to the GrowSurf participant's contact record within Intercom. The GrowSurf attributes you added should now be displayed.
* **If the GrowSurf participant's referral count attributes are not being updated within Intercom:**
  * Intercom can take up to several minutes to display the updated GrowSurf participant data within their UI. If data is not immediately available, please refresh the Intercom contact you are viewing. Once refreshed, you should see the updated GrowSurf participant data within Intercom after one to two minutes.


# Tutorials

We'll walk you through adding personalized referral program messaging to your Intercom emails.

When you connect your GrowSurf campaign to Intercom, you can easily embed a referral program into your Intercom emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Intercom email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{{ custom_data.growsurf_share_url }}" style="color: #1673df; text-decoration: none;">{{ custom_data.growsurf_share_url }}</a>
      </p>
      <div> 
         <a href="mailto:?body={{ custom_data.growsurf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u={{ custom_data.growsurf_share_url }}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url={{ custom_data.growsurf_share_url }}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{{ custom_data.growsurf_share_url }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ custom_data.growsurf_share_url }}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Intercom email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
   </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Intercom email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Intercom email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
   </td >
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Intercom email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="{{ custom_data.growsurf_share_url }}" style="color: #4f46e5; text-decoration: none;">{{ custom_data.growsurf_share_url }}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Intercom email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{ custom_data.growsurf_share_url }}" style="color: #ffffff;">{{ custom_data.growsurf_share_url }}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{ custom_data.growsurf_share_url }}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ custom_data.growsurf_share_url }}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{ custom_data.growsurf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ custom_data.growsurf_share_url }}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{ custom_data.growsurf_share_url }}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{ custom_data.growsurf_share_url }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ custom_data.growsurf_share_url }}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Intercom email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
     <td> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
     </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Intercom email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
     <td style="text-align: center;"> 
     <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ contact.email }}&grsf_first_name={{ contact.firstname }}&grsf_last_name={{ contact.lastname }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
     </td>
    </tr>
   </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Intercom email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                   Get your swag 
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{ custom_data.growsurf_share_url }}" style="color: #8E4CED;">{{ custom_data.growsurf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{ custom_data.growsurf_total_referral_count' }} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="color: #8E4CED;">Check your status here</a>. {{ custom_data.growsurf_next_milestone' }}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{ custom_data.growsurf_next_milestone }}`is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Intercom email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{ custom_data.growsurf_total_referral_count' }} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                   Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{ custom_data.growsurf_share_url }}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{ custom_data.growsurf_share_url' }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{ custom_data.growsurf_next_milestone }}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{ custom_data.growsurf_total_referral_count }}`. In this example, you would display any one of these five images at a given time:\*
   1. If `{{ custom_data.growsurf_total_referral_count }}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{ custom_data.growsurf_total_referral_count }}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{ custom_data.growsurf_total_referral_count }}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{ custom_data.growsurf_total_referral_count }}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{ custom_data.growsurf_total_referral_count }}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{ custom_data.growsurf_next_milestone }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Intercom email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{ custom_data.growsurf_share_url }}" style="color: #8E4CED;">{{ contact.growsurf_share_url }}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Intercom email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{ custom_data.growsurf_share_url }}" style="color: #F46A54;">{{ custom_data.growsurf_share_url }}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Intercom email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{ custom_data.growsurf_share_url }}" style="color: #F46A54;">{{ custom_data.growsurf_share_url }}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Klaviyo

Update Klaviyo contacts with their unique share link and referrer information.

## Sync with your Klaviyo List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Klaviyo integration card and enter your Klaviyo API secret ([click here to get your Klaviyo private API key](https://help.klaviyo.com/hc/en-us/articles/115005062267-How-to-Manage-Your-Account-s-API-Keys#find-your-api-keys1)).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Klaviyo only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Klaviyo.
{% endhint %}

![](/files/-MQIBvMGwSQslhgTna6p)

**Step 2:** Once connected, choose the Klaviyo list that you want to automatically sync to. GrowSurf will add/update your Klaviyo contacts every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

![](/files/-MQMEINC18u6WKCf4kkT)

## Examples

[View our Klaviyo tutorials](https://docs.growsurf.com/additional-integrations/klaviyo/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Properties** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new properties for your Klaviyo contacts.

| **Property Name**                        | **Custom Property Tag**                                  | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | -------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `{{ person\|lookup:'GrowSurf Share URL' }}`              | TEXT     | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `{{ person\|lookup:'GrowSurf Participant ID' }}`         | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `{{ person\|lookup:'GrowSurf Referral Status' }}`        | TEXT     | The referral status for the participant                                                                                                                                                                   | CREDIT\_ PENDING                                           |
| **GrowSurf Participant First Name**      | `{{ person\|lookup:'GrowSurf Participant First Name' }}` | TEXT     | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `{{ person\|lookup:'GrowSurf Participant Last Name' }}`  | TEXT     | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `{{ person\|lookup:'GrowSurf Referrer First Name' }}`    | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `{{ person\|lookup:'GrowSurf Referrer Last Name' }}`     | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `{{ person\|lookup:'GrowSurf Referrer Email' }}`         | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `{{ person\|lookup:'GrowSurf Total Referral Count' }}`   | NUMBER   | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `{{ person\|lookup:'GrowSurf Monthly Referral Count' }}` | NUMBER   | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `{{ person\|lookup:'Prev Monthly Referral Count' }}`     | NUMBER   | The participant's previous month referral count                                                                                                                                                           | 20                                                         |
| **GrowSurf Next Milestone**              | `{{ person\|lookup:'GrowSurf Next Milestone' }}`         | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `{{ person\|lookup:'GrowSurf Next Monthly Milestone' }}` | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. S[ee an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `{{ person\|lookup:'GrowSurf Total Invite Count' }}`     | NUMBER   | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `{{ person\|lookup:'GrowSurf Total Impression Count' }}` | NUMBER   | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these new properties in your Klaviyo email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include`{{ person|lookup:'GrowSurf Share URL' }}` in your emails to provoke your contacts to make referrals!

[​Click here to learn more about Klaviyo's template tags and variables.​](https://help.klaviyo.com/hc/en-us/articles/115005084927-Template-Tags-and-Variable-Syntax)

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Klaviyo, or if they are being added but their unique referral link isn't being synced to Klaviyo:**
  * Activity logs will denote if a participant was added to Klaviyo or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your Klaviyo emails.

When you connect your GrowSurf campaign to Klaviyo, you can easily embed a referral program into your Klaviyo emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
         <a href="{{ person|lookup:'GrowSurf Share URL' }}" style="color: #1673df; text-decoration: none;">{{ person|lookup:'GrowSurf Share URL' }}</a>
      </p>
      <div> 
         <a href="mailto:?body={{ person|lookup:'GrowSurf Share URL' }}20Share%20URL%7D%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u={{ person|lookup:'GrowSurf Share URL' }}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url={{ person|lookup:'GrowSurf Share URL' }}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{{ person|lookup:'GrowSurf Share URL' }}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ person|lookup:'GrowSurf Share URL' }}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`)

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
       <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
       <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; dislay: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
         <a href="{{ person|lookup:'GrowSurf Share URL' }}" style="color: #4f46e5; text-decoration: none;">{{ person|lookup:'GrowSurf Share URL' }}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{{ person|lookup:'GrowSurf Share URL' }}" style="color: #ffffff;">{{ person|lookup:'GrowSurf Share URL' }}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{ person|lookup:'GrowSurf Share URL' }}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{ person|lookup:'GrowSurf Share URL' }}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{ person|lookup:'GrowSurf Share URL' }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ person|lookup:'GrowSurf Share URL' }}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{ person|lookup:'GrowSurf Share URL' }}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{ person|lookup:'GrowSurf Share URL' }}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{ person|lookup:'GrowSurf Share URL' }}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 11, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
     <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
   </tr>
  </td>
 </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                   Get your swag 
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ person|lookup:'GrowSurf Participant First Name' }}&grsf_last_name={{ person|lookup:'GrowSurf Participant Last Name' }}
" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{ person|lookup:'GrowSurf Share URL' }}" style="color: #8E4CED;">{{ person|lookup:'GrowSurf Share URL' }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{ person|lookup:'GrowSurf Total Referral Count' }} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="color: #8E4CED;">Check your status here</a>. {{ person|lookup:'GrowSurf Next Milestone' }}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{ person|lookup:'GrowSurf Next Milestone' }}`is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{ person|lookup:'GrowSurf Total Referral Count' }} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                   Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{{ person|lookup:'GrowSurf Share URL' }}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{ person|lookup:'GrowSurf Share URL' }}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{ person|lookup:'GrowSurf Next Milestone' }}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{ person|lookup:'GrowSurf Total Referral Count' }}`. In this example, you would display any one of these five images at a given time:\*
   1. If `{{ person|lookup:'GrowSurf Total Referral Count' }}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{ person|lookup:'GrowSurf Total Referral Count' }}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{ person|lookup:'GrowSurf Total Referral Count' }}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{ person|lookup:'GrowSurf Total Referral Count' }}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{ person|lookup:'GrowSurf Total Referral Count' }}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{ person|lookup:'GrowSurf Next Milestone' }}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

*\*NOTE: It is not possible to display different reward images in Klaviyo in a single email. You will have to create multiple emails with each having a different image URL based on`{{ person|lookup:'GrowSurf Total Referral Count' }}`*

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{ person|lookup:'GrowSurf Share URL' }}" style="color: #8E4CED;">{{ person|lookup:'GrowSurf Share URL' }}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{ person|lookup:'GrowSurf Share URL' }}" style="color: #F46A54;">{{ person|lookup:'GrowSurf Share URL' }}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{ email }}&grsf_first_name={{ first_name }}&grsf_last_name={{ last_name }}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Klaviyo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{ person|lookup:'GrowSurf Share URL' }}" style="color: #F46A54;">{{ person|lookup:'GrowSurf Share URL' }}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# LinkedIn Ads

Retarget referred visitors and track referral events in LinkedIn Ads to optimize your ad campaigns.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

The LinkedIn Ads integration lets you retarget website visitors who arrive through referral links and track their conversions. Once connected, LinkedIn Ads will track these referred visitors and conversions when they submit their email addresses on your website.

{% hint style="success" %}
Under the hood, GrowSurf loads the LinkedIn Ads library for event tracking. If LinkedIn Ads is already installed, GrowSurf intelligently avoids loading it twice.
{% endhint %}

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the LinkedIn Ads integration card and enter your [LinkedIn Ads partner ID](https://www.linkedin.com/help/lms/answer/a417869/access-your-linkedin-partner-id?lang=en).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have LinkedIn Ads installed on your website, you do not need to enter in the LinkedIn Ads partner ID. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have LinkedIn Ads installed.
{% endhint %}

<figure><img src="/files/tqTFDlBps9ZOOS0xbdTc" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

**Step 3:** In your LinkedIn Ads account, you will need to add the following two Insight Tag conversions (You can skip this step if you have both "Track conversion event" checkboxes toggled off). Follow the instructions in [How to Add Insight Tag Conversions In LinkedIn Ads](#how-to-add-insight-tag-conversions-in-linkedin-a-ds).

* `growsurf_referral_signup` - This conversion event represents when a referred visitor submits their email address on the form on your website that has referral tracking on it.
* `growsurf_referral_trigger` - This conversion event represents when a participant completes a qualifying action, like making a purchase (Note: this only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral)from the front-end).

***

## How to Add Insight Tag Conversions In LinkedIn Ads

<details>

<summary>Open instructions</summary>

You'll need to complete steps 1-12 below for each event `growsurf_referral_signup` and `growsurf_referral_trigger`.

1. Log into your [LinkedIn Ads Campaign Manager account](https://www.linkedin.com/campaignmanager/login).
2. In the left-side menu, navigate to *Measurement > Conversion tracking* and click *Create conversion > Insight Tag conversion* (see image below).

   <figure><img src="/files/I4nXxWrrE8HQelCMDiH9" alt=""><figcaption></figcaption></figure>
3. For the Name, enter the following conversion name depending on which conversion event you're adding:
   1. `growsurf_referral_signup`
   2. `growsurf_referral_trigger`
4. For the conversion category, choose one of the following:
   1. For `growsurf_referral_signup`, we recommend using "Sign Up" (or choose a different category that best represents a referred visitor signing up).
   2. For `growsurf_referral_trigger`, we recommend using "Purchase" (or choose a different category that best represents when a referred participant completes a qualifying action, which triggers a referral).
5. Set the currency (optional).
6. For the other fields like Clicks and Views, you can adjust to your preferences.
7. Click the bottom *Next Step* button (see image below).

   <figure><img src="/files/TOhg7CSMyRSTck5bbINx" alt=""><figcaption></figcaption></figure>
8. In the next screen, for the "conversion tracking method", select "Manual conversions setup"
9. In the "Define your conversion tracking method" section, choose "Event-specific" (see image below).<br>

   <figure><img src="/files/0PHIrDkWitgqDnIyDPsh" alt=""><figcaption></figcaption></figure>
10. Scroll to the bottom of the page and copy the conversion ID to use for the next step (see image below).

    <figure><img src="/files/pUQ97znIAtP8XEM3Gn9l" alt=""><figcaption></figcaption></figure>
11. In your GrowSurf campaign editor, enter the conversion ID for the appropriate input field (see image below).

    <figure><img src="/files/yUXUKR988I1LjkAibmMC" alt=""><figcaption></figcaption></figure>
12. Return to LinkedIn Ads manager and Click *Next step*
13. Click *Create*
14. Make sure that you repeat steps 1-12 above for `growsurf_referral_trigger` as well.

</details>

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If LinkedIn Ads events are NOT occurring, but you were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to LinkedIn Ads.
* If you are testing conversions being tracked, make sure that you've allowed up to 24-48 hours for LinkedIn Ads to process the events.
* To troubleshoot if the LinkedIn ads script is loading on your website, you'll want to make sure you that you visit a participant's referral link first.

#### If LinkedIn Ad events are occurring, but you were NOT expecting them:

* If you want to prevent LinkedIn Ads from being loaded completely, you must disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you see LinkedIn Ads network requests being made on your website and you have the integration completely disabled, GrowSurf may not be emitting these events. Check other parts of your code to find where these events might be happening.


# Loops

Sync GrowSurf participants and referral data to a Loops mailing list.

## Sync participants to a Loops mailing list

**Step 1:** In [Loops > Settings > API](https://app.loops.so/settings?page=api), generate a new API key, and copy it.

**Step 2:** In GrowSurf, open *Program Editor > 4. Options > Integrations > Loops*. Enter the API key, then connect your account.

<figure><img src="/files/pYy3UFDpkx6dw5SKiegY" alt="The Loops integration API key form in the GrowSurf Program Editor"><figcaption><p>Connect Loops with an API key.</p></figcaption></figure>

**Step 3:** Select the Loops mailing list that should receive GrowSurf participants, then save your changes. GrowSurf creates the Contact Properties listed below and starts syncing new and updated participants.

<figure><img src="/files/10BIXTNyMuyEug6JveAD" alt="The enabled Loops integration with the GrowSurf E2E mailing list selected"><figcaption><p>Select the Loops mailing list that should receive participant data.</p></figcaption></figure>

{% hint style="warning" %}
Connect Loops before importing participants. If participants are already in your Program, follow [these ESP sync options](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to send their GrowSurf data to Loops.
{% endhint %}

## Contact Properties

GrowSurf creates these account-level Contact Properties in Loops. Use the property API name inside braces, such as `{grsfShareUrl}`.

| Contact Property                         | API name                       | Type   | Description                                                         | Example                                |
| ---------------------------------------- | ------------------------------ | ------ | ------------------------------------------------------------------- | -------------------------------------- |
| GrowSurf Share URL                       | `grsfShareUrl`                 | String | The participant's unique referral link                              | `https://growsurf.com?grsf=abc123`     |
| GrowSurf Participant ID                  | `grsfParticipantId`            | String | The participant's GrowSurf ID                                       | `abc123`                               |
| GrowSurf Referral Status                 | `grsfReferralStatus`           | String | The participant's referral-credit status                            | `CREDIT_PENDING`                       |
| GrowSurf Participant First Name          | `grsfParticipantFirstName`     | String | The participant's first name                                        | `Bob`                                  |
| GrowSurf Participant Last Name           | `grsfParticipantLastName`      | String | The participant's last name                                         | `Loblaw`                               |
| GrowSurf Referrer First Name             | `grsfReferrerFirstName`        | String | The referrer's first name, when applicable                          | `Gavin`                                |
| GrowSurf Referrer Last Name              | `grsfReferrerLastName`         | String | The referrer's last name, when applicable                           | `Belson`                               |
| GrowSurf Referrer Email                  | `grsfReferrerEmail`            | String | The referrer's email, when applicable                               | `gavin@example.com`                    |
| GrowSurf Total Referral Count            | `grsfTotalReferralCount`       | Number | The participant's all-time referral count                           | `12`                                   |
| GrowSurf Monthly Referral Count          | `grsfMonthlyReferralCount`     | Number | The participant's referral count for the current month              | `3`                                    |
| GrowSurf Previous Monthly Referral Count | `grsfPrevMonthlyReferralCount` | Number | The participant's referral count for the previous month             | `8`                                    |
| GrowSurf Next Milestone                  | `grsfNextMilestone`            | String | The next milestone message, when the Program uses milestone rewards | `2 referrals until your next reward`   |
| GrowSurf Next Monthly Milestone          | `grsfNextMonthlyMilestone`     | String | The next monthly milestone message, when applicable                 | `1 referral until this month's reward` |
| GrowSurf Total Invite Count              | `grsfTotalInviteCount`         | Number | The participant's all-time invite count                             | `24`                                   |
| GrowSurf Total Impression Count          | `grsfTotalImpressionCount`     | Number | The participant's all-time referral-link view count                 | `150`                                  |

The referral status can be `CREDIT_PENDING`, `CREDIT_AWARDED`, or `CREDIT_EXPIRED`.

[View the Loops tutorials](/integrations/loops/tutorials) for copy-and-paste examples. View Loops' [Contact Properties guide](https://loops.so/docs/contacts/properties) to see how to add these values to campaign and workflow emails.

## Troubleshooting

* If GrowSurf cannot connect, generate a new key under *Loops > Settings > API* and try again.
* If the selected mailing list was deleted, choose an existing list in GrowSurf and save again.
* Loops does not allow an unsubscribed Contact to be added back to a mailing list. That Contact can fail while the rest of the integration continues syncing normally.
* Check the GrowSurf participant's activity logs when a participant does not sync. GrowSurf retries temporary provider errors for up to seven days.


# Tutorials

Add GrowSurf referral links and progress data to Loops emails.

Once GrowSurf syncs participants to Loops, you can insert their referral link and progress into campaign and workflow emails. Loops uses a Contact Property's camelCase API name inside braces.

## Display the participant's referral link

Use the synced `grsfShareUrl` property as the link and visible text:

```html
<p>Give your friends a reason to join.</p>
<p>Copy and paste your unique referral link to share:</p>
<p>
  <a href="{grsfShareUrl}">{grsfShareUrl}</a>
</p>
```

## Display a link to your program referral portal

Replace `YOUR_PROGRAM_ID` with your GrowSurf Program ID. If you use a custom Referral Portal domain, replace the `https://grow.surf/YOUR_PROGRAM_ID` portion with that URL.

```html
<a href="https://grow.surf/YOUR_PROGRAM_ID?grsf_email={email}&grsf_first_name={firstName}&grsf_last_name={lastName}">
  View your referral progress
</a>
```

## Show referral progress

```html
<p>You have made {grsfTotalReferralCount} referrals so far.</p>
```

{% hint style="info" %}
Loops asks you to set a fallback when you insert Contact Properties through its editor. Add a fallback for optional values, so an email still sends when that value is empty. See [Personalizing emails](https://loops.so/docs/creating-emails/personalizing-emails) for Loops' current syntax and fallback behavior.
{% endhint %}


# Mailchimp

Update Mailchimp contacts with their unique share link and referrer information.

## Sync with your Mailchimp Audience

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to Mailchimp* button.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Mailchimp only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Mailchimp.
{% endhint %}

![](/files/-MFE5zNiWd3Zurf_2O4B)

**Step 2:** Log in to Mailchimp

![](/files/-MFE6DhB5Hr2nCFrfdMu)

**Step 3:** Once connected, choose the Mailchimp Audience that you want to automatically sync to. GrowSurf will add/update your Mailchimp contacts every time a new participant is added or referred to your referral campaign.

## Examples

[View our Mailchimp tutorials](https://docs.growsurf.com/additional-integrations/mailchimp/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## Merge Tags

GrowSurf will automatically create these new `*|MERGE|*` tags for your Mailchimp Audience.

{% hint style="danger" %}
Mailchimp has a max limit on the number of merge fields that are allowed per audience/list. Typical Mailchimp accounts have a limit of 30 merge fields per list. Pro accounts have a limit of 80.\
\
If you are not seeing all these merge fields within your list this means your limit has been reached and GrowSurf cannot add merge fields to your account. If you wish to have all these merge fields available in your list, delete some of the merge fields from your list within your Mailchimp settings.
{% endhint %}

| **\*\|MERGE\|\* tag** | **Description**                | **Type** | **Description**                                                                                                                                                                                  | **Example**                                                |
| --------------------- | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| `*\|SHAREURL\|*`      | Participant's Share URL        | url      | The participant's unique referral link                                                                                                                                                           | <https://piedpiper.com?grsf=d8a1wa>                        |
| `*\|GROWSURFID\|*`    | Participant's ID               | text     | The participant's unique GrowSurf ID                                                                                                                                                             | d8a1wa                                                     |
| `*\|REFSTATUS\|*`     | Participant's Referral Status  | test     | The referral status of the participant\*                                                                                                                                                         | CREDIT\_PENDING                                            |
| `*\|REFFNAME\|*`      | Referrer's First Name          | text     | The first name of the participant's referrer (if applicable)                                                                                                                                     | Gavin                                                      |
| `*\|REFLNAME\|*`      | Referrer's Last Name           | text     | The last name of the participant's referrer (if applicable)                                                                                                                                      | Belson                                                     |
| `*\|REFEMAIL\|*`      | Referrer's Email               | text     | The email address of the participant's referrer (if applicable)                                                                                                                                  | <gavin@hooli.com>                                          |
| `*\|TREFCOUNT\|*`     | Referral Count                 | number   | The participant's all-time referral count                                                                                                                                                        | 0                                                          |
| `*\|MREFCOUNT\|*`     | Monthly Referral Count         | number   | The participant's current month referral count                                                                                                                                                   | 19                                                         |
| `*\|PMREFCOUNT\|*`    | Previous Monthy Referral Count | number   | The participant's previous month referral count                                                                                                                                                  | 200                                                        |
| `*\|NXTREWARD\|*`     | Next Milestone                 | text     | The text for the next/upcoming milestone reward (Only applies to milestone awards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| `*\|NXTMREWARD\|*`    | Next Monthly Milestone         | text     | The text for the next/upcoming milestone reward (Only applies to milestone awards[.See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))  | You are only 2 referrals away from winning a free t-shirt! |
| `*\|INVCOUNT\|*`      | Total Invite Count             | number   | The participant's all-time invite count                                                                                                                                                          | 11                                                         |
| `*\|IMPCOUNT\|*`      | Total Impression Count         | number   | The participant's all-time impression count                                                                                                                                                      | 150                                                        |

\*\**|REFSTATUS|\** can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these `*|MERGE|*` tags in your Mailchimp email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `*|SHAREURL|*` in your emails to provoke your contacts to make referrals!

[Learn more about Mailchimp merge tags here.](https://mailchimp.com/help/getting-started-with-merge-tags/)

## Troubleshooting Tips

* **If the new participant isn't being added to Mailchimp, or if they are being added but their unique referral link isn't being synced to Mailchimp:**
  * Activity logs will denote if a participant was added to Mailchimp or if they were failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
  * Some failures are fatal to Mailchimp and cannot be re-attempted. One example is the '*Forgotten Email Not Subscribed*' error, which means that the Mailchimp contact was permanently deleted from the Mailchimp Audience and so you must manually re-add them.
  * Make sure that your campaign Share URL is valid (e.g, the unique referral link that looks like `https://yoursite.com`). An invalid URL such as `https://thiswontwork`will result in the new participant not being saved to Mailchimp.
  * If the participant email contains a `+` symbol within the email, Mailchimp will only allow a certain number of these emails into a list before it errors with a message such as `gavin+duplicate@hooli.com has signed up to a lot of lists very recently; we\'re not allowing more signups for now`
  * If your Mailchimp Audience requires specific merge fields (e.g, `FNAME`, `LNAME`), but your newly added GrowSurf participant isn't sending those merge fields to Mailchimp, then Mailchimp will reject the new contact from being added. This could happen if you had initially connected GrowSurf to Mailchimp, but you later made one or more Mailchimp merge fields in your Audience required. To fix this, you must uncheck the required field(s).
    * Depending on your last contact synced, in your GrowSurf campaign editor, you may see a "Your merge fields were invalid...Please enter a value" error message ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LqwuTn5n9Z_Zqmg3OXH%2F-LqwyOGQIpF8eOmCuevC%2FScreen%20Shot%202019-10-11%20at%205.29.31%20PM.png?alt=media\&token=b5e38819-9779-4e0f-a614-d52ef8089bef)), which means that GrowSurf has tried to save a new participant to Mailchimp, but could not due to a missing merge field value.
    * For further help, see [*Mailchimp Help - Set Default Merge Values for an Audience*](https://mailchimp.com/help/set-default-merge-values/)
  * Please note, that if a merge field contains a `null` value, this will break validation and result in Mailchimp not adding or updating the contact. Merge field values should be strings, or empty strings at the bare minimum.
* **If you have** [***Final Welcome Email***](https://mailchimp.com/help/enable-or-disable-final-welcome-email/) **enabled in Mailchimp, but you are not seeing the email sent to new Mailchimp contacts:**
  * The *Final Welcome Email* will not be sent out because GrowSurf adds Mailchimp contacts with a status of `subscribed`. This means that new contacts automatically double opt-in. To send Mailchimp welcome emails, you will need to [Create an Automated Welcome Email](https://mailchimp.com/help/create-an-automated-welcome-email/).
* Once a participant is added to Mailchimp, that is final. GrowSurf will never update participant information in Mailchimp nor delete them.


# Tutorials

We'll walk you through adding personalized referral program messaging to your Mailchimp emails.

When you connect your GrowSurf campaign to Mailchimp, you can easily embed a referral program into your Mailchimp emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $10 for every friend you refer to PrismJar with your personal referral link: 
         <a href="*|SHAREURL|*" style="color: #1673df; text-decoration: none;">*|SHAREURL|*</a>
      </p>
      <div> 
         <a href="mailto:?body=*|SHAREURL|*20Share%20URL%7D%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u=*|SHAREURL|*" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url=*|SHAREURL|*&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
       </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `*|SHAREURL|*%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `*|SHAREURL|*` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`)

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
           <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
           <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
           <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="*|SHAREURL|*" style="color: #4f46e5; text-decoration: none;">*|SHAREURL|*</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; "> 
      <div style="padding: 20px;">
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="*|SHAREURL|*" style="color: #ffffff;">*|SHAREURL|*</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url=*|SHAREURL|*&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u=*|SHAREURL|*" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body=*|SHAREURL|*%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url=*|SHAREURL|*" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text=*|SHAREURL|*" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `*|SHAREURL|*%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `*|SHAREURL|*` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 11, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
     <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
   </tr>
  </td>
 </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="*|SHAREURL|*" style="color: #8E4CED;">*|SHAREURL|*</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have *|TREFCOUNT|* referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="color: #8E4CED;">Check your status here</a>. *|NXTREWARD|*
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `*|NXTREWARD|*` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  *|TREFCOUNT|* referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="*|SHAREURL|*" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">*|SHAREURL|*</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>*|NXTREWARD|*</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `*|TREFCOUNT|*`. In this example, you would display any one of these five images at a given time:
   1. If `*|TREFCOUNT|*` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `*|TREFCOUNT|*` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `*|TREFCOUNT|*` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `*|TREFCOUNT|*` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `*|TREFCOUNT|*` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `*|NXTREWARD|*` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="*|SHAREURL|*" style="color: #8E4CED;">*|SHAREURL|*</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="*|SHAREURL|*" style="color: #F46A54;">*|SHAREURL|*</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=*|EMAIL|*&grsf_first_name=*|FNAME|*&grsf_last_name=*|LNAME|*" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Mailchimp email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="*|SHAREURL|*" style="color: #F46A54;">*|SHAREURL|*</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# MailerLite

Update MailerLite subscribers with their unique share link and referrer information.

## Sync with your MailerLite Group

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the MailerLite integration card and enter your MailerLite API key ([click here to get your MailerLite API key](https://app.mailerlite.com/integrations/api/)).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to MailerLite only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to MailerLite.
{% endhint %}

![](/files/-MHg_tTO9aJ_GX-x9ffq)

**Step 2:** Once connected, choose the MailerLite Group that you want to automatically sync to. GrowSurf will add/update your MailerLite subscribers every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

![](/files/-MHgbaX3thjTgcAlf_FY)

## Examples

[View our MailerLite tutorials](https://docs.growsurf.com/additional-integrations/mailerlite/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Subscriber Fields**

GrowSurf will automatically create these new Subscriber fields for your MailerLite Subscribers.<br>

| **Field Name**                       | **Merge Tag**                         | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ------------------------------------ | ------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GRSF Share URL**                   | `{$grsf_share_url}`                   | TEXT     | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GRSF Participant ID**              | `{$grsf_participant_id}`              | TEXT     | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GRSF Referral Status**             | `{$grsf_participant_referral_status}` | TEXT     | The referral status of the participant\*                                                                                                                                                                  | CREDIT\_PENDING                                            |
| **GRSF Participant First Name**      | `{$grsf_participant_first_name}`      | TEXT     | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GRSF Participant Last Name**       | `{$grsf_participant_last_name}`       | TEXT     | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GRSF Referrer First Name**         | `{$grsf_referrer_first_name}`         | TEXT     | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GRSF Referrer Last Name**          | `{$grsf_referrer_last_name}`          | TEXT     | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GRSF Referrer Email**              | `{$grsf_referrer_email}`              | TEXT     | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GRSF Total Referral Count**        | `{$grsf_total_referral_count}`        | NUMBER   | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GRSF Monthly Referral Count**      | `{$grsf_monthly_referral_count}`      | NUMBER   | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GRSF Prev Monthly Referral Count** | `{$grsf_prev_monthly_referral_count}` | NUMBER   | The participant's previous month referral count                                                                                                                                                           | 200                                                        |
| **GRSF Next Milestone**              | `{$grsf_next_milestone}`              | TEXT     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GRSF Next Monthly Milestone**      | `{$grsf_next_monthly_milestone}`      | TEXT     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GRSF Total Invite Count**          | `{$grsf_total_invite_count}`          | NUMBER   | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GRSF Total Impression Count**      | `{$grsf_total_impression_count}`      | NUMBER   | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GRSF Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these merge tags in your MailerLite email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `{$grsf_share_url}` in your emails to provoke your subscribers to make referrals!

[Learn more about MailerLite merge fields here.](http://help.mailerlite.com/article/show/108704-how-to-create-and-use-custom-fields)

## **Troubleshooting Tips**

* **If the new participant isn't being added to MailerLite, or if they are being added but their unique referral link isn't being synced to MailerLite:**
  * Activity logs will denote if a participant was added to MailerLite or if they were failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your MailerLite emails.

When you connect your GrowSurf campaign to MailerLite, you can easily embed a referral program into your MailerLite emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your MailerLite email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
         <a href="{$grsf_share_url}" style="color: #1673df; text-decoration: none;">{$grsf_share_url}</a>
      </p>
      <div> 
         <a href="mailto:?body={$grsf_share_url}20Share%20URL%7D%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u={$grsf_share_url}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url={$grsf_share_url}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{$grsf_share_url}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{$grsf_share_url}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your MailerLite email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your MailerLite email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
           <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
           <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
           <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the content**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your MailerLite email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your MailerLite email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="{$grsf_share_url}" style="color: #4f46e5; text-decoration: none;">{$grsf_share_url}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your MailerLite email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{$grsf_share_url}" style="color: #ffffff;">{$grsf_share_url}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={$grsf_share_url}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={$grsf_share_url}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={$grsf_share_url}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={$grsf_share_url}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={$grsf_share_url}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{$grsf_share_url}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{$grsf_share_url}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your MailerLite email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
    <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 11, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your MailerLite email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
     <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your MailerLite email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  ⚡️ Get your swag 🔥
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{$grsf_share_url}" style="color: #8E4CED;">{$grsf_share_url}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {$grsf_total_referral_count} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="color: #8E4CED;">Check your status here</a>. {$grsf_next_milestone}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{$grsf_next_milestone}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your MailerLite email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {$grsf_total_referral_count} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  <a href="{$grsf_share_url}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{$grsf_share_url}</a>
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{$grsf_next_milestone}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 36, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{$grsf_total_referral_count}`. In this example, you would display any one of these five images at a given time:\*
   1. If `{$grsf_total_referral_count}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{$grsf_total_referral_count}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{$grsf_total_referral_count}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{$grsf_total_referral_count}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{$grsf_total_referral_count}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{$grsf_next_milestone}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

*\*NOTE: It is not possible to display different reward images in MailerLite in a single email. You will have to create multiple emails with each having a different image URL based on`{$grsf_total_referral_count}`.*

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your MailerLite email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{$grsf_share_url}" style="color: #8E4CED;">{$grsf_share_url}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your MailerLite email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{$grsf_share_url}" style="color: #F46A54;">{$grsf_share_url}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={$email}&grsf_first_name={$name}&grsf_last_name={$last_name}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 3

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your MailerLite email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{$grsf_share_url}" style="color: #F46A54;">{$grsf_share_url}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Mailjet

Update Mailjet contacts with their unique share link and referrer information.

## Sync with your Mailjet List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Mailjet integration card and enter your Mailjet API and secret key ([click here to get your Mailjet API and secret key](https://app.mailjet.com/account/api_keys)).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Mailjet only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Mailjet.
{% endhint %}

![](/files/-MSR8ujsjsTXae1_6HGG)

**Step 2:** Once connected, choose the Mailjet list that you want to automatically sync to. GrowSurf will add/update your Mailjet contacts every time a new participant is added or referred to your referral campaign.

**Step 3:** Save changes. You should now see a screen that looks like the one below:

![](/files/-MSRBmZD3kPXHqvrMkh-)

## Examples

[View our Mailjet tutorials](https://docs.growsurf.com/additional-integrations/mailjet/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Contact Properties** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new contact properties for your Mailjet contacts.

| **Fields**                               | **Name**                                    | **Data Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | ------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `[[data:grsf_share_url]]`                   | String        | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `[[data:grsf_participant_id]]`              | String        | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `[[data:grsf_referral_status]]`             | String        | The referral status of the participant\*                                                                                                                                                                  | CREDIT\_PENDING                                            |
| **GrowSurf Participant First Name**      | `[[data:grsf_participant_first_name]]`      | String        | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `[[data:grsf_participant_last_name]]`       | String        | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `[[data:grsf_referrer_first_name]]`         | String        | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `[[data:grsf_referrer_last_name]]`          | String        | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `[[data:grsf_referrer_email]]`              | String        | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `[[data:grsf_total_referral_count]]`        | Integer       | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `[[data:grsf_monthly_referral_count]]`      | Integer       | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `[[data:grsf_prev_monthly_referral_count]]` | Integer       | The participant's previous month referral count                                                                                                                                                           | 20                                                         |
| **GrowSurf Next Milestone**              | `[[data:grsf_next_milestone]]`              | String        | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `[[data:grsf_next_monthly_milestone]]`      | String        | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `[[data:grsf_total_invite_count]]`          | Integer       | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `[[data:grsf_total_impression_count]]`      | Integer       | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these new contact properties in your Mailjet email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include`[[data:grsf_share_url]]` in your emails to provoke your contacts to make referrals!

​[Learn how to create contact properties in Mailjet here.](https://documentation.mailjet.com/hc/en-us/articles/360043176353-How-to-create-manage-contact-properties-)

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to Mailjet, or if they are being added but their unique referral link isn't being synced to Mailjet:**
  * Activity logs will denote if a participant was added to Mailjet or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).


# Tutorials

We'll walk you through adding personalized referral program messaging to your Mailjet emails.

When you connect your GrowSurf campaign to Mailjet, you can easily embed a referral program into your Mailjet emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Mailjet email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: <a href="[[data:grsf_share_url]]" style="color: #1673df; text-decoration: none;">[[data:grsf_share_url]]</a></p>
      <div> 
         <a href="mailto:?body=[[data:grsf_share_url]]20Share%20URL%7D%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u=[[data:grsf_share_url]]" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url=[[data:grsf_share_url]]&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `[[data:grsf_share_url]]%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `[[data:grsf_share_url]]` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Mailjet email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Mailjet email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Mailjet email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Mailjet email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
         <a href="[[data:grsf_share_url]]" style="color: #4f46e5; text-decoration: none;">[[data:grsf_share_url]]</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Mailjet email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="[[data:grsf_share_url]]" style="color: #ffffff;">[[data:grsf_share_url]]</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url=[[data:grsf_share_url]]&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u=[[data:grsf_share_url]]" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body=[[data:grsf_share_url]]%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url=[[data:grsf_share_url]]" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text=[[data:grsf_share_url]]" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `[[data:grsf_share_url]]%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `[[data:grsf_share_url]]` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Mailjet email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
     <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
     </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Mailjet email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
           <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Mailjet email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                   Get your swag 
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="[[data:grsf_share_url]]" style="color: #8E4CED;">[[data:grsf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have [[data:grsf_total_referral_count]] referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="color: #8E4CED;">Check your status here</a>. [[data:grsf_next_milestone]]
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `[[data:grsf_next_milestone]]`is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Mailjet email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  [[data:grsf_total_referral_count]] referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                   Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="[[data:grsf_share_url]]" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">[[data:grsf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>[[data:grsf_next_milestone]]</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on`[[data:grsf_total_referral_count]]`. In this example, you would display any one of these five images at a given time:
   1. If `[[data:grsf_total_referral_count]]` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `[[data:grsf_total_referral_count]]` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `[[data:grsf_total_referral_count]]` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `[[data:grsf_total_referral_count]]` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `[[data:grsf_total_referral_count]]` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `[[data:grsf_next_milestone]]` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Mailjet email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="[[data:grsf_share_url]]" style="color: #8E4CED;">[[data:grsf_share_url]]</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Mailjet email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="[[data:grsf_share_url]]" style="color: #F46A54;">[[data:grsf_share_url]]</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email=[[EMAIL_TO]]&grsf_first_name=[[data:firstname]]&grsf_last_name=[[data:lastname]]" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Mailjet email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="[[data:grsf_share_url]]" style="color: #F46A54;">[[data:grsf_share_url]]</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Make

Make is a code-free tool that lets you connect to thousands of apps to automate rewards or sync data.

## Example scenarios

Make lets you perform an action when a certain GrowSurf event occurs -- all without having to write any code. Here are a few scenarios in which you would use Make:

* **New Participant Reward:** WHEN a participant reaches a referral goal and thus unlocks a reward, THEN automatically add a new row in *Google Sheets.*
* **New Participant:** WHEN a new participant is added to your GrowSurf campaign, THEN add/update them in your email service provider (e.g, *Mailchimp, InfusionSoft, ConvertKit, HubSpot*).
* **Campaign Ended:** WHEN your GrowSurf campaign ends, THEN email the results of the referral program to your company CEO (total number of impressions, referrals, etc).
* **Trigger Referral:** WHEN you get a new charge in Stripe, THEN trigger a referral.

## Getting started

![](/files/-MGlR1alra1fS5Tecmva)

1. First, [click here to access the GrowSurf app on Make](https://www.make.com/en/integrations/growsurf).
2. Then sign into your Make account, or create a Make account if you don't already have one.
3. Once logged in, click the *Create a new scenario* button. You'll then see a screen asking *What services do you want to integrate?*, and we can move to the next step, which is setting up the Make scenario.

{% hint style="warning" %}
**Note:** Make's free plan provides you with 2 total active scenarios and 1,000 free operations per month. For more, you will need to upgrade your Make plan.
{% endhint %}

## Next steps

View our [Tutorials](/integrations/integromat/tutorials) to view examples of how to set up Make Scenarios for common use-cases.

* [New Participant Reward](/integrations/integromat/tutorials#example-1-new-participant-reward)
* [New Participant](/integrations/integromat/tutorials#example-2-new-participant)
* [Campaign Ended](/integrations/integromat/tutorials#example-3-campaign-ended)
* [Trigger Referral](/integrations/integromat/tutorials#example-4-trigger-referral)


# Tutorials

We'll walk you through creating Make Scenarios.

## Table of contents

| Scenario                                                               |
| ---------------------------------------------------------------------- |
| [Example 1: New Participant Reward](#example-1-new-participant-reward) |
| [Example 2: New Participant](#example-2-new-participant)               |
| [Example 3: Campaign Ended](#example-3-campaign-ended)                 |
| [Example 4: Trigger Referral](#example-4-trigger-referral)             |

## Example 1: New Participant Reward

In this example, we'll connect GrowSurf to Google Sheets, which will let us add a new row when a participant reaches a referral goal and unlocks a reward.

### [Step 1: Get access to GrowSurf on Make](/integrations/integromat#getting-started)

Click on the link above to view how to get access to GrowSurf on Make.

Once logged into Make, click the clear **Create a new scenario** button.

### Step 2: Choose the services you want to integrate

In the search field, type G*rowsurf* and select **GrowSurf**. Then clear out the search field. Type *Google Sheets* and select **Google Sheets**.

Your screen should now look like this:

![](/files/-MH8C9IbwX9FSD0P68do)

Click the top-right **Continue** button to continue.

### Step 3: Set up the trigger

Click the **GrowSurf** module icon. Your screen should now look like this:

![](/files/-MH8EHpcp-v1txTpElqa)

Select the **Watch New Participant Reward** option. Your screen should now look like this:

![](/files/-MH8GfLCH9OrMS4gNPiY)

Click the **Add** button. Then in the new popup element, click the **Add** button. Your screen should now look like this:

![](/files/-MH8HG7GCJerDb36M1sg)

Then go to <https://growsurf.com/settings#api-keys> to grab your GrowSurf API key.

Return to Make and paste the API key value into the **API Key** input field. Once pasted, click the **Continue**, **Save**, and **OK** buttons, respectively.

You've now successfully set up the Make scenario to trigger on a new GrowSurf participant reward. Now it's time to create the action of adding a new Google Sheet row.

### Step 3.5: Set up a filter

Before moving on, it's important to know if you need to use an Make filter. See the two questions below, and please follow the instructions if you answer 'yes'. Otherwise, if you answer 'no' to both these questions, you can skip this step entirely, and move onto [*Step 4: Set up the action(s)*](#step-4-set-up-the-action-s).

#### **Question 1: Is there are least one double-sided reward for your campaign?**

If you have at least one double-sided reward, then you will need to create two actions because two Make trigger events will happen for both referrer and referee. Here's how you can discern between the two by using a filter and the `Reward: Is Referrer` property:

* **Step A:** Within Make, click the wrench icon to add a filter ([see screenshot](https://gblobscdn.gitbook.com/assets%2F-LeklWo0yn03AhWro2Ux%2F-MH8Z1fu3ZWvt1XsZKlX%2F-MH8ZdlSzjr8mMUO_LhK%2FScreen%20Shot%202020-09-13%20at%205.25.02%20PM.png))
* **Step B:** Add a descriptive label (e.g, "*Is this reward for the referrer?")*
* **Step C:** Set the *Condition* field to `Reward: Is Referrer`
* **Step D:** Set the `Equal to` field to `true` or `false`, depending on what you are trying to achieve. Referrers will have `Reward Is Referrer` as `true` ([see screenshot](https://gblobscdn.gitbook.com/assets%2F-LeklWo0yn03AhWro2Ux%2F-MH8ZfJBQryyc7657mEO%2F-MH8aIeEUYvMRwfQuyhv%2FScreen%20Shot%202020-09-13%20at%205.32.26%20PM.png))
* **Step E:** Click **OK** and save your changes

**Question 2: Is manual reward approval enabled for your campaign?**

If you have manual reward approval enabled, then two trigger events will happen: (1) when the reward is pending approval and (2) when the reward is approve&#x64;**.** Here's how you can discern between unapproved/approved rewards, by using a Make filter and the `Reward: Approved` property.

* **Step A:** Within Make, click the wrench icon to add a filter ([see screenshot](https://gblobscdn.gitbook.com/assets%2F-LeklWo0yn03AhWro2Ux%2F-MH8Z1fu3ZWvt1XsZKlX%2F-MH8ZdlSzjr8mMUO_LhK%2FScreen%20Shot%202020-09-13%20at%205.25.02%20PM.png))
* **Step B:** Add a descriptive label (e.g, "*Is this reward already approved?")*
* **Step C:** Set the *Condition* field to `Reward: Approved`
* **Step D:** Set the last field to `true` or `false`, depending on what you are trying to achieve. Approved rewards will have `Reward: Approved` as `true` ([see screenshot](https://gblobscdn.gitbook.com/assets%2F-LeklWo0yn03AhWro2Ux%2F-MH8ZfJBQryyc7657mEO%2F-MH8e11xDQ94iFROxron%2FScreen%20Shot%202020-09-13%20at%205.40.51%20PM.png))
* **Step E:** Click **OK** and save your changes

### Step 4: Set up the action(s)

Click the **Add another module** button that appears when you hover over the right-side of the GrowSurf module. Your screen should now look like this:

![](/files/-MH8KOm9nXES2Kt_YROC)

Click the **Google Sheets** module, then select the **Add a Row** action. Your screen should now look like this:

![](/files/-MH8KrRFlurJxTNwvJqe)

In the new popup element, click the **Add** button. Your screen should now look like this:

![](/files/-MH8L3tAO4YVwVhWQLeB)

Click the **Continue** button and authenticate with Google. Once you are authenticated, your screen should look like this:

![](/files/-MH8LXOfA4YIYkTz7pLo)

Then choose the *Spreadsheet* and *Sheet*, respectively. Once those values have been selected, set the*Values* per each column that you want to sync GrowSurf participant reward data with.

You've now successfully set up the Make action. Make sure to click the *Save* icon to save your changes.

{% hint style="info" %}
**Need multiple actions?**

You can add additional modules to create multiple action steps in your Make scenario. For example, with the above scenario you add a new row to a Google Sheet. You could chain an additional action, like 'get a notification in Slack', within the same scenario.
{% endhint %}

### Step 5: Add the Make webhook to your GrowSurf campaign

Open up the GrowSurf module within Make. Your screen should now look like this:

![](/files/-MH8T4O1g8zWwJbb48Z6)

Copy the Make webhook URL to your clipboard, then open up your GrowSurf campaign in *Campaign Editor > 4. Options > Integrations,* open the *Webhooks* integration card, then paste the webhook URL into the input field. Save your campaign changes.

In the *Webhooks* integration card, click the **Test** button, then in the new popup window select *New Participant Reward* for the *Webhook Event.* Keep the GrowSurf campaign editor open (we will return to this in a moment).

#### Test and Publish the Make scenario

To make sure that the scenario is working as intended, return to Make and click the bottom-left **Run Once** button. Then return to the GrowSurf campaign editor and click the **Send** button to send webhook test data. Make should successfully accept the test data, and you should see a new Google Sheet row added.

Activate the Make scenario by clicking the bottom-left *Scheduling* toggle. When the popup element appears, keep *Immediately* selected for the **Run scenario** dropdown field value, then click **Activate**.

Your Make scenario is now live and will add a new Google Sheet row whenever a GrowSurf participant reaches a referral goal and unlocks a reward.

## Example 2: New Participant

In this example, we'll connect GrowSurf to HubSpot. Whenever a new participant is added to your GrowSurf referral campaign, we'll add/update them as a HubSpot contact.

### [Step 1: Get access to GrowSurf on Make](/integrations/integromat#getting-started)

Click on the link above to view how to get access to GrowSurf on Make.

Once logged into Make, click the clear **Create a new scenario** button.

### Step 2: Choose the services you want to integrate

In the search field, type G*rowsurf* and select **GrowSurf**. Then clear out the search field. Type *HubSpot CRM* and select **HubSpot CRM**.

Your screen should now look like this:

![](/files/-MH8f-cA9KyvRWcIbHdM)

Click the top-right **Continue** button to continue.

### Step 3: Set up the trigger

Click the **GrowSurf** module icon. Your screen should now look like this:

![](/files/-MH8EHpcp-v1txTpElqa)

Select the **Watch New Participant** option. Your screen should now look like this:

![](/files/-MH8fTKvyXeYXythAcJA)

Click the **Add** button. Then in the new popup element, click the **Add** button. Your screen should now look like this:

![](/files/-MH8gH0oOL07PoBIO7b_)

Then go to <https://growsurf.com/settings#api-keys> to grab your GrowSurf API key.

Return to Make and paste the API key value into the **API Key** input field. Once pasted, click the **Continue**, **Save**, and **OK** buttons, respectively.

You've now successfully set up the Make scenario to trigger on a new GrowSurf participant. Now it's time to create the action of adding/updating the new GrowSurf participant.

### Step 4: Set up the action(s)

Click the **Add another module** button that appears when you hover over the right-side of the GrowSurf module. Your screen should now look like this:

![](/files/-MH8hAmynFWgnTXE1J5W)

Click the **HubSpot CRM** module, then select the **Create/Update a Contact** action. Your screen should now look like this:

![](/files/-MH8hPXho6PFxXMoU1pF)

In the new popup element, click the **Add** button. Your screen should now look like this:

![](/files/-MH8hWhZ5nd8ge_ZD2Ua)

Click the **Continue** button and authenticate with HubSpot. Once you are authenticated, your screen should look like this:

![](/files/-MH8iBdGH_owZecNJylP)

Set contact property fields that you want to sync GrowSurf participant data with.

You've now successfully set up the Make action. Make sure to click the *Save* icon to save your changes.

{% hint style="info" %}
**Need multiple actions?**

You can add additional modules to create multiple action steps in your Make scenario. For example, with the above scenario you added/updated a HubSpot contact. You could chain an additional action, like 'get a notification in Slack', within the same scenario.
{% endhint %}

### Step 5: Add the Make webhook to your GrowSurf campaign

Open up the GrowSurf module within Make. Your screen should now look like this:

![](/files/-MH8imqcW9jUpT7rZEtp)

Copy the Make webhook URL to your clipboard, then open up your GrowSurf campaign in *Campaign Editor > 4. Options > Integrations,* open the *Webhooks* integration card, then paste the webhook URL into the input field. Save your campaign changes.

In the *Webhooks* integration card, click the **Test** button, then in the new popup window select *New Participant* for the *Webhook Event.* Keep the GrowSurf campaign editor open (we will return to this in a moment).

#### Test and Publish the Make scenario

To make sure that the scenario is working as intended, return to Make and click the bottom-left **Run Once** button. Then return to the GrowSurf campaign editor and click the **Send** button to send webhook test data. Make should successfully accept the test data, and you should see the HubSpot contact updated or added.

Activate the Make scenario by clicking the bottom-left *Scheduling* toggle. When the popup element appears, keep *Immediately* selected for the **Run scenario** dropdown field value, then click **Activate**.

Your Make scenario is now live and will create/update new HubSpot contacts whenever a new GrowSurf participant is added.

## Example 3: Campaign Ended

In this example, we'll email the results of the referral campaign to your company CEO when the GrowSurf campaign ends.

### [Step 1: Get access to GrowSurf on Make](/integrations/integromat#getting-started)

Click on the link above to view how to get access to GrowSurf on Make.

Once logged into Make, click the clear **Create a new scenario** button.

### Step 2: Choose the services you want to integrate

In the search field, type *Email* and select **Email**. Then clear out the search field. Type *GrowSurf* and select **GrowSurf**.

Your screen should now look like this:

![](/files/-MH9Nob9oN3k6VUR1DwB)

Click the top-right **Continue** button to continue.

### Step 3: Set up the trigger

Click the **GrowSurf** module icon. Your screen should now look like this:

![](/files/-MH9NvgU1l8MurJgJpi_)

Select the **Watch Campaign Ended** option. Your screen should now look like this:

![](/files/-MH8fTKvyXeYXythAcJA)

Click the **Add** button. Then in the new popup element, click the **Add** button. Your screen should now look like this:

![](/files/-MH9O5S96Sbmn3skdr79)

Then go to <https://growsurf.com/settings#api-keys> to grab your GrowSurf API key.

Return to Make and paste the API key value into the **API Key** input field. Once pasted, click the **Continue**, **Save**, and **OK** buttons, respectively.

You've now successfully set up the Make scenario to trigger when your GrowSurf campaign ends. Now it's time to create the action of sending out an email.

### Step 4: Set up the action(s)

Click the **Add another module** button that appears when you hover over the right-side of the GrowSurf module. Your screen should now look like this:

![](/files/-MH9OZz1Vqt7ya4qzi7t)

Click the **Email** module, then select the **Send an Email** action. Your screen should now look like this:

![](/files/-MH9OheEr-_Gsx_AwlFR)

In the new popup element, next to the *Connection* dropdown input field, click the **Add** button. Then, select *Google Restricted* for the *Connection type*. Your screen should now look like this:

![](/files/-MH9PChfZRHoSbF7hBEg)

Click the **Continue** button and authenticate with Google. Once you are authenticated, your screen should look like this:

![](/files/-MH9PSCawTMJ1I6oCSDm)

Set the *To, Subject,* and *Content* fields for the email, then click the **OK** button.

You've now successfully set up the Make action. Make sure to click the *Save* icon to save your changes.

{% hint style="info" %}
**Need multiple actions?**

You can add additional modules to create multiple action steps in your Make scenario. For example, with the above scenario you sent an email. You could chain an additional action, like 'get a notification in Slack', within the same scenario.
{% endhint %}

### Step 5: Add the Make webhook to your GrowSurf campaign

Open up the GrowSurf module within Make. Your screen should now look like this:

![](/files/-MH9PqPF6M9xq7_4De4e)

Copy the Make webhook URL to your clipboard, then open up your GrowSurf campaign in *Campaign Editor > 4. Options > Integrations,* open the *Webhooks* integration card, then paste the webhook URL into the input field. Save your campaign changes.

In the *Webhooks* integration card, click the **Test** button, then in the new popup window select *Campaign Ended* for the *Webhook Event.* Keep the GrowSurf campaign editor open (we will return to this in a moment).

#### Test and Publish the Make scenario

To make sure that the scenario is working as intended, return to Make and click the bottom-left **Run Once** button. Then return to the GrowSurf campaign editor and click the **Send** button to send webhook test data. Make should successfully accept the test data, and you should see the HubSpot contact updated or added.

Activate the Make scenario by clicking the bottom-left *Scheduling* toggle. When the popup element appears, keep *Immediately* selected for the **Run scenario** dropdown field value, then click **Activate**.

Your Make scenario is now live and will send out an email report when your GrowSurf campaign ends.

## Example 4: Trigger Referral

In this example, we'll call the GrowSurf REST API to trigger a referral when there is a new charge in Stripe.

### [Step 1: Get access to GrowSurf on Make](/integrations/integromat#getting-started)

Click on the link above to view how to get access to GrowSurf on Make.

Once logged into Make, click the clear **Create a new scenario** button.

### Step 2: Choose the services you want to integrate

In the search field, type G*rowsurf* and select **GrowSurf**. Then clear out the search field. Type *Stripe* and select **Stripe**.

Your screen should now look like this:

![](/files/-MHhGp4puEy0-gk0w2XB)

Click the top-right **Continue** button to continue.

### Step 3: Set up the trigger

Click the **Stripe** module icon. Your screen should now look like this:

![](/files/-MHhH6jalG-aiZ86LRqj)

Select the **Watch Events** option. Your screen should now look like this:

![](/files/-MHhHCUsZfQvvwCcpULk)

Click the **Add** button. Then in the new popup element, click the **Add** button. Your screen should now look like this:

![](/files/-MHhHSJ61etEMZMfqJ03)

Then go to <https://dashboard.stripe.com/apikeys> and follow the instructions below to create and grab your Stripe API key:

* **Step A:** Click the 'Create Secret Key' button
* **Step B**: For *Key name*, enter `Make (for triggering GrowSurf referral)` and click the *Create* button
* **Step E:** Copy the new API key to your clipboard

Return to Make and paste the API key value into the **API Key** input field. Once pasted, click **Continue**.

Then for **Group**, choose **Charge** from the dropdown. From the *Events* list, check the box **Charge succeeded**. Your screen should now look like this:

![](/files/-MHhKYMfINlB9nvgQKy6)

Click the **Save** and **OK** buttons, respectively.

You've now successfully set up the Make scenario to trigger on a new Stripe charge. Now it's time to create the action of triggering a referral using the GrowSurf REST API.

### Step 4: Set up the action(s)

Click the **Add another module** button that appears when you hover over the right-side of the Stripe module. Your screen should now look like this:

![](/files/-MHhMXM5GufqsXC2XMgI)

Click the **GrowSurf** module, then select the **Make an API Call** action.

At **Connection**, click the **Add** button. Then go to <https://growsurf.com/settings#api-keys> to grab your GrowSurf API key and paste it into the **API Key** field in the new popup element.

Your screen should now look like this:

![](/files/-MHhMgFkqyeJt06AidxG)

We will be calling the GrowSurf API endpoint [*/POST Trigger Referral*](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant-participantidoremail-ref).

* For the **URL** field, enter `/v2/campaign/:id/participant/:participantEmail/ref` and replace the following values in the URL:
  * Replace `:id` with your campaign ID (e.g, `p9sqjo`)
  * Replace `:participantEmail` with the *Stripe > Object > Receipt Email* variable
* For the **Method**, select `POST` from the dropdown menu.
* For the **Headers**, delete the default `Content-Type: application/json` header item

Your screen should now look something like this:

![](/files/-MHqENU_okzRJqOi7fPL)

You've now successfully set up the Make action. Make sure to click the *Save* icon to save your changes.

#### Test and Publish the Make scenario

To make sure that the scenario is working as intended, return to Make and click the bottom-left **Run Once** button. Then return to Stripe and create a new charge so that webhook test data is sent. Make should successfully accept the test data, and you should see the GrowSurf API called.

Activate the Make scenario by clicking the bottom-left *Scheduling* toggle. When the popup element appears, keep *Immediately* selected for the **Run scenario** dropdown field value, then click **Activate**.

Your Make scenario is now live and will call the GrowSurf REST API to trigger a referral anytime you get a new charge in Stripe.


# Marketo

Update/Add Marketo people with their unique share link and referrer information.

## Sync with Marketo

<details>

<summary>Before you can connect GrowSurf to Marketo, you will first need to create a new Custom Service for your Marketo account. Click here to view step-by-step instructions.</summary>

Open up your Marketo account, then navigate to *Admin > Security > Users & Roles > Roles > Create New Role*. Then enter in the following information (reference the screenshot below):

* **Role Name**: GrowSurf
* **Description**: API Role specifically made for the GrowSurf Marketo integration.
* **Permissions**: Access API (35 of 35)

<img src="/files/GcKUSvLQB2dkkPJBgKap" alt="" data-size="original">

Then navigate to *Admin > Security > Users & Roles > Users > Invite New User*. Then enter in the following information (reference the screenshot below):

* **Email**: `growsurf@yourcompany.com` (this can be replaced with any email address of your choosing)
* **First Name**: GrowSurf
* **Last Name**: Integration
* **Reason:** The Marketo user that will be used for the GrowSurf Marketo integration

![](/files/YBZVdno3SuUItAdAOYGE)

Then click the Next button. In *Step 2: Permissions*, set the following fields (reference the screenshot below):

* **Roles:** GrowSurf
* **API Only**: Enable this checkbox

![](/files/TRQvfj1EsFjT0kOeCymG)

Then click the Next button. In *Step 3: Message*, click the Send button (reference the screenshot below).

![](/files/20OeqAjJ54VtpKpUcQs1)

Once you've added the new user, it's time to set up the custom service. Navigate to *Admin > Integration > LaunchPoint > New Service.* Then enter in the following information (reference the screenshot below):

* **Display Name**: GrowSurf
* **Service**: Custom
* **Description**: Service for the GrowSurf Marketo integration
* **API Only User**: `growsurf@yourcompany.com` (this should be the user that you set from the previous steps)

![](/files/RIZrSWJGhZZLlqMs0f1K)

Then click Create. Your service should now be available to view -- click on GrowSurf and write down the *Client ID* and *Client Secret* for later (you will need to enter this information into GrowSurf later). Reference the screenshot below:

![](/files/WpiVLNlVHx90sRIVCyHN)

Lastly, navigate to *Admin > Integration > Web Services.* Scroll to the REST API section and write down both URLs for *Endpoint* and *Identity* (you will need to enter this information into GrowSurf later). Reference the screenshot below:

![](/files/y5tRnmiOilopC0DTTjys)

**Need help?**

If you run into any issues during this setup phase, please see Marketo's Custom Services documentation [here](https://developers.marketo.com/rest-api/custom-services/) or reach out to GrowSurf support for assistance [here](https://app.growsurf.com/settings#contact_support).

</details>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Marketo integration card and enter your [client ID and client secret](https://developers.marketo.com/rest-api/authentication/). Next, enter the [REST API Endpoint URL and Identity URL](https://developers.marketo.com/rest-api/base-url/).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Marketo only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Marketo.
{% endhint %}

![](/files/-MgwL7y53I7yi2c--5J8)

**Step 2:** Once connected, GrowSurf will add/update your Marketo people every time a new participant is added or referred to your referral campaign.

**Step 3:** You should now see a screen that looks like the one below:

![](/files/-Mh-uW2auBzziMTUVcAr)

## Examples

[View our Marketo tutorials](https://docs.growsurf.com/additional-integrations/marketo/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Fields**

GrowSurf will automatically create these new custom fields for your Marketo people.<br>

| **Field Name**                               | **Data Token**                                      | **Field Type** | **Description**                                                                                                                                                                                           | **Example**                                                |
| -------------------------------------------- | --------------------------------------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                       | `{{lead.GrowSurf Share URL}}`                       | Email          | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**                  | `{{lead.GrowSurf Participant ID}}`                  | String         | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**                 | `{{lead.GrowSurf Referral Status}}`                 | String         | The referral status of the participant\*                                                                                                                                                                  | `CREDIT_PENDING`                                           |
| **GrowSurf Participant First Name**          | `{{lead.GrowSurf First Name}}`                      | String         | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**           | `{{lead.GrowSurf Participant Last Name}}`           | String         | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**             | `{{lead.GrowSurf Referrer First Name}}`             | String         | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**              | `{{lead.GrowSurf Referrer Last Name}}`              | String         | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**                  | `{{lead.GrowSurf Referrer Email}}`                  | Email          | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**            | `{{lead.GrowSurf Total Referral Count}}`            | Integer        | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**          | `{{lead.GrowSurf Monthly Referral Count}}`          | Integer        | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Previous Monthly Referral Count** | `{{lead.GrowSurf Previous Monthly Referral Count}}` | Integer        | The participant's previous month referral count                                                                                                                                                           | 200                                                        |
| **GrowSurf Next Milestone**                  | `{{lead.GrowSurf Next Milestone}}`                  | String         | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**          | `{{lead.GrowSurf Next Monthly Milestone}}`          | String         | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. S[ee an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**              | `{{lead.GrowSurf Total Invite Count}}`              | Integer        | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**          | `{{lead.GrowSurf Total Impression Count}}`          | Integer        | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these merge tags in your Marketo email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `{{lead.GrowSurf Share URL}}`in your emails to provoke your people to make referrals!

[Learn more about how to personalize Marketo emails here.](https://docs.marketo.com/display/public/DOCS/Personalize+an+Email)

## **Troubleshooting Tips**

* **If the new participant isn't being added to Marketo, or if they are being added but their unique referral link isn't being synced to Marketo:**
  * Activity logs will denote if a participant was added to Marketo or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
  * It is possible there could be an issue with your Marketo permissions when the new Marketo Custom Service was created with the *API Role*. Please disconnect the Marketo integration within GrowSurf, and follow the steps outlined in the *Important* section at the beginning of [this page](https://docs.growsurf.com/integrations/marketo#sync-with-marketo) to reconnect.


# Tutorials

We'll walk you through adding personalized referral program messaging to your Marketo emails.

When you connect your GrowSurf campaign to Marketo, you can easily embed a referral program into your Marketo emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Marketo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
         <a href="{{lead.GrowSurf Share URL}}" style="color: #1673df; text-decoration: none;">{{lead.GrowSurf Share URL}}</a>
      </p>
      <div> 
        <a href="mailto:?body={{lead.GrowSurf Share URL}}20Share%20URL%7D%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
        <a href="https://www.facebook.com/sharer/sharer.php?u={{lead.GrowSurf Share URL}}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
        <a href="https://twitter.com/intent/tweet?url={{lead.GrowSurf Share URL}}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{{lead.GrowSurf Share URL}}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{lead.GrowSurf Share URL}}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Marketo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Marketo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Marketo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Marketo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="{{lead.GrowSurf Share URL}}" style="color: #4f46e5; text-decoration: none;">{{lead.GrowSurf Share URL}}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;">
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Marketo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
     <div style="padding: 20px;"> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
     <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="[[data:grsf_share_url]]" style="color: #ffffff;">[[data:grsf_share_url]]</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={{lead.GrowSurf Share URL}}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={{lead.GrowSurf Share URL}}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={{lead.GrowSurf Share URL}}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={{lead.GrowSurf Share URL}}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={{lead.GrowSurf Share URL}}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{{lead.GrowSurf Share URL}}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{{lead.GrowSurf Share URL}}` only to the encoded messag

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Marketo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
     <td> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
     </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Marketo email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;"> 
     <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
    </td>
  </tr>
  </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Marketo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Get your swag
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{{lead.GrowSurf Share URL}}" style="color: #8E4CED;">{{lead.GrowSurf Share URL}}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {{lead.GrowSurf Total Referral Count}} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="color: #8E4CED;">Check your status here</a>. {{lead.GrowSurf Next Milestone}}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{{lead.GrowSurf Next Milestone}}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Marketo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {{lead.GrowSurf Total referral Count}} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  💯 Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  <a href="{{lead.GrowSurf Share URL}}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{{lead.GrowSurf Share URL}}</a>
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{{lead.GrowSurf Next Milestone}}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 36, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{{lead.GRSF Total Referral Count}}`. In this example, you would display any one of these five images at a given time:\*
   1. If `{{lead.GrowSurf Total Referral Count}}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{{lead.GrowSurf Total Referral Count}}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{{lead.GrowSurf Total Referral Count}}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{{lead.GrowSurf Total Referral Count}}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{{lead.GrowDSurf Total Referral Count}}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{{lead.Growsurf Next Milestone}}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).*.*

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Marketo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{{lead.GrowSurf Share URL}}" style="color: #8E4CED;">{{lead.GrowSurf Share URL}}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif) with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Marketo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{{lead.GrowSurf Share URL}}" style="color: #F46A54;">{{lead.GrowSurf Share URL}}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={{lead.Email Address}}&grsf_first_name={{lead.First Name}}&grsf_last_name={{lead.Last Name}}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Marketo email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{{lead.GrowSurf Share URL}}" style="color: #F46A54;">{{lead.GrowSurf Share URL}}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Meta (Facebook) Ads

Retarget referred visitors and track referral events in Meta (Facebook) Ads to optimize your ad campaigns.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

The Meta Ads integration lets you retarget website visitors who arrive through referral links and track their conversions. Once connected, Meta Ads will track these referred visitors and conversions when they submit their email addresses on your website.

{% hint style="success" %}
Under the hood, GrowSurf loads the Meta Ads library (Facebook script) for event tracking. If Meta Ads is already installed, GrowSurf intelligently avoids loading it twice.
{% endhint %}

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Meta Ads integration card and enter your [Meta Ads pixel ID](https://www.facebook.com/business/help/171689010314963).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Meta Ads (as a Facebook pixel) installed on your website, you do not need to enter in the Meta Ads pixel ID. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Meta Ads installed.
{% endhint %}

<figure><img src="/files/IAOE8kBAxrA5wOQhQ9eS" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Make sure that your campaign Share URL (found in the *Campaign Editor > 5. Installation* step) is a part of your Meta Ads account. If you are using multiple domains, within Meta Ads manager, you may need to enable **Automatic Advanced Matching** and set up **Domain Verification** to avoid issues with shared traffic between domains.
{% endhint %}

**Step 3:** In your Meta Ads account, you will need to add the following two custom conversions (You can skip this step if you have both "Track conversion event" checkboxes toggled off). Follow the instructions in [How to Add Custom Conversions In Meta Ads](#how-to-add-custom-conversions-in-meta-a-ds).

* `growsurf_referral_signup` - This conversion event represents when a referred visitor submits their email address on the form on your website that has referral tracking on it.
* `growsurf_referral_trigger` - This conversion event represents when a participant completes a qualifying action, like making a purchase (Note: this only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral)from the front-end).

***

## How to Add Custom Conversions In Meta Ads

<details>

<summary>Open instructions</summary>

You'll need to complete steps 1-11 below for each event `growsurf_referral_signup` and `growsurf_referral_trigger`.

1. Log into your [Meta Ads Manager account](https://adsmanager.facebook.com/adsmanager).
2. From the left-side menu, navigate to *All tools > Advertise > Events Manager* (see image below)*.*

   <figure><img src="/files/rseA8sfO0gljTJ73rdGA" alt=""><figcaption></figcaption></figure>
3. Choose the pixel ID that you entered for the Meta Ads integration within GrowSurf (see image below).

   <figure><img src="/files/npHVqXRi0QxJsqqhlW43" alt=""><figcaption></figcaption></figure>
4. You should now be seeing a page called "Data Sources". Click the top-right *Create* button and choose "Create custom conversion" from the dropdown (see image below).

   <figure><img src="/files/wb5Bn3vqCQ629K2vfuvM" alt=""><figcaption></figcaption></figure>
5. You should be seeing a popup window with the title "Create a custom conversion". For the Name field, enter enter the following conversion name depending on which conversion event you're adding:
   1. `growsurf_referral_signup`
   2. `growsurf_referral_trigger`
6. For the Data source field, make sure to keep the same pixel ID you chose from step 1 selected.
7. For the Action Source field, keep "Website" selected.
8. For the Event field, choose one of the following:
   1. For `growsurf_referral_signup`, we recommend using "Lead" (or choose a different category that best represents a referred visitor signing up).
   2. For `growsurf_referral_trigger`, we recommend using "Add payment info" (or choose a different category that best represents when a referred participant completes a qualifying action, which triggers a referral).
9. In the first Rules dropdown, select "Event Parameters". Then in the second Rules field, type in `source`. For the third Rules field, select "equals". Then in the fourth Rules field, enter `growsurf`. Your screen should now look like the image below:

   <figure><img src="/files/W6onaRm6hkgXh9iiIWfz" alt=""><figcaption></figcaption></figure>
10. For the other fields like Description and Conversion value, you can adjust to your preferences.
11. Click the *Create* button.
12. Make sure that you repeat steps 1-11 above for `growsurf_referral_trigger` as well.

</details>

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If Meta Ads events are NOT occurring, but you were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Meta Ads.
* Make sure your campaign Share URL (and the page where the referral submits their email address, if you are tracking conversions) is a part of your Meta Ads account. You can find the campaign Share URL in the *Campaign Editor > 5. Installation* step. In your Meta Ads account, you may need to enable **Automatic Advanced Matching** and set up **Domain Verification** to avoid issues with shared traffic between domains.
* If you are testing conversions being tracked, make sure that you've allowed up to 30 minutes for Meta Ads to process the events.
* To troubleshoot if the Meta (Facebook) ads script is loading on your website, you'll want to make sure you that you visit a participant's referral link first.

#### If Meta Ad events are occurring, but you were NOT expecting them:

* If you want to prevent Meta Ads from being loaded completely, you must disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you see Meta Ads network requests being made on your website and you have the integration completely disabled, GrowSurf may not be emitting these events. Check other parts of your code to find where these events might be happening.


# Mixpanel

Track and analyze referral program data alongside product analytics in Mixpanel.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

After connecting, the Mixpanel integration transmits data to your Mixpanel account, enabling analysis and reporting on your referral program.

For referrers, when they are added to your campaign (e.g., they get a referral link generated) or if they click a social share button (like Facebook or LinkedIn), GrowSurf sends a Mixpanel event. For referred friends, if they sign up using your Share URL, GrowSurf also sends an event.

{% hint style="success" %}
Under the hood, GrowSurf will load the Mixpanel JavaScript library, identify participants (both referrers and referred friends) by their email address, and track events. Rest assured, if Mixpanel is already installed, GrowSurf ensures the library is not loaded twice and prevents duplicate identity calls.
{% endhint %}

## Tracked Events

The following events will be emitted with the `growsurf_` prefix.

| Event                       | Description                            | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `growsurf_referral`         | \[Referred friend] New referral signup | <p>Records when a referred visitor signs up through a referral link.<br><br>This includes:</p><ul><li>Those who submit the form on your website that has referral tracking enabled (via the campaign editor)</li><li>Adding a referred participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul>                                                                                                                                                                                                                                                        |
| `growsurf_referral_trigger` | \[Referred friend] Referral triggered  | Records when a referred participant completes the desired qualifying action, which triggers a referral. Only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral).                                                                                                                                                                                                                                                                                                                                                                                                    |
| `growsurf_signup`           | \[Referrer] New referrer signup        | <p>Records when someone generates a referral link and joins the campaign as a participant.</p><p>This includes:</p><ul><li>Direct signups (someone entering in their email address on the GrowSurf form)</li><li>Passing in an email address via URL parameter <code>?grsf\_email</code></li><li>Passing in an email address via <code>data-grsf-email</code> attribute on an <a href="https://docs.growsurf.com/developer-tools/embeddable-elements">Embeddable Element</a></li><li>Adding a participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul> |
| `growsurf_share`            | \[Referred] Social media share         | Records when a referrer shares their link by clicking 'Copy Link' or clicking a social media button                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `growsurf_invite`           | \[Referrer] Email invite(s) sent       | Records when a referrer sends invitation(s) via email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Example Events

Events correspond with the events listed in the [`growsurf.subscribe()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) method. To see examples of the raw `JSON` data, please see the [*Example Response*](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) section.

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Mixpanel integration card and enter your [Mixpanel project token](https://developer.mixpanel.com/reference/project-token#managing-a-projects-token).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Mixpanel installed on your website, you do not need to enter in the Mixpanel project token. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Mixpanel installed.
{% endhint %}

<figure><img src="/files/cVzydsmj0s3D3j9M6Bwa" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Within your Mixpanel account, make sure to whitelist the URLs where these events occur. These are primarily two locations: your referral portal (which might be part of your user portal or web app, or the [GrowSurf-hosted referral portal](https://support.growsurf.com/article/196-where-can-i-find-my-campaigns-dedicated-landing-page)) and the referred friend's landing page (the Share URL you enter in the *Campaign Editor > 5. Installation* step).
{% endhint %}

Once GrowSurf events get emitted, you will see them show up in Mixpanel *> Events* (see image below).

<figure><img src="/files/Q0n4seCiW6tgu2415PZv" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Please allow up to 15 minutes of processing time for events to appear (in some cases where Mixpanel is backed up, it can take longer).
{% endhint %}

Within Mixpanel, if you click on a user, you'll be able to view specific details about the event.

<figure><img src="/files/gzwJ0v1aMYiC1M36Y7Fa" alt=""><figcaption></figcaption></figure>

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If you are seeing a wrongly identified user:

There are 5 different ways that GrowSurf participants can be added to your campaign. Please make sure that the GrowSurf participant email address that you are passing in matches the one you were expecting for the Mixpanel user:

* If you pass in a `data-grsf-email` attribute to a [GrowSurf embeddable element](https://docs.growsurf.com/developer-tools/embeddable-elements)
* If you pass in an email address via URL parameter `?grsf_email`
* If you are using [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant)
* If you enter an email address via the GrowSurf form
* If you are a referred friend and you submit the form that has referral tracking configured on it from the *Campaign Editor > 5. Installation* step

#### If you are not receiving events, but were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Mixpanel.
* Make sure to whitelist the URL where events are being tracked (e.g, if your referrer clicks the Facebook share button from *<https://app.yoursite.com/refer>*, you'll want to make sure you whitelist that root domain. If a referred friend signs up on your Share URL, make sure to whitelist the Share URL as well).
* If you just submitted an event, make sure that you've allowed up to 15 minutes for Mixpanel to process the event.

#### If you are receiving events, but were NOT expecting them:

* To ensure no non-GrowSurf-related events are sent to your Mixpanel account, disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you're receiving events without a GrowSurf-related suffix (e.g., `growsurf_`), it indicates that GrowSurf may not be emitting these events. Please check other parts of your code to find where these events might be occurring.


# Pabbly Connect

Pabbly Connect is a code-free tool that lets you connect to 650+ apps to automate rewards or sync data.

## Example scenarios

Pabbly Connect lets you perform an action when a certain GrowSurf event occurs -- all without having to write any code. Here are a few scenarios in which you would use Pabbly Connect:

* **New Participant:** WHEN a new participant is added to your GrowSurf campaign, THEN add/update them in your email service provider (e.g, *Mailchimp, InfusionSoft, ConvertKit, HubSpot*).
* **New Participant Reward:** WHEN a participant reaches a referral goal and thus unlocks a reward, THEN automatically send the participant a coupon code via *Coupon Carrier.*
* **Campaign Ended:** WHEN your GrowSurf campaign ends, THEN email the results of the referral program to your company CEO (total number of impressions, referrals, etc).

## Getting started

![](/files/-MUA7MI1Yi3wpcEdXP6O)

1. First, [click here to log in to Pabbly](https://accounts.pabbly.com/login).
2. Then sign in to your Pabbly account, or create a Pabbly account if you don't already have one.
3. Once logged in, scroll down to **Connect** and click **Access Now** to connect 500+ apps. You'll then be taken to your dashboard, click **Create Workflow**, and set up your Pabbly trigger.

{% hint style="info" %}
**Note:** Pabbly Connect's free plan provides you with 100 free tasks/operations per month. For more, you will need to upgrade your Pabbly plan.
{% endhint %}

## Next steps

View our [Tutorials](https://docs.growsurf.com/automate-rewards/pabbly-connect/tutorials) to see an example of how to integrate Pabbly Connect.

* [New Participant Added](https://docs.growsurf.com/automate-rewards/pabbly-connect/tutorials)


# Tutorials

We'll walk you through creating Pabbly Connect workflows.

## Example 1: New Participant Added

In this example, we'll connect GrowSurf to Slack. Whenever a new participant is added to your GrowSurf referral campaign, we'll send a message in Slack.

### [Step 1: Log in to Pabbly Connect](https://www.pabbly.com/connect/)

Click on the link above to get access to Pabbly Connect.

Your screen should now look like this:

![](/files/-MUD3bzadstKReKu3_5h)

Once logged into Pabbly Connect, navigate to **Connect** and click the **Access Now** button.

### Step 2: Click on the Create Workflow button

![](/files/-MUD6Q_WTVb5Aoj72y-D)

In the **Name** field, type the name of your workflow, then click **Create**.

Your screen should now look like this:

![](/files/-MUD6txpPNpdJGkT25JW)

### Step 3: Set up the trigger for GrowSurf to Slack Integration

In the field **Choose App**, type G*rowsurf* and select **GrowSurf** from the dropdown menu. Then in the field **Trigger Event**, select **New Participant** from the dropdown menu.

Your screen should now look like this:

![](/files/-MUDsGfLeEGjZuBtfHkB)

### Step 4: **Copy the Webhook URL**

![](/files/-MUEuqIs23p5paNqq1sH)

### Step 5: Connect GrowSurf to Pabbly Connect

Access your GrowSurf account, then click *CAMPAIGN ACTIONS > EDIT CAMPAIGN > 4. OPTIONS > VIEW ALL INTEGRATIONS.*

![](/files/-MUEvbzfK2LBBGjg9XQU)

![](/files/-MUEvzEgFR4dRpTgP_uQ)

Scroll down and click **Webhooks**. In the Webhook URL field, paste the webhook URL, then click **Show advanced webhook settings** and select **New Participant**. Next, click the **SAVE CHANGES** button in the top right corner.

### Step 6: Test Integration

To check if the integration is capturing data or not, go to Workflows in Pabbly Connect and click **Capture Webhook Response.**

![](/files/-MUFB7fYzvpArSAtvhI3)

Your screen should now look like this:

![](/files/-MUFC0sIgSAIJpif7izx)

Next, go to your webhooks integration in GrowSurf and click the **TEST** button, then select **New Participant** for the **Webhook Event** and click the **SEND** button.

Your screen should now look like this:

![](/files/-MUFFC1MCuCnsfANqrNd)

Return to your Pabbly Connect dashboard. If the webhook response was captured, you will see something similar to this:

![](/files/-MUFHUDjcVQW0x7WQnbg)

When you are done examing the information, click the **Save** button.

### **Step 7: Set Action for GrowSurf to Slack Integration**

On the same screen as your webhook response, click the plus button and choose an action.

Your screen should now look like this:

![](/files/-MUFK1U1_kVhDitYjcWk)

Choose the application and **Action Event**

Your screen should now look like this:

![](/files/-MUFLMjSZY8y-e4vFYce)

### **Step 8: Click the Connect With Slack Button**

![](/files/-MUFNTMeSiJmP33qSlbh)

### Step 9: Connect Slack to Pabbly Connect

![](/files/-MUFOHl9hsoC2Zb_ApbL)

To authenticate your Slack account, please click the **Connect with Slack** button and then grant the permission to connect Pabbly Connect and Slack.

![](/files/-MUFS9uOop-xTGQJ3J6I)

In Pabbly Connect, please add the information from your webhook response to the **Message** field. Your **Message** field should look similar to this:

![](/files/-MUFQK-JSGA_HeAFsy8f)

Please note the **Bot Name** can be the same name as your **Channel.**

After you finish adding the required information, please click the **Save & Send Test Request** button.

Your screen should look similar to this:

![](/files/-MUFYgLHIgSpWr-7g17U)

Click the **Save** button to save the workflow.

### Step 10: Check Response in Slack

![](/files/-MUFZcnrtIQkyjpFmGNP)


# PayPal

For referral programs, trigger referrals on new PayPal payments and automatically send one-time payouts as rewards. For affiliate programs, automate recurring payouts to affiliates.

## For Referral Programs <a href="#for-referral-programs" id="for-referral-programs"></a>

### Referral Trigger <a href="#referral-trigger" id="referral-trigger"></a>

#### Description <a href="#description" id="description"></a>

For referral programs, when you connect your PayPal account to your GrowSurf campaign and enable *Referral Trigger*, GrowSurf will automatically detect and trigger referrals on new PayPal charges.

GrowSurf will check if the PayPal customer's email address matches a GrowSurf participant's email address. If a match is found, then a referral will trigger, giving referral credit to the referrer and unlocking any rewards, if applicable.

Here's how to set up PayPal referral triggers:

#### **How to Set Up** <a href="#how-to-set-up" id="how-to-set-up"></a>

{% hint style="warning" %}
**Important Note:** Unless your campaign is configured to add participants automagically ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), you'll need to make sure you first call JavaScript [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant) or REST API [`/POST Add Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant) to add new participant&#x73;**.**
{% endhint %}

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, click the *Connect to PayPal* button

![](/files/JEKaDPMidzHcTAY98UUz)

**Step 2:** Once connected, GrowSurf will have *Referral Trigger* enabled by default.

![](/files/4OgjviwIsvtLjGpvCWGC)

**(Optional) Step 3:** You can add a referral trigger hold period by toggling the *Show advanced settings* section.

{% hint style="info" %}
**Note:** The referral trigger hold period is useful for preventing fraud and helps minimizes losses due to refunds and chargebacks. During this hold period, if there is a refund or chargeback, the referral trigger will be cancelled completely.
{% endhint %}

![](/files/wQr4KVDreBGSitgIdldw)

### Payouts

#### **Description** <a href="#description-1" id="description-1"></a>

When a GrowSurf participant unlocks a reward, send them a one-time PayPal payout. If the participant is being sent a PayPal payout for the first-time, they will receive an email where they can enter their PayPal email address before the payout is released.

#### Fee Disclosures <a href="#how-to-set-up-1" id="how-to-set-up-1"></a>

* The following fees are applied on payouts made through PayPal's API:
  * United States: $0.25 USD per U.S. transaction
  * International: 2% of the recipient payment amount, up to a certain amount
* Individual payments cannot exceed $20,000 USD.
* The recipient (the GrowSurf participants) is charged no payout fee if they receive funds in the same currency as their PayPal account. If the funds arrive in a different currency, PayPal converts them using its exchange rate (which includes a conversion markup), so the recipient may effectively receive less.

#### How to Set Up <a href="#how-to-set-up-1" id="how-to-set-up-1"></a>

To utilize the PayPal payout feature, you'll need the following (full PayPal payout instructions can be found [here](https://developer.paypal.com/docs/payouts/standard/)) prior to set up:

1. A PayPal business account (you can [sign up for a PayPal business account here](https://www.paypal.com/bizsignup/))
2. Get [access to PayPal Payouts](https://www.paypal.com/payoutsweb/landing?_ga=1.173127584.2099703533.1638980894)
3. A confirmed [identity](https://www.paypal.com/policy/flow/verifyCip?_ga=1.118076554.2099703533.1638980894), [email](https://www.paypal.com/myaccount/profile/), and [bank account linked to your PayPal business account](https://www.paypal.com/businessexp/money/addbank)
4. Add sufficient funds to your PayPal business account (make sure to cover enough for payout totals and fees)
5. When you connect to PayPal within GrowSurf, make sure to login with your primary PayPal account holder's credentials. Using a team member's PayPal credentials can result in permission issues when sending out payouts

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to PayPal* button.

{% hint style="info" %}
You must first select a default currency for your GrowSurf campaign in order to use PayPal.
{% endhint %}

![](/files/JEKaDPMidzHcTAY98UUz)

**Step 2:** Once connected, click the *Payouts* tab and connect a reward(s) to PayPal by clicking the *Connect a Reward* button.

{% hint style="info" %}
**Note:** When you connect to PayPal, *Referral Trigger* will be enabled by default. If you are triggering referrals another way, disable the toggle in the *Referral Trigger* tab.
{% endhint %}

![](/files/g13qxhbN0sgTF9bQEdnx)

Enter the details of the payout including the name, payout note (this will appear as a note to the PayPal recipient), and payout type. You can also click *Show advanced payout settings* to view more customization settings.

{% hint style="info" %}
**Advanced feature tip: Issue different reward amounts by using dynamic rewards**

Dynamic rewards let you offer different reward values based on specific attributes of the referred friend (such as the pricing plan they signed up for) or referrer (such as their partner status).

For example, you can award $50 payouts to winners when their referral signs up for your base plan or $100 payouts when they sign up for a higher-costing plan.

[Learn more →](https://support.growsurf.com/article/357-how-to-set-up-dynamic-rewards)
{% endhint %}

![](/files/AIdj1V2HHUKYYiAzx2dm)

Then hit Save. Now, anytime this reward is unlocked by a winning participant, a PayPal payout will also be sent to the PayPal customer associated with the GrowSurf participant email address. If enabled, on their first payout, the participant will receive a confirmation email so they can choose the PayPal email address they want to use.

{% hint style="info" %}
With double-sided rewards, you have full flexibility in choosing who gets the payout reward: (1) just the referrer, (2) just the referred person, (3) or both referrer and referred person.
{% endhint %}

Once you save the reward, you should see a green dot, indicating that the PayPal *Payouts* integration is enabled.

![](/files/917AreubKgI81Rfee67m)

#### Troubleshooting Tips

If there is an issue with PayPal payouts being sent out to winners, GrowSurf will send out a notification email to the GrowSurf campaign owner. The issue will also be stated in the participant's detail page when you view their reward or when you view the participant's activity logs.

Here are some common reasons why there may be failures:

* There may be an issue with your PayPal account. For payouts to work, you must have a verified business PayPal account with access to PayPal payouts and sufficient funds. [View the requirements](https://docs.growsurf.com/integrations/paypal#how-to-set-up-1-1).
  * Make sure that the account you connected to PayPal within GrowSurf is your primary PayPal account holder. Using a team member's PayPal credentials can result in permission issues when sending out payouts.
* If dynamic reward rules are enabled for the PayPal reward, there may have been no matching rule found.
* If you're not seeing a PayPal confirmation email being sent out (which is sent when a participant first unlocks their first PayPal payout), you must first approve the reward. This only applies if you have manual reward approval enabled for your campaign.

If there was a failure, you will need to manually issue the payout from your [PayPal dashboard.](https://paypal.com/myaccount/transfer/homepage/pay)

#### **How to confirm if a payout was sent:**

1. Go to your [PayPal Transactions History](https://www.paypal.com/unifiedtransactions/?filter=0\&query=) page to view all transactions

{% hint style="info" %}
You can disregard the "Mass Payment" items. They are not duplicate payments, but rather records of GrowSurf's usage of the PayPal API to send out payouts via Mass Pay.
{% endhint %}

<figure><img src="/files/qmZh4GbIguzcmLviSctG" alt=""><figcaption><p>PayPal Transactions History</p></figcaption></figure>

2. Click "Filter", select "Payments sent" for "Transaction type", then click "Apply Filters". You can now browse the list to confirm if payouts were sent out to GrowSurf participants.

<figure><img src="/files/BEvx6ZKS9i18hNRSWMbu" alt=""><figcaption><p>Filter transactions</p></figcaption></figure>

#### Other notes:

* If the GrowSurf participant does not have a PayPal account (or if it is unconfirmed), they will receive an email from PayPal notifying them to sign up for one or to confirm their account.
* If you have manual reward approval enabled for your campaign: PayPal payouts will only be issued to the winner(s) only after you approve the reward.
* If the referral was triggered recently (or if the reward was approved recently), please allow for a few minutes of server processing before viewing the participant's reward from your GrowSurf admin dashboard. During this time, the data displayed for the participant's reward may not be accurate.

***

## For Affiliate Programs <a href="#for-affiliate-programs" id="for-affiliate-programs"></a>

{% hint style="info" %}
**Note:** The following countries and currencies are supported [here](https://developer.paypal.com/docs/payouts/standard/reference/country-feature/).
{% endhint %}

#### Description

For affiliate programs, you can send bulk PayPal payouts to affiliates with a click of a button from your admin dashboard. Once affiliates' earned commissions pass the hold period (i.e., to account for any refunds/chargebacks), the affiliates will be eligible to be paid out, but only if their total amount meets your payout threshold (i.e, $50 payout minimum).

#### Fee Disclosures <a href="#how-to-set-up-1" id="how-to-set-up-1"></a>

* The following fees are applied on payouts made through PayPal's API:
  * United States: $0.25 USD per U.S. transaction
  * International: 2% of the recipient payment amount, up to a certain amount
* Individual payments cannot exceed $20,000 USD.
* The recipient (the GrowSurf participant) is charged no payout fee if they receive funds in the same currency as their PayPal account. If the funds arrive in a different currency, PayPal converts them using its exchange rate (which includes a conversion markup), so the recipient may effectively receive less.

#### How to Set Up

To utilize the PayPal payout feature, you'll need the following (full PayPal payout instructions can be found [here](https://developer.paypal.com/docs/payouts/standard/)) prior to set up:

1. A PayPal business account (you can [sign up for a PayPal business account here](https://www.paypal.com/bizsignup/))
2. Get [access to PayPal Payouts](https://www.paypal.com/payoutsweb/landing?_ga=1.173127584.2099703533.1638980894)
3. A confirmed [identity](https://www.paypal.com/policy/flow/verifyCip?_ga=1.118076554.2099703533.1638980894), [email](https://www.paypal.com/myaccount/profile/), and [bank account linked to your PayPal business account](https://www.paypal.com/businessexp/money/addbank)
4. Add sufficient funds to your PayPal business account (make sure to cover enough for payout totals and fees)
5. When you connect to PayPal within GrowSurf, make sure to login with your primary PayPal account holder's credentials. Using a team member's PayPal credentials can result in permission issues when sending out payouts

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, click the *Connect to PayPal* button.

{% hint style="info" %}
You must first select a default currency for your GrowSurf campaign in order to use PayPal.
{% endhint %}

<figure><img src="/files/d3tuOoRGXbFHluY8smxq" alt=""><figcaption></figcaption></figure>

Once connected, you should see a green "Connected" badge and details of your connected PayPal account.

<figure><img src="/files/9ntImP25H02EjEIPK6Bc" alt=""><figcaption></figcaption></figure>

The system will automatically aggregate all affiliates' approved commissions (which means they have passed their hold period to account for refunds/chargebacks) and they can be issued as a single payout as long as the total amount meets your minimum payout threshold (which is defined in *Campaign Editor > 4. Options*). Any commissions that are still pending do not count towards affiliates' upcoming payouts.

#### Manual Payouts

To send payouts, navigate to the Payouts page of your admin dashboard then click the *Pay Affiliates* button. You'll see a popup that will let you confirm the affiliates that will be receiving payouts and the total payout amount.

{% hint style="info" %}
**Note:** Eligible affiliates will only show up if they have a PayPal email address on file (which they can set from the GrowSurf window or the GrowSurf-hosted referral portal). These affiliates will not receive their upcoming payout if you click "Pay Out", but you can toggle a checkbox which will send them the "Confirm PayPal Email Address" email. Once added, they will become eligible for payouts upon your next bulk payout.
{% endhint %}

<figure><img src="/files/xy6s3jpWB5nLkrrUHqnj" alt=""><figcaption></figcaption></figure>

#### Troubleshooting Tips

Once a PayPal bulk payout is completed, a "New Payout Sent" email will be sent out to affiliates (if the email is enabled in *Campaign Editor > 3. Emails*) as well as a notification email to the GrowSurf campaign owner. Failed payouts will be noted in the notification email, as well as listed in the admin dashboard (in *Payouts > Failed*).

Here are some common reasons why there may be failures:

* There may be an issue with your PayPal account. For payouts to work, you must have a verified business PayPal account with access to PayPal payouts and sufficient funds. [View the requirements](https://docs.growsurf.com/integrations/paypal#how-to-set-up-1-1).
  * Make sure that the account you connected to PayPal within GrowSurf is your primary PayPal account holder. Using a team member's PayPal credentials can result in permission issues when sending out payouts.

If there was a failure, you will need to manually issue the payout from your [PayPal dashboard.](https://paypal.com/myaccount/transfer/homepage/pay)

#### How to confirm if a payout was sent:

1. Go to your [PayPal Transactions History](https://www.paypal.com/unifiedtransactions/?filter=0\&query=) page to view all transactions

{% hint style="info" %}
You can disregard the "Mass Payment" items. They are not duplicate payments, but rather records of GrowSurf's usage of the PayPal API to send out payouts via Mass Pay.
{% endhint %}

<figure><img src="https://docs.growsurf.com/~gitbook/image?url=https%3A%2F%2F2794996218-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LeklWo0yn03AhWro2Ux%252Fuploads%252FQP03kPcl34x2Nklt7FAo%252Fimage.png%3Falt%3Dmedia%26token%3Df3d107d6-c6a3-425b-b516-91953e8318ab&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=11cfa50a&#x26;sv=2" alt=""><figcaption><p>PayPal Transactions History</p></figcaption></figure>

1. Click "Filter", select "Payments sent" for "Transaction type", then click "Apply Filters". You can now browse the list to confirm if payouts were sent out to GrowSurf participants.

<figure><img src="https://docs.growsurf.com/~gitbook/image?url=https%3A%2F%2F2794996218-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LeklWo0yn03AhWro2Ux%252Fuploads%252Ft9BRchtfkjb0EEj2wvoL%252Fimage.png%3Falt%3Dmedia%26token%3Db797f71e-d621-4955-8bb3-cb1ca470691f&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=69722218&#x26;sv=2" alt=""><figcaption><p>Filter transactions</p></figcaption></figure>

#### **Other notes:**

* If the GrowSurf affiliate does not have a PayPal account, they will NOT be eligible to receive payouts. Affiliates can always update their PayPal email address from the GrowSurf window or from the GrowSurf-hosted referral portal.
* When participant logs to see if a payout was sent successfully, please allow for a few minutes of server processing time before viewing the affiliate's payout from your GrowSurf admin dashboard. During this time, the data displayed for the affiliate's payout may not be accurate.


# Pendo

Track and analyze referral program data alongside product analytics in Pendo.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

After connecting, the Pendo integration transmits data to your Pendo account, enabling analysis and reporting on your referral program.

For referrers, when they are added to your campaign (e.g., they get a referral link generated) or if they click a social share button (like Facebook or LinkedIn), GrowSurf sends a Pendo event. For referred friends, if they sign up using your Share URL, GrowSurf also sends an event.

{% hint style="success" %}
Under the hood, GrowSurf will load the Pendo JavaScript library, identify participants (both referrers and referred friends) by their email address, and track events. Rest assured, if Pendo is already installed, GrowSurf ensures the library is not loaded twice and prevents duplicate identity calls.
{% endhint %}

## Tracked Events

The following events will be emitted with the `growsurf_` prefix.

| Event                       | Description                            | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `growsurf_referral`         | \[Referred friend] New referral signup | <p>Records when a referred visitor signs up through a referral link.<br><br>This includes:</p><ul><li>Those who submit the form on your website that has referral tracking enabled (via the campaign editor)</li><li>Adding a referred participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul>                                                                                                                                                                                                                                                        |
| `growsurf_referral_trigger` | \[Referred friend] Referral triggered  | Records when a referred participant completes the desired qualifying action, which triggers a referral. Only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral).                                                                                                                                                                                                                                                                                                                                                                                                    |
| `growsurf_signup`           | \[Referrer] New referrer signup        | <p>Records when someone generates a referral link and joins the campaign as a participant.</p><p>This includes:</p><ul><li>Direct signups (someone entering in their email address on the GrowSurf form)</li><li>Passing in an email address via URL parameter <code>?grsf\_email</code></li><li>Passing in an email address via <code>data-grsf-email</code> attribute on an <a href="https://docs.growsurf.com/developer-tools/embeddable-elements">Embeddable Element</a></li><li>Adding a participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul> |
| `growsurf_share`            | \[Referred] Social media share         | Records when a referrer shares their link by clicking 'Copy Link' or clicking a social media button                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `growsurf_invite`           | \[Referrer] Email invite(s) sent       | Records when a referrer sends invitation(s) via email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Example Events

Events correspond with the events listed in the [`growsurf.subscribe()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) method. To see examples of the raw `JSON` data, please see the [*Example Response*](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) section.

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Pendo integration card and enter your [Pendo app (API) key](https://support.pendo.io/hc/en-us/articles/21362607464987-Components-of-the-install-script#01H6S2EXET7HRDK0RW5WA2SA02).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Pendo installed on your website, you do not need to enter in the Pendo app (API) key. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Pendo installed.
{% endhint %}

<figure><img src="/files/NhSqmoPtRVI5kVYtLDCy" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Within your Pendo account, make sure to whitelist the URLs where these events occur. These are primarily two locations: your referral portal (which might be part of your user portal or web app, or the [GrowSurf-hosted referral portal](https://support.growsurf.com/article/196-where-can-i-find-my-campaigns-dedicated-landing-page)) and the referred friend's landing page (the Share URL you enter in the *Campaign Editor > 5. Installation* step).
{% endhint %}

Once GrowSurf events get emitted, you will see them show up in *Pendo > Product > Track Events.*

You can filter just GrowSurf events by entering "growsurf\_" in the search bar (see image below).

<figure><img src="/files/Z1BoYwAblt9GsW7i7BNe" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Please allow up to 15 minutes of processing time for events to appear (in some cases where Pendo is backed up, it can take longer).
{% endhint %}

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If you are seeing a wrongly identified user:

There are 5 different ways that GrowSurf participants can be added to your campaign. Please make sure that the GrowSurf participant email address that you are passing in matches the one you were expecting for the Pendo user:

* If you pass in a `data-grsf-email` attribute to a [GrowSurf embeddable element](https://docs.growsurf.com/developer-tools/embeddable-elements)
* If you pass in an email address via URL parameter `?grsf_email`
* If you are using [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant)
* If you enter an email address in via the GrowSurf form
* If you are a referred friend and you submit the form that has referral tracking configured on it from the *Campaign Editor > 5. Installation* step

#### If you are not receiving events, but were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Pendo.
* Make sure to whitelist the URL where events are being tracked (e.g, if your referrer clicks the Facebook share button from *<https://app.yoursite.com/refer>*, you'll want to make sure you whitelist that root domain. If a referred friend signs up on your Share URL, make sure to whitelist the Share URL as well).
* If you just submitted an event, make sure that you've allowed up to 15 minutes for Pendo to process the event.

#### If you are receiving events, but were NOT expecting them:

* To ensure no non-GrowSurf-related events are sent to your Pendo account, disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you're receiving events without a GrowSurf-related suffix (e.g., `growsurf_`), it indicates that GrowSurf may not be emitting these events. Please check other parts of your code to find where these events might be occurring.


# PostHog

Track and analyze referral program data alongside product analytics in PostHog.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

After connecting, the PostHog integration transmits data to your PostHog account, enabling analysis and reporting on your referral program.

For referrers, when they are added to your campaign (e.g., they get a referral link generated) or if they click a social share button (like Facebook or LinkedIn), GrowSurf sends a PostHog event. For referred friends, if they sign up using your Share URL, GrowSurf also sends an event.

{% hint style="success" %}
Under the hood, GrowSurf will load the PostHog JavaScript library, identify participants (both referrers and referred friends) by their email address, and track events. Rest assured, if PostHog is already installed, GrowSurf ensures the library is not loaded twice and prevents duplicate identity calls.
{% endhint %}

## Tracked Events

The following events will be emitted with the `growsurf_` prefix.

| Event                       | Description                            | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `growsurf_referral`         | \[Referred friend] New referral signup | <p>Records when a referred visitor signs up through a referral link.<br><br>This includes:</p><ul><li>Those who submit the form on your website that has referral tracking enabled (via the campaign editor)</li><li>Adding a referred participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul>                                                                                                                                                                                                                                                        |
| `growsurf_referral_trigger` | \[Referred friend] Referral triggered  | Records when a referred participant completes the desired qualifying action, which triggers a referral. Only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral).                                                                                                                                                                                                                                                                                                                                                                                                    |
| `growsurf_signup`           | \[Referrer] New referrer signup        | <p>Records when someone generates a referral link and joins the campaign as a participant.</p><p>This includes:</p><ul><li>Direct signups (someone entering in their email address on the GrowSurf form)</li><li>Passing in an email address via URL parameter <code>?grsf\_email</code></li><li>Passing in an email address via <code>data-grsf-email</code> attribute on an <a href="https://docs.growsurf.com/developer-tools/embeddable-elements">Embeddable Element</a></li><li>Adding a participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul> |
| `growsurf_share`            | \[Referred] Social media share         | Records when a referrer shares their link by clicking 'Copy Link' or clicking a social media button                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `growsurf_invite`           | \[Referrer] Email invite(s) sent       | Records when a referrer sends invitation(s) via email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Example Events

Events correspond with the events listed in the [`growsurf.subscribe()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) method. To see examples of the raw `JSON` data, please see the [*Example Response*](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) section.

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the PostHog integration card and enter your [PostHog project API key](https://posthog.com/docs/api) (you can find this from your PostHog project's settings page [here](https://app.posthog.com/project/settings)).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have PostHog installed on your website, you do not need to enter in the PostHog project API key. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have PostHog installed.
{% endhint %}

<figure><img src="/files/4HIbX1dRMBkb6cvWBLkj" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Within your PostHog account, make sure to whitelist the URLs where these events occur. These are primarily two locations: your referral portal (which might be part of your user portal or web app, or the [GrowSurf-hosted referral portal](https://support.growsurf.com/article/196-where-can-i-find-my-campaigns-dedicated-landing-page)) and the referred friend's landing page (the Share URL you enter in the *Campaign Editor > 5. Installation* step).
{% endhint %}

Once GrowSurf events get emitted, you will see them show up in *PostHog > Activity > Explore.*

To filter just GrowSurf events, select an event like `growsurf_share` (if you don't see this option, you'll want to make sure there is at least one `growsurf_share` event that exists as PostHog will auto-generate this option).

Your screen should look like the image below:

<figure><img src="/files/nQn3SobxzET7dh84va01" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Please allow up to 15 minutes of processing time for events to appear (in some cases where PostHog is backed up, it can take longer).
{% endhint %}

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If you are seeing a wrongly identified user:

There are 5 different ways that GrowSurf participants can be added to your campaign. Please make sure that the GrowSurf participant email address that you are passing in matches the one you were expecting for the PostHog user:

* If you pass in a `data-grsf-email` attribute to a [GrowSurf embeddable element](https://docs.growsurf.com/developer-tools/embeddable-elements)
* If you pass in an email address via URL parameter `?grsf_email`
* If you are using [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant)
* If you enter an email address in via the GrowSurf form
* If you are a referred friend and you submit the form that has referral tracking configured on it from the *Campaign Editor > 5. Installation* step

#### If you are not receiving events, but were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to PostHog.
* Make sure to whitelist the URL where events are being tracked (e.g, if your referrer clicks the Facebook share button from *<https://app.yoursite.com/refer>*, you'll want to make sure you whitelist that root domain. If a referred friend signs up on your Share URL, make sure to whitelist the Share URL as well).
* If you just submitted an event, make sure that you've allowed up to 15 minutes for PostHog to process the event.

#### If you are receiving events, but were NOT expecting them:

* To ensure no non-GrowSurf-related events are sent to your PostHog account, disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you're receiving events without a GrowSurf-related suffix (e.g., `growsurf_`), it indicates that GrowSurf may not be emitting these events. Please check other parts of your code to find where these events might be occurring.


# Recurly

Trigger referrals on new Recurly charges or automatically apply Recurly coupons or credits as rewards.

## Referral Trigger

### **Description**

When you connect your Recurly account to your GrowSurf campaign and enable *Referral Trigger*, GrowSurf will automatically detect and trigger referrals on new Recurly charges.

GrowSurf will check if the Recurly customer's email address matches a GrowSurf participant's email address. If a match is found, then a referral will trigger, giving referral credit to the referrer and unlocking any rewards, if applicable.

Here's how to set up Recurly referral triggers:

### How to Set Up

{% hint style="warning" %}
**Important Note:** Unless your campaign is configured to add participants automagically ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), you'll need to make sure you first call JavaScript [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant) or REST API [`/POST Add Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant) to add new participant&#x73;**.**
{% endhint %}

{% hint style="info" %}
You must first select a default currency for your GrowSurf campaign in order to use Recurly.\
\
Your default currency determines whether Recurly coupons or credits can be applied to your Recurly subscriptions. For example, if your default currency is USD, then the coupon or credit you set up can only be redeemed for Recurly subscriptions using USD.
{% endhint %}

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Recurly integration card and enter your [Recurly API key](https://app.recurly.com/go/developer/api_access) and test API key.

{% hint style="info" %}

* For the "Enter your Recurly API Key" field, please enter an API key from your production Recurly instance
* For the "Enter your Recurly Test API Key" field, you can use the same API key as above, otherwise if you have a separate Recurly instance you use just for development/testing purposes, please enter that one.
  {% endhint %}

<figure><img src="/files/XIUzWnauJHiZB7mwQXPm" alt=""><figcaption></figcaption></figure>

**Step 2:** By default, GrowSurf activates Referral Trigger upon connection. To establish a new Recurly webhook, access your Recurly dashboard and navigate to Integrations > Webhooks. Then, create a new endpoint by clicking on the Configure button and selecting New Endpoint. Input the webhook URL displayed in the GrowSurf Recurly integration as the endpoint URL. Generate a username and password for your endpoint and proceed to the GrowSurf Recurly integration to input the username and password for your Recurly webhook.

<figure><img src="/files/UfrIdVBw4y9MVYKT3ynp" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important Note:** At a minimum, the following notifications should be selected for your Recurly webhook:

* account.updated
* payment.refunded
* payment.succeeded
  {% endhint %}

To configure the event notifications for your Recurly webhook, navigate to *Integrations > Webhooks > Configure*, then click Options for the webhook you want to configure and select Edit. Scroll to the Notifications section, select the appropriate notification(s), then click the save button.

<figure><img src="/files/qxn4jmdQ0pJ7V5duZS3B" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Fop29dScU2XEDS21ucxb" alt=""><figcaption></figcaption></figure>

**(Optional) Step 3:** You can add a referral trigger hold period by toggling the *Show advanced settings* section.

{% hint style="info" %}
**Note:** The referral trigger hold period is useful for preventing fraud and helps minimizes losses due to refunds and chargebacks. During this hold period, if there is a refund or chargeback, the referral trigger will be cancelled completely.
{% endhint %}

### Test Mode

Our Recurly integration comes with a test mode that allows you to test triggering referrals without using live payments. When you toggle *Test Mode* on, GrowSurf will also process all test mode payments made in your Recurly account.

{% hint style="warning" %}
**Important note:** When you go live with your campaign, please make sure to switch back to live mode. Otherwise, referrals will not be triggered in live mode while test mode is enabled.
{% endhint %}

### Troubleshooting Tips

* When testing out the Recurly Referral Trigger integration, make sure to view participants' activity logs for details that can help you troubleshoot any issues.
* If you were expecting a referral to be triggered in live mode, double-check that you do not have test mode enabled.

## Coupons/Credits

### **Description**

When a GrowSurf participant unlocks a reward, apply a coupon or credit to a Recurly customer subscription.

### How to Set Up

{% hint style="info" %}
You must first select a default currency for your GrowSurf campaign in order to use Recurly.\
\
Your default currency determines whether Recurly coupons or credits can be applied to your Recurly subscriptions. For example, if your default currency is USD, then the coupon or credit you set up can only be redeemed for Recurly subscriptions using USD.
{% endhint %}

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Recurly integration card and enter your [Recurly API key](https://app.recurly.com/go/developer/api_access) and test API key.

{% hint style="info" %}

* For the "Enter your Recurly API Key" field, please enter an API key from your production Recurly instance
* For the "Enter your Recurly Test API Key" field, you can use the same API key as above, otherwise if you have a separate Recurly instance you use just for development/testing purposes, please enter that one.
  {% endhint %}

<figure><img src="/files/XIUzWnauJHiZB7mwQXPm" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have *Referral Trigger* enabled by default. You can disable it if you only want to automate rewards using Recurly *Coupons/Credits*.

<figure><img src="/files/UfrIdVBw4y9MVYKT3ynp" alt=""><figcaption></figcaption></figure>

**Step 3:** Click the *Coupons/Credits* tab and connect a reward(s) to Recurly by clicking the *Connect a Reward* button.

{% hint style="info" %}
**Note:** When you connect to Recurly, *Referral Trigger* will be enabled by default. If you are triggering referrals another way, disable the toggle in the *Referral Trigger* tab.
{% endhint %}

<figure><img src="/files/btu3SkXC2O91XmbjLeXi" alt=""><figcaption></figcaption></figure>

Click on either *Coupon* or *Credit.* If coupon is selected, enter the details of the coupon including the name, type, and discount. You can also click *Show advanced coupon* settings to view more customization settings.

{% hint style="info" %}
**Advanced feature tip: Issue different reward amounts by using dynamic rewards**

Dynamic rewards let you offer different reward values based on specific attributes of the referred friend (such as the pricing plan they signed up for) or referrer (such as their partner status).

For example, you can award $50 in credits to winners when their referral signs up for your base plan or $100 in credits when they sign up for a higher-costing plan.

[Learn more →](https://support.growsurf.com/article/357-how-to-set-up-dynamic-rewards)
{% endhint %}

<figure><img src="/files/ypfXCZF5ifJIpY2B1v7Z" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** By default, coupons are recommended. However, if you want rewards to be stackable (e.g, $10 off for every referred friend), you will want to use credits.
{% endhint %}

If credit is selected, enter the details of the credit including the description and credit amount, which is applied to the customer's promotional credits every time this reward is unlocked.

<figure><img src="/files/1OjpzPtbogLggotHBno7" alt=""><figcaption></figcaption></figure>

Then hit Save. Now, anytime this reward is unlocked by a winning participant, a Recurly coupon or credit will also be applied to the Recurly subscription associated with the GrowSurf participant email address.

{% hint style="info" %}
With double-sided rewards, you have full flexibility in choosing who gets the coupon or credit reward: (1) just the referrer, (2) just the referred person, (3) or both referrer and referred person.
{% endhint %}

Once you save the reward, the Recurly *Coupons/Credits* integration is enabled and will issue coupons or credits anytime a reward is approved.

<figure><img src="/files/nnd4VqJ5PJSyrOwdNvp1" alt=""><figcaption></figcaption></figure>

### Test Mode

Our Recurly integration comes with a test mode that allows you to test coupons/credits based on the test API key that you initially provided. This helps you keep development/testing separate from production. When you toggle *Test Mode* on, GrowSurf will apply coupons/credits only to your Recurly using your test API key.

To enable test mode, toggle the *Test Mode* switch at the bottom-right, then connect a reward(s).

<figure><img src="/files/sD1Vu3nB4xf5frRaXfON" alt=""><figcaption></figcaption></figure>

Please note that the rewards you connect to while *Test Mode* is enabled are completely separate from those you connect to in live mode.

<figure><img src="/files/40k0CyUjoCuOXCrnubJv" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important note:** When you go live with your campaign, please make sure to switch back to live mode. Otherwise, coupons/credits will not be issued in live mode while test mode is enabled.
{% endhint %}

### Troubleshooting Tips

If there is an issue with applying Recurly coupons or credits, GrowSurf will send out a notification email to the campaign owner. The issue will also be stated in the participant's detail page when you view their reward or when you view the participant's activity logs.

Here are some common reasons why there may be failures:

* The customer with the associated GrowSurf participant email address does not exist in Recurly (please make sure to check live or test mode depending on if you have toggled on Test Mode in the GrowSurf Recurly integration)
* If dynamic reward rules are enabled for the Recurly reward, there may have been no matching rule found.
* If you were expecting a coupon/credit to be applied in live mode, double-check that you do not have test mode enabled.

If there was a failure, you will need to manually issue the Recurly reward from your [Recurly dashboard](https://app.recurly.com/).

#### Other notes:

* If you have manual reward approval enabled for your campaign: Recurly coupons/credits will only be issued to the winner(s) only after you approve the reward.
* If the referral was triggered recently (or if the reward was approved recently), please allow for a few minutes of server processing before viewing the participant's reward from your GrowSurf admin dashboard. During this time, the data displayed for the participant's reward may not be accurate.

***

## Upfront Discounts

The **Upfront Discount** feature lets you create a campaign-wide coupon that is instantly available to referred friends, before they make a purchase (e.g., "Get 20% off your first invoice"). This is useful for giving referred visitors a discount code they can apply at your Recurly customer signup or checkout flow.

### How It Works

1. In the GrowSurf campaign editor, go to *1. Rewards* and create a **Double-Sided** reward and enable **"Give the referred friend their reward upfront instead of after they complete the qualifying action"**. Save your changes.
2. Go to *4. Options > Integrations,* connect to Recurly, then click "Connect a Reward" and link your rewards. For your Double-Sided reward, select "Both the referrer and referred friend."
3. Save changes. GrowSurf will automatically create a coupon on your Recurly site. The coupon ID is also the code customers use.
4. When a referred visitor lands on your site, the promotion code is available via the GrowSurf JavaScript method [`growsurf.getUpfrontDiscount()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-upfront-discount).
5. When the referral triggers (e.g., the first-time purchase happens), only the **referrer** earns a reward. The referred friend's reward is not duplicated since it was already delivered upfront.

### Applying the Upfront Discount

You can retrieve the upfront discount using the JavaScript method [`growsurf.getUpfrontDiscount()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#get-upfront-discount) then apply it to your new referred customer:

```js
const discount = growsurf.getUpfrontDiscount('recurly');
if (discount) {
  console.log(discount.promotionCode); // e.g., "GRSF-A1B2C3D4"
  console.log(discount.couponId);      // Recurly coupon ID
}
```

### Notes

* Upfront discount is only available for **Double-Sided** rewards with a referred friend coupon (not referrer rewards or credits).
* The upfront toggle is set on the reward in *Campaign Editor > 1. Rewards*. The Recurly integration settings will show the generated coupon code as read-only.
* If you change the referred friend coupon settings in the Recurly integration, the coupon is automatically re-synced. (Behind the scenes, we expire the old coupon and create a new one. Your existing Recurly customers who already have the old coupon applied will remain unaffected).
* Upfront discounts cannot be used with [dynamic rewards](https://support.growsurf.com/article/357-how-to-set-up-dynamic-rewards). If you are using dynamic rewards, we recommend creating a single-sided reward and utilizing [`growsurf.validateReferrer()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#validate-referrer) then applying your own coupon code for referred visitors.


# Resend

Sync GrowSurf participants and referral data to a Resend Segment.

## Sync participants to a Resend Segment

**Step 1:** In [Resend > API Keys](https://resend.com/api-keys), create a new API key with *Full Access* (this permission is required so GrowSurf can read Segments and manage Contacts and Contact Properties).

**Step 2:** In GrowSurf, open *Program Editor > 4. Options > Integrations > Resend*. Enter the API key, then connect your account.

<figure><img src="/files/ywCaClFBFvpEk5wFiR5E" alt="The Resend integration API key form in the GrowSurf Program Editor"><figcaption><p>Connect Resend with a Full access API key.</p></figcaption></figure>

**Step 3:** Select the Resend Segment that should receive GrowSurf participants, then save your changes. GrowSurf creates the Contact Properties listed below and starts syncing new and updated participants.

<figure><img src="/files/5Q90Jqfz6DQl8IvXGK4O" alt="The enabled Resend integration with the General Segment selected in GrowSurf"><figcaption><p>Select the Resend Segment that should receive participant data.</p></figcaption></figure>

{% hint style="warning" %}
Connect Resend before importing participants. If participants are already in your Program, follow [these ESP sync options](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to send their GrowSurf data to Resend.
{% endhint %}

## Contact Properties

GrowSurf creates these account-level Contact Properties in Resend. Use them in Broadcasts with Resend's `{{{contact.property_name}}}` syntax.

| Contact Property                         | Property key                       | Type   | Description                                                         | Example                                |
| ---------------------------------------- | ---------------------------------- | ------ | ------------------------------------------------------------------- | -------------------------------------- |
| GrowSurf Share URL                       | `grsf_share_url`                   | String | The participant's unique referral link                              | `https://growsurf.com?grsf=abc123`     |
| GrowSurf Participant ID                  | `grsf_participant_id`              | String | The participant's GrowSurf ID                                       | `abc123`                               |
| GrowSurf Referral Status                 | `grsf_referral_status`             | String | The participant's referral-credit status                            | `CREDIT_PENDING`                       |
| GrowSurf Participant First Name          | `grsf_participant_first_name`      | String | The participant's first name                                        | `Bob`                                  |
| GrowSurf Participant Last Name           | `grsf_participant_last_name`       | String | The participant's last name                                         | `Loblaw`                               |
| GrowSurf Referrer First Name             | `grsf_referrer_first_name`         | String | The referrer's first name, when applicable                          | `Gavin`                                |
| GrowSurf Referrer Last Name              | `grsf_referrer_last_name`          | String | The referrer's last name, when applicable                           | `Belson`                               |
| GrowSurf Referrer Email                  | `grsf_referrer_email`              | String | The referrer's email, when applicable                               | `gavin@example.com`                    |
| GrowSurf Total Referral Count            | `grsf_total_referral_count`        | Number | The participant's all-time referral count                           | `12`                                   |
| GrowSurf Monthly Referral Count          | `grsf_monthly_referral_count`      | Number | The participant's referral count for the current month              | `3`                                    |
| GrowSurf Previous Monthly Referral Count | `grsf_prev_monthly_referral_count` | Number | The participant's referral count for the previous month             | `8`                                    |
| GrowSurf Next Milestone                  | `grsf_next_milestone`              | String | The next milestone message, when the Program uses milestone rewards | `2 referrals until your next reward`   |
| GrowSurf Next Monthly Milestone          | `grsf_next_monthly_milestone`      | String | The next monthly milestone message, when applicable                 | `1 referral until this month's reward` |
| GrowSurf Total Invite Count              | `grsf_total_invite_count`          | Number | The participant's all-time invite count                             | `24`                                   |
| GrowSurf Total Impression Count          | `grsf_total_impression_count`      | Number | The participant's all-time referral-link view count                 | `150`                                  |

The referral status can be `CREDIT_PENDING`, `CREDIT_AWARDED`, or `CREDIT_EXPIRED`.

[View the Resend tutorials](/integrations/resend/tutorials) for copy-and-paste examples. View Resend's [Contact Properties guide](https://resend.com/docs/dashboard/audiences/properties) to see how properties work in Broadcasts.

## Troubleshooting

* If GrowSurf cannot connect, confirm the API key has Full access. Sending-only keys cannot read Segments or manage Contacts.
* If the selected Segment was deleted, choose an existing Segment in GrowSurf and save again.
* Check the GrowSurf participant's activity logs when a participant does not sync. GrowSurf retries temporary provider errors for up to seven days.


# Tutorials

Add GrowSurf referral links and progress data to Resend Broadcasts.

Once GrowSurf syncs participants to Resend, you can insert their referral link and progress directly into a Broadcast. Resend uses triple braces for Contact Properties.

## Display the participant's referral link

Use the synced `grsf_share_url` property as the link and visible text:

```html
<p>Give your friends a reason to join.</p>
<p>Copy and paste your unique referral link to share:</p>
<p>
  <a href="{{{contact.grsf_share_url}}}">{{{contact.grsf_share_url}}}</a>
</p>
```

## Display a link to your program referral portal

Replace `YOUR_PROGRAM_ID` with your GrowSurf Program ID. If you use a custom Referral Portal domain, replace the `https://grow.surf/YOUR_PROGRAM_ID` portion with that URL.

```html
<a href="https://grow.surf/YOUR_PROGRAM_ID?grsf_email={{{contact.email}}}&grsf_first_name={{{contact.first_name}}}&grsf_last_name={{{contact.last_name}}}">
  View your referral progress
</a>
```

## Show referral progress

```html
<p>You have made {{{contact.grsf_total_referral_count|0}}} referrals so far.</p>
```

{% hint style="info" %}
Resend supports fallback values after the `|` character. Its [Broadcast guide](https://resend.com/docs/dashboard/broadcasts/introduction) documents the same syntax.
{% endhint %}


# Salesforce

Trigger referrals when Salesforce records match the conditions you choose and update/add Salesforce contact field labels with their unique share link and referrer information.

{% hint style="warning" %}
**Important Note:** Your Salesforce user account MUST have the proper permissions to perform the following actions within Salesforce:

* Create custom fields, delete custom fields
* Assign permissions to those custom fields
* Create contacts, delete contacts
* Create or update the GrowSurf-managed Salesforce PushTopic used for referral-trigger events

If the you do not have these permissions, the Salesforce integration cannot be enabled within your campaign. Please contact your Salesforce system administrator to update your user account with the listed permissions to proceed.
{% endhint %}

## Referral Trigger

### Description

When you connect your Salesforce account to your GrowSurf campaign and enable *Referral Trigger*, GrowSurf can automatically detect and trigger referrals when the Salesforce records you choose match the conditions you configure.

GrowSurf lets you choose one Salesforce object, one direct trigger field on that object, and one exact value to match. Supported objects include:

* Opportunity
* Lead
* Contact
* Account
* Other Salesforce custom objects that are queryable in your Salesforce account

GrowSurf then determines which participant should count as the referred participant:

* **Opportunity:** By default, GrowSurf uses the *Primary Opportunity Contact*. You can also choose *All Opportunity Contacts* as an advanced option.
* **Lead:** GrowSurf uses `Lead.Email` to find the referred participant.
* **Contact:** GrowSurf uses `Contact.Email` to find the referred participant.
* **Account** and **Other Salesforce Object:** GrowSurf can use a direct email field on that object, a direct Contact lookup, or a direct Lead lookup to find the referred participant.

{% hint style="info" %}
**Note:** GrowSurf creates and manages its own Salesforce PushTopic for referral-trigger events. If Salesforce connects successfully but enabling or changing the *Referral Trigger* fails, ask your Salesforce administrator to confirm that the connected user has the API access and PushTopic permissions required to create and update that GrowSurf-managed PushTopic.
{% endhint %}

In order for a referral to trigger from within Salesforce, the following must be true:

1. The selected Salesforce record must exist
2. The selected trigger field on that record must match the exact value you configured
3. GrowSurf must be able to resolve one or more referred-participant email addresses from the matching rule you selected
4. One or more of those resolved email addresses must already exist as participants in the GrowSurf campaign connected to Salesforce

If all of the above holds true and a participant match is found, the referral will trigger within GrowSurf. Referral credit will then be given to the referrer and unlock any rewards, if applicable.

Here's how to set up Salesforce referral triggers:

### **How to Set Up**

{% hint style="warning" %}
**Important Note:** Unless your campaign is configured to add participants automagically ([see image](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-LgbRcVrYaKYUhQVctKK%2F-LgbS62PrNqHiJm-qwdI%2FScreen%20Shot%202019-06-05%20at%207.42.50%20PM.png?alt=media\&token=85e064ce-4bac-4617-9481-f80215478d51)), you'll need to make sure you first call JavaScript [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant) or REST API [`/POST Add Participant`](https://docs.growsurf.com/developer-tools/rest-api/api-reference#post-campaign-id-participant) to add new participant&#x73;**.**
{% endhint %}

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, click the *Connect to Salesforce* button, then choose *Production org* or *Sandbox org*.

<figure><img src="/files/Rfq3BDPemcoLM4IUFBdG" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Salesforce sandbox orgs are best for testing. If you choose *Sandbox org*, GrowSurf sends you through Salesforce's sandbox login. We recommend connecting sandbox orgs to a separate GrowSurf test campaign instead of your live campaign.
{% endhint %}

{% hint style="info" %}
**Note:** Once connected, Salesforce requires us to collect certain information from your organization, such as Org ID and business address. Please contact GrowSurf support [here](http://app.growsurf.com/settings#contact_support) to submit your organization details.

The Salesforce integration will continue to work without this information, however, to ensure there are no service interruptions please submit this information within 3-5 business days of your first GrowSurf invoice payment.
{% endhint %}

**Step 2:** Once connected, toggle the switch to enable the Referral Trigger.

<figure><img src="/files/NyBMtfNGitGyZq6wuQhT" alt=""><figcaption></figcaption></figure>

**Step 3:** Choose the Salesforce object, direct trigger field, and exact value that should count as the qualifying referral event.

**Step 4:** Choose how GrowSurf should identify the referred participant when that record matches.

* For Opportunities, choose either *Use the Primary Opportunity Contact* or *Use all Opportunity Contacts (advanced)*.
* For Leads and Contacts, GrowSurf automatically uses the record's email field to find the referred participant.
* For Accounts and custom objects, choose a direct email field, Contact lookup, or Lead lookup that points to the referred participant.

**(Optional) Step 5:** You can add a referral trigger hold period by toggling the *Show advanced settings* section.

{% hint style="info" %}
**Note:** The referral trigger hold period is useful for making sure that Salesforce records that stop matching do not count as referrals. During this hold period, if the selected Salesforce record no longer matches the condition you configured, the referral trigger will be cancelled completely.
{% endhint %}

<figure><img src="/files/gqGcwx8rMogdHtluJTmu" alt=""><figcaption></figcaption></figure>

### Troubleshooting Tips

* When testing out the Salesforce Referral Trigger integration, make sure to view participants' activity logs for details that can help you troubleshoot any issues.
* Salesforce record updates are sent to GrowSurf asynchronously and could take up to one minute or longer depending on load. Until the event is received, GrowSurf cannot process the event and trigger the referral. Furthermore, we use a message queue to process these events. If you do not see a referral trigger right away, please be patient.
* If you are connecting a Salesforce sandbox org, choose *Sandbox org* after clicking *Connect to Salesforce*. If your campaign is already connected to the wrong org type, disconnect Salesforce and reconnect with the correct choice.
* If Salesforce connects but GrowSurf shows an error when you save or change the *Referral Trigger*, ask your Salesforce admin to confirm that the connected user can create and update the GrowSurf-managed Salesforce PushTopic and has the required API access.
* If you are using *Use the Primary Opportunity Contact* for Opportunities, make sure exactly one primary contact is marked on the Opportunity. If there is no primary contact, GrowSurf will not trigger the referral for that Opportunity.
* If you are using an Account or custom object, make sure the matching rule points to a direct email field, Contact lookup, or Lead lookup on that same object. GrowSurf does not follow indirect relationship chains for Salesforce referral triggers.

## Sync Data

### **Description**

When new GrowSurf participants are added to your campaign, they will automatically be added/updated as Salesforce contacts with new *GrowSurf Field Labels.* Their unique share link and referrer information will be available for use in emails and reports.

### How to Set Up

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, click the *Connect to Salesforce* button, then choose *Production org* or *Sandbox org*.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Salesforce only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Salesforce.
{% endhint %}

![](/files/-MiYB-t2I7SRBT3VR4nT)

**Step 2:** Give GrowSurf authorization to connect to Salesforce

![](/files/-MiYBSDudWNKReB9PcHp)

{% hint style="info" %}
**Note:** Once connected, Salesforce requires us to collect certain information from your organization, such as Org ID and business address. Please contact your GrowSurf customer success manager [here](https://growsurf.com/book-success-call) to submit your organization details.

The Salesforce integration will continue to work without this information, however to ensure there are no service interruptions please submit this information within 3-5 business days of your first GrowSurf invoice payment.
{% endhint %}

### Enabling Contact Field Visibility in Salesforce

Once you have successfully connected to Salesforce, GrowSurf fields are automatically available. However, in some cases, the custom field permissions must be modified to grant other Salesforce users access and allow visibility.

To find contact fields and add permissions to those fields as an admin, follow the steps below:

**Step 1:** In Salesforce navigate to *Setup > Object Manager > Contact > Fields and Relationships*

![](/files/-MicWAwlKdPt5j4w48ag)

**Step 2:** Select a Field Label from the list

![](/files/-MicWAwlKdPt5j4w48ag)

**Step 3:** Click the *Set Field-Level Security button* and make modifications.

![](/files/-MigOdN6k9RPpYO3qJT6)

{% hint style="danger" %}
**Critical Note:** If any of the defaulted permissions (currently System Administrator and Standard User) are removed, GrowSurf will not have the ability to add contacts with the GrowSurf custom fields (e.g., GrowSurf Share URL).
{% endhint %}

![](/files/-MigPUXmC5uYPNIa_xFI)

### How to Add Fields to Page Layouts in Salesforce

To view the GrowSurf custom fields within Salesforce, you must update one or more page layouts so that the fields appear for contacts within Salesforce.

**Step 1:** In Salesforce navigate to *Setup > Object Manager > Contact > Page Layouts*

![](/files/-MigQEuHpnKJTQtEnxJY)

**Step 2:** Select the target page layout from the list

![](/files/-MigQcfy4wPYWVAs5FKr)

**Step 3:** Click and drag one or more GrowSurf custom contact fields into the view

![](/files/-Mic_p4oMIC0RKuMFbnP)

**Step 4:** Click the *Save* button

![](/files/-MigRIXTtox_Rk1gt9z1)

**Step 5:** Navigate to the layout to view the added fields

![](/files/-MigSVoI7K_eDzTUkF0M)

### Examples

[View our Salesforce tutorials](https://docs.growsurf.com/integrations/salesforce/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

### Contact Field Labels

GrowSurf will automatically create these new contact field labels for your Salesforce contacts.

| **Field Label**                                   | **API Field Name**                            | **Type** | **Description**                                                                                                                                                                                           | **Example**                                                  |
| ------------------------------------------------- | --------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| GrowSurf Share URL                                | `growsurf_share_url__c`                       | URL      | The participant's unique Share URL (contains their unique GrowSurf ID)                                                                                                                                    | `https://piedpiper.com?grsf=d77a8j`                          |
| GrowSurf Participant ID                           | `growsurf_participant_id__c`                  | Text     | The participant's unique GrowSurf ID                                                                                                                                                                      | `d77a8j`                                                     |
| GrowSurf Referral Status                          | `growsurf_referral_status__c`                 | Text     | The referral status of the participant\*                                                                                                                                                                  | `CREDIT_PENDING`                                             |
| GrowSurf Referrer Email                           | `growsurf_referrer_email__c`                  | Email    | The email of the participant's referrer                                                                                                                                                                   | `gavin@hooli.com`                                            |
| GrowSurf Referrer First Name                      | `growsurf_referrer_first_name__c`             | Text     | The first name of the participant's referrer                                                                                                                                                              | `Gavin`                                                      |
| GrowSurf Referrer Last Name                       | `growsurf_referrer_last_name__c`              | Text     | The last name of the participant's referrer                                                                                                                                                               | `Belson`                                                     |
| GrowSurf Participant First Name                   | `growsurf_participant_first_name__c`          | Text     | The participant's First Name                                                                                                                                                                              | `Bob`                                                        |
| GrowSurf Participant Last Name                    | `growsurf_participant_last_name__c`           | Text     | The participant's Last Name                                                                                                                                                                               | `Loblaw`                                                     |
| GrowSurf Total Referral Count                     | `growsurf_total_referral_count__c`            | Number   | The participant's all-time referral count                                                                                                                                                                 | `0`                                                          |
| GrowSurf Monthly Referral Count                   | `growsurf_monthly_referral_count__c`          | Number   | The participant's current month referral count                                                                                                                                                            | `19`                                                         |
| <p>GrowSurf</p><p>Prev Monthly Referral Count</p> | `growsurf_previous_monthly_referral_count__c` | Number   | The participant's previous month referral count                                                                                                                                                           | `200`                                                        |
| GrowSurf Next Milestone                           | `growsurf_next_milestone__c`                  | Text     | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | `You are only 2 referrals away from winning a free t-shirt!` |
| GrowSurf Next Monthly Milestone                   | `growsurf_next_monthly_milestone__c`          | Text     | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | `You are only 2 referrals away from winning a free t-shirt!` |
| GrowSurf Total Invite Count                       | `growsurf_total_invite_count__c`              | Number   | The participant's all-time invite count                                                                                                                                                                   | `112`                                                        |
| GrowSurf Total Impression Count                   | `growsurf_total_impression_count__c`          | Number   | The participant's all-time impression count                                                                                                                                                               | `150`                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

### Troubleshooting Tips

* **If the new participant isn't being added to Salesforce, or if they are being added but their unique referral link isn't being synced to Salesforce:**
  * Activity logs will denote if a participant was added to Salesforce or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
* **If the new participant is being added twice to Salesforce (as a Lead and Contact):**
  * If you are tracking referrals on a form (typically a Marketo form), you will always see a new Salesforce contact created/updated by GrowSurf. This is the expected behavior, as GrowSurf will create/update Salesforce Contact objects regardless of Salesforce Lead objects. Your form most likely has an automation that also generates a Salesforce Lead upon form submission.
    * **NOTE:** Even if you have a Duplicate Rule set up in your Salesforce instance to prevent Leads and Contacts from having the same email address, GrowSurf will still create a new Contact if it does not already exist.
* **If you are having trouble connecting to Salesforce:**
  * If you are having trouble connecting Salesforce to your GrowSurf campaign, the issue may be related to permissions. Contact your Salesforce administrator and ask them to enable API access in the 'Permission Sets' section. Keep in mind that API access is only available in certain Salesforce editions, including Enterprise, Unlimited, Developer, and Performance. It is not available in Group, Essentials, and Professional but can be added as a feature in the Professional edition. For more information, check out [Salesforce editions with API access](https://help.salesforce.com/s/articleView?id=000385436\&type=1).
  * If you are connecting a Salesforce sandbox org, choose *Sandbox org* after clicking *Connect to Salesforce*. If your campaign is already connected to the wrong org type, disconnect Salesforce and reconnect with the correct choice.


# Tutorials

We'll walk you through adding personalized referral program messaging to your Salesforce emails.

When you connect your GrowSurf campaign to Salesforce, you can easily embed a referral program into your Salesforce emails. Check out the examples below, each with ready-made code snippets that you can copy/paste and customize to your liking.

## Example 1

Display a static image in your email.

### What it looks like

![](/files/6rWCZf0i1y23UfO0zQIS)

### Copy/paste this HTML code into your Salesforce email

```markup
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 15px; background: #F5F5F5; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <th> 
       <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;"> 
    </th>
  </tr>
  <tr style="background: #FFFFFF">
    <td style="padding: 20px; text-align: center;">
      <p style="font-size: 30px; margin: 5px;">Refer your friends, boost your savings</p>
      <hr style="margin: 15px;">
      <p style="font-size: 16px;">Get $5 for every friend you refer to PrismJar with your personal referral link: 
        <a href="{!Contact.growsurf_share_url__c}" style="color: #1673df; text-decoration: none;">{!Contact.growsurf_share_url__c}</a>
      </p>
      <div> 
         <a href="mailto:?body={!Contact.growsurf_share_url__c}20Share%20URL%7D%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; margin-top: 10px; background: #dd4b39; color: #ffffff; padding: 12px; text-decoration: none;">Send to Email</a> 
         <a href="https://www.facebook.com/sharer/sharer.php?u={!Contact.growsurf_share_url__c}" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none;">Post to Facebook</a> 
         <a href="https://twitter.com/intent/tweet?url={!Contact.growsurf_share_url__c}&text=Join%20PrismJar%20and%20we%20both%20get%20$10%20:)" style="display: inline-block; font-size: 24px; width: 50%; margin-bottom: 16px; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none;">Send by Twitter</a> 
      </div>
    </td>
  </tr>
</table>
```

### **Customize the content**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png) with your own image.
2. At line 11 replace `PrismJar` with your own brand name.
3. At line 12, replace `#1673df` with your own brand color.
4. At line 15, replace the text `{!Contact.growsurf_share_url__c}%0AJoin%20PrismJar%20and%20we%20both%20get%20$10%20` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{!Contact.growsurf_share_url__c}` only to the encoded message
5. At line 17, replace the text `Join%20PrismJar%20and%20we%20both%20get%20$5%20` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)

## Example 2

Display a static image in your email.

### What it looks like

![](/files/44NZyBJ9kXBfEgyXqQTW)

### Copy/paste this HTML code into your Salesforce email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 18px; text-align: center; border-top: 0; border-bottom: 0;"> 
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <h1 style="display: block; margin: 0; padding-top: 18px; font-size: 38px; font-style: normal; font-weight: bold; line-height: 125%; letter-spacing: 1px; text-align: center; color: #ffffff;">Get $10 in bonus credits when you refer a friend</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; padding-right: 18px; padding-left: 18px; word-break: break-word; color: #00265d; font-size: 16px; line-height: 150%; text-align: left;">
      <h3 style="display: block; margin: 0; padding: 0; color: #FFFFFF; font-size: 18px; font-style: normal; font-weight: normal; line-height: 150%; letter-spacing: 1px; text-align: center;">The more friends you refer, the more money you make.</h3>
    </td>
  </tr>
  <tr>
    <td style="font-size: 18px; padding: 18px; padding-bottom: 36px;" align="center"> 
       <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="display: inline-block; width: 20%; margin-bottom: 16px; margin-top: 10px; border-radius: 4px; background: #e87b3c; color: #ffffff; padding: 12px; text-decoration: none;">Get $10</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/Gift0002.png) with your own image.
2. At line 15, replace `#e87b3c` with your own brand color.
3. At line 15, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 3

Display static images in email.

### What it looks like

![](/files/gio8ujYq18DoA8cagDBc)

### Copy/paste this HTML code into your Salesforce email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: left;">
      <p style="padding: 0; margin: 0; text-align: left; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and you'll both get $10.</p>
      <a href="https://grow.surf/btbqey?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c} style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
   </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px;">
      <hr style="width:100%; text-align:left;">
    </td>
  </tr>
  <tr>
    <td style="padding: 20px;">
      <p style="padding: 0; margin: 0; text-align: left; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">It's easy to get rewarded</p>
      <p style="padding-top: 10px; padding-bottom: 20px; margin: 0; text-align: left; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Refer friends to Cointech and we'll give you both $10 in account credits for every friend who makes their first deposit.</p>
      <table border="0" cellpadding="0" style="padding-bottom: 20px;">
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">1</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Spread the word</h3>
            <p style="margin-top: 5px;">Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">2</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">You'll get $10</h3>
            <p style="margin-top: 5px;">Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px;">
             <div style="background: #4f46e5; color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 22px; height: 40px; width: 40px; border-radius: 40px;">3</div>
          </td>
          <td style="padding: 10px; text-align: left;">
            <h3 style="margin-bottom: 5px;">Your friends get $10</h3>
            <p style="margin-top: 5px;">Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; background: #4f46e5; color: #ffffff; padding:12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace all instances of `Cointech` with your own brand name.
2. At lines 6, 21, 30, 39, and 47, replace `#4f46e5` with your own brand color.
3. At lines 6 and 47, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 4

Display a static image in your email.

### What it looks like

![](/files/Q40o1cOVt3Eecl09eRG6)

### Copy/paste this HTML code into your Salesforce email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; text-align: left;">
      <p style="font-size: 25px; font-weight: 700;">Give $200, Get $200</p>
      <p style="padding-bottom: 20px">Did you know you can get $200 when you refer LearnEd to a friend?</p>
    </td>
  </tr>
  <tr>
    <td style="text-align: center;">
       <img src="https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg" alt="reward image" style="width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; padding-top: 20px;">
      <table border="0" cellpadding="0">
        <tr>
          <td style="width: 100%; text-align: left; line-height: 1.6">
            <p>Simply share your unique referral link with your friends/family and we'll give both of you a $200 gift card for everyone who enrolls into a LearnEd program! It's a win-win for all.</p> 
            <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="display: inline-block; font-size: 18px; margin-bottom: 16px; border-radius: 10px; background: #ee1152; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace `LearnEd` with your own brand name.
2. At line 10, replace [`https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg`](https://d1pnnwteuly8z3.cloudfront.net/images/b90d3589-b2f5-4e75-bf91-c0fba9e89952/507b3cec-5435-499f-96d7-46c5a4d6d79f.svg) with your own image.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 19, replace `#ee1152` with your own brand color.

## Example 5

Display a static image in your email.

### What it looks like

![](/files/nJmQd7c0juiCajjubqAr)

### Copy/paste this HTML code into your Salesforce email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <h1 style="margin: 5px;">Give $100, Get $100</h1>
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png" alt="reward image" style="display: block; padding-top: 20px; margin: 0 auto; width: 100%;">
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0; text-align: left;">
      <p>Give $100, Get $100.</p>
      <p>Did you know that you can get $100 for referrals?</p>
      <p style="line-height: 1.6;">Simply share your unique referral link: 
        <a href="{!Contact.growsurf_share_url__c}" style="color: #4f46e5; text-decoration: none;">{!Contact.growsurf_share_url__c}</a> or click the button below to invite them from your personal referral portal. We'll give you and your friends both a $100 gift card when they activate an insurance policy with us.
      </p>
    </td>
  </tr>
  <tr>
    <td style="padding-left: 20px; padding-right: 20px; margin: 0 auto; text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="display: inline-block; margin-bottom: 20px; margin-top: 20px; border-radius: 4px; background: #094a83; color: #ffffff; padding: 20px; text-decoration: none; font-size: 18px; text-align: center;">Refer Friends</a> 
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/people.png) with your own image.
2. At line 19, replace `#094a83` with your own brand color.
3. At line 19, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).

## Example 6

Display a static image in your email.

### What it looks like

![](/files/4tpeK411YYyHAvWEHVxg)

### Copy/paste this HTML code into your Salesforce email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #1f2937; max-width: 600px; padding: 0; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="text-align: center; border-top: 0; border-bottom: 0; ">
      <div style="padding: 20px;">
      <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png" alt="reward image" style="display: block; margin: 0 auto; width: 100%;">
      <div>
      <h1 style="display: block; margin: 0; padding-top: 40px; padding-bottom: 20px; font-size: 18px; font-style: normal; font-weight: bold; color: #ffffff;">Invite your friends to Sips</h1>
    </td>
  </tr>
  <tr>
    <td style="padding-bottom: 20px; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal; font-weight: normal; text-align: center;">Get a friend saving with Sips, and you'll both get $10 in accounts credits.</p>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 0; font-size: 16px;">
      <p style="display: block; margin: 0; padding: 0; color: #ffffff; font-style: normal;font-weight: normal;text-align: center;">Copy & share your link:<a href="{!Contact.growsurf_share_url__c}" style="color: #ffffff;">{!Contact.growsurf_share_url__c}</a></p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px;" align="center">
      <p style="color: #ffffff;">Or spread the word on social media:</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-top: 20px; padding-bottom: 40px;" align="center">
      <a href="https://twitter.com/intent/tweet?url={!Contact.growsurf_share_url__c}&text=Hey!%20Do%20you%20love%20wine?%20So%20do%20I.%20)." style="display: inline-block; background: #55acee; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/twitter/white.png" alt="Twitter"> 
      </a>
      <a href="https://www.facebook.com/sharer/sharer.php?u={!Contact.growsurf_share_url__c}" style="display: inline-block; background: #3b5999; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/facebook/white.png" alt="Facebook"> 
      </a>
      <a href="mailto:?body={!Contact.growsurf_share_url__c}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I." style="display: inline-block; background: #3b3b3b; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/email/white.png" alt="Email"> 
      </a>
      <a href="https://www.linkedin.com/shareArticle?mini=true&url={!Contact.growsurf_share_url__c}" style="display: inline-block; background: #0077B5; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/linkedin/white.png" alt="LinkedIn"> 
      </a>
      <a href="https://wa.me?text={!Contact.growsurf_share_urjl__c}" style="display: inline-block; background: #25D366; color: #ffffff; padding: 12px; text-decoration: none; border-radius: 4px;"> 
      <img style="max-width: 20px; width: 20px;" src="https://growsurf-blog.s3.us-west-2.amazonaws.com/social/whatsapp/white.png" alt="WhatsApp"> 
      </a>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 5, replace [`https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png`](https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/welcome.png) with your own image.
2. At lines 7 and 12, replace `Sips` with your own brand name.
3. At line 27, replace the text `Hey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own.
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
4. At line 33, replace the text `{!Contact.growsurf_share_urjl__c}%0AHey!%20Do%20you%20love%20wine?%20So%20do%20I.` with your own
   1. Make sure to encode the message using a tool like [https://www.url-encode-decode.com](https://www.url-encode-decode.com/)
   2. Make sure to include `{!Contact.growsurf_share_urjl__c}` only to the encoded message

## Example 7

Display a static image in your email.

### What it looks like

![](/files/YVoLRVmzmWm0ReoYoXAY)

### Copy/paste this HTML code into your Salesforce email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 600px; margin: 0 auto; font-family: sans-serif; padding-left: 20px; padding-right: 20px;">
  <tr>
    <td style="text-align: left; font-weight: 400; font-size: 16px;">
      <p style="line-height: 1.6;">Thanks for using PrismJar to manage your workforce. We hope your customer experience is amazing and one that's worth sharing. In fact, you can invite your friends and colleagues to try PrismJar, and you each get a $100 gift card when they sign up for an annual subscription.</p>
    </td>
  </tr>
  <tr>
    <td style="font-size: 16px; padding-bottom: 30px;" align="center"> <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="display: inline-block; min-width: 50%; border-radius: 4px; background: #1673df; color: #ffffff; padding: 12px; text-decoration: none;">Invite A Friend, Get $100</a> </td>
  </tr>
  <tr>
     <td> 
     <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png" alt="reward image" style="display: block; width: 100%; max-width: 300px; margin: 0 auto;"> 
     </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 4, replace all instances of `PrismJar` with your own brand name.
2. At line 8, replace `#1673df` with your own brand color.
3. At line 8, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 12, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/email-examples/boy-and-girl-giving-high-five-to-each-other.png` with your own image.

## Example 8

Display static images in your email.

### What it looks like

![](/files/9gPvMvVQHapWIB72O0EF)

### Copy/paste this HTML code into your Salesforce email

```markup
<table width="100%" cellpadding="0" cellspacing="0" style="background: #ffffff; max-width: 700px; margin: 0 auto; font-family: sans-serif;">
  <tr>
    <td style="padding: 20px; text-align: center;">
      <p style="padding: 0; margin: 0; font-weight: 700; color: #484848; line-height: 1.3; font-size: 25px;">Get $10 when you refer a friend</p>
      <p style="padding-top: 10px; padding-bottom: 25px; margin: 0; font-weight: 100; color: #484848; line-height: 1.4; font-size: 18px;">Love Cointech? Spread the excitement by referring friends and we'll give you both get $10.</p> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a>
    </td>
  </tr>
  <tr>
    <td style="padding: 10px 0;">
      <hr style="width: 50%; max-width: 120px; border-top: 1px solid #acacac;">
    </td>
  </tr>
  <tr>
    <td>
      <p style="padding-top: 20px; margin: 0; text-align: center; color: #484848; line-height: 1.3; font-weight: 700; font-size: 25px;">Here's how to get $10</p>
  <tr>
    <td style="padding: 20px; background: #ffffff;">
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;">
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png" alt="step 1" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Spread the word</p>
            <p>Go to your Cointech page to get your unique referral link and share it via text, email, or social media</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png" alt="step 2" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">You'll get $10</p>
            <p>Receive $10 for each friend your refer that makes their first deposit</p>
          </td>
          <td style="width: 33.33%; vertical-align: top; padding: 10px; color: #484848; text-align: center;"> 
            <img src="https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png" alt="step 3" style="display: inline-block; height: auto; max-height: 60px; border: none; padding-top: 10px; padding-bottom: 10px;">
            <p style="font-weight: 700;">Your friends get $10</p>
            <p>Each friend you refer also gets $10 in account credits. Everyone wins!</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
     <td style="text-align: center;"> 
      <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="display: inline-block; font-size: 18px; margin-bottom: 12px; background: #4f46e5; color: #ffffff; padding: 12px 24px 12px 24px; text-decoration: none;">Refer Friends</a> 
     </td>
    </tr>
   </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 5 and 24, replace all instances of `Cointech` with your own brand name.
2. At lines 6 and 42, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you set up a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At lines 6 and 42, replace `#4f46e5` with your own brand color.
4. At line 22, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-1.png` with your own image.
5. At line 27, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-profiles-4.png` with your own image.
6. At line 32, replace `https://growsurf-blog.s3.us-west-2.amazonaws.com/illustrations/GrowSurf-steps-2.png` with your own image.

## Example 9

Display a static image in your email.

### What it looks like

![](/files/-MQW0SrO9bgdhrNa2DZB)

### Copy/paste this HTML code into your Salesforce email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Get your swag
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 600px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  <strong>Become an Evening Stew ambassador.</strong> Invite your friends and coworkers to sign up to Evening Stew and get rewarded with exclusive swag.
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">Share with a friend</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  Or you can copy/paste your unique link here: <a href="{!Contact.growsurf_share_url__c}" style="color: #8E4CED;">{!Contact.growsurf_share_url__c}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  You currently have {!Contact.growsurf_total_referral_count__c} referrals. <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="color: #8E4CED;">Check your status here</a>. {!Contact.growsurf_next_milestone__c}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 20, replace all instances of `Evening Stew` with your own brand name.
2. At lines 25, 30, and 35, replace `#8E4CED` with your own brand color.
3. At line 25 and 35, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.
5. At line 35, because `{!Contact.growsurf_next_milestone__c}`is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 10

Display different reward images based on how many referrals the participant has made.

### What it looks like

![](/files/-MQU7NRt27EKKiY7csW3)

### Copy/paste this HTML code into your Salesforce email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="10" width="600">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td style="background: #8E4CED; color: #FFFFFF; border-radius: 20px; text-align: center; display: inline-block; padding: 5px 10px">
                  {!Contact.growsurf_total_referral_count__c} referrals
                </td>
              </tr>
              <tr>
                <td style="font-size: 24px; font-weight: bold; padding: 10px 0px 15px 0px">
                  Refer your friends, win stuff
                </td>
              </tr>
              <tr>
                <td>
                  1. Share your unique link with friends/coworkers
                </td>
              </tr>
              <tr>
                <td>
                  2. When they sign up you unlock a reward
                </td>
              </tr>
              <tr>
                <td>
                  3. Keep on sharing to unlock more rewards
                </td>
              </tr>
              <tr>
                <td style="text-align: center; margin-bottom: 5px; padding: 0">
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png" alt="rewards" style="display: block; margin: 0 auto; max-width: 800px; width: 100%">
                  Your unique link:
                </td>
              </tr>
              <tr>
                <td>
                  <a href="{!Contact.growsurf_share_url__c}" style="display: block; background: #FAFAFA; color: #8E4CED; text-decoration: none; text-align: center; padding: 20px; font-size: 1.25em; font-weight: bold">{!Contact.growsurf_share_url__c}</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="background: #8E4CED; color: #FFFFFF; margin-bottom: 20px; margin-top: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
              <tr>
                <td align="center">
                  <i>{!Contact.growsurf_next_milestone__c}</i>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 9, 41, and 46, replace `#8E4CED` with your own brand color.
2. At line 46, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 35, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png) with your own image based on `{!Contact.growsurf_total_referral_count__c}`. In this example, you would display any one of these five images at a given time:
   1. If `{!Contact.growsurf_total_referral_count__c}` <3, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/0-won.png).
   2. If `{!Contact.growsurf_total_referral_count__c}` >=3 and <5, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/1-won.png).
   3. If `{!Contact.growsurf_total_referral_count__c}` >=5 and <10, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/2-won.png).
   4. If `{!Contact.growsurf_total_referral_count__c}` >=10 and <20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/3-won.png).
   5. If `{!Contact.growsurf_total_referral_count__c}` >=20, then display [this image](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/4-won.png).
4. At line 51, because `{!Contact.growsurf_next_milestone__c}` is used, make sure that any milestone rewards you have in your GrowSurf campaign have *Next Milestone* values set ([see image](https://growsurf-blog.s3-us-west-2.amazonaws.com/set-next-milestone-in-growsurf-campaign-editor.png). Note: This only applies to milestone rewards).

## Example 11

Display a GIF image with rotating rewards in your email.

### What it looks like

![](/files/-MQU7F1fUbOPbKf9qhfl)

### Copy/paste this HTML code into your Salesforce email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Share Evening Stew
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif" alt="rewards" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>
              <tr>
                <td align="center">
                  🙌
                  Share Evening Stew with your friends/coworkers and earn free swag. Copy/paste your referral link: <a href="{!Contact.growsurf_share_url__c}" style="color: #8E4CED;">{!Contact.growsurf_share_url__c}</a> or <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="color: #8E4CED;">click here</a> to see your progress towards rewards.
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 21, replace `Evening Stew` with your own brand name.
2. At line 21, replace all instances of`#8E4CED` with your own brand color.
3. At line 21, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 15, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rotating-rewards.gif)with your own GIF image (you can use a tool like <https://ezgif.com/maker>).

## Example 12

Display a static image in your email.

### What it looks like

![](/files/-MSnaVa5w_qBtRSBreJl)

### Copy/paste this HTML code into your Salesforce email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="800">
        <tr>
          <td align="center" valign="top">
            <table border="0" cellpadding="10" cellspacing="0" width="100%">
              <tr>
                <td align="center" style="font-size: 24px; font-weight: bold">
                  Love Husto? Refer a friend
                </td>
              </tr>
              <tr>
                <td align="center">
                  You can earn a $200 gift card when your friend signs up for Husto.
                </td>
              </tr>
              <tr>
                <td align="center">
                  Copy and share your unique link: <a href="{!Contact.growsurf_share_url__c}" style="color: #F46A54;">{!Contact.growsurf_share_url__c}</a>
                </td>
              </tr>
              <tr>
                <td>
                  <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/gift-card-reward.png" alt="reward" style="display: block; margin: 0 auto; max-width: 300px; width: 100%">
                </td>
              </tr>              
              <tr>
                <td align="center">
                  <a href="https://grow.surf/YOUR_CAMPAIGN_ID?grsf_email={!Contact.Email}&grsf_first_name={!Contact.first_name__c}&grsf_last_name={!Contact.last_name__c}" style="background: #F46A54; color: #FFFFFF; margin-bottom: 20px; text-align: center; padding: 20px; border-radius: 3px; display: inline-block; text-decoration: none">View your referral progress</a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At lines 10 and 15, replace `Husto` with your own brand name.
2. At lines 20 and 30, replace `#F46A54` with your own brand color.
3. At line 30, replace `YOUR_CAMPAIGN_ID` with your GrowSurf campaign ID (e.g, `p9josq`)
   1. If you setup a custom domain for your GrowSurf Referral Portal, replace the entire `https://grow.surf/YOUR_CAMPAIGN_ID` instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
4. At line 25, replace [`https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/eveningstew/rewards-inline.png) with your own image.

## Example 13

Display a static image with text next to it.

### What it looks like

![](/files/-MTHz3J_cRYB_xu9fjJP)

### Copy/paste this HTML code into your Salesforce email

```markup
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
  <tr>
    <td align="center" valign="top">
      <table border="0" cellpadding="20" cellspacing="0" width="700">
        <tr>
          <td>
            <img src="https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png" alt="growsurf" width="45px" height="auto" style="float: left; padding-top: 12px; padding-right: 15px">
            <p>Love Husto? Earn a $200 gift card and a free month of Husto Premium for you and a friend! Copy and share your unique link: <a href="{!Contact.growsurf_share_url__c}" style="color: #F46A54;">{!Contact.growsurf_share_url__c}</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
```

### **Customize the contents**

1. At line 7, replace[`https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png`](https://growsurf-blog.s3-us-west-2.amazonaws.com/husto/reward.png)with your own image.
2. At line 8, replace the entire [`https://husto.com?grsf=abc123`](https://husto.com/?grsf=abc123) instead with your Referral Portal URL (e.g, `https://refer.yourwebsite.com`).
3. At line 8, replace `#F46A54` with your own brand color.


# Segment

Track and analyze referral program data alongside product analytics in Segment.

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

After connecting, the Segment integration transmits data to your Segment account, enabling analysis and reporting on your referral program.

For referrers, when they are added to your campaign (e.g., they get a referral link generated) or if they click a social share button (like Facebook or LinkedIn), GrowSurf sends a Segment event. For referred friends, if they sign up using your Share URL, GrowSurf also sends an event.

{% hint style="success" %}
Under the hood, GrowSurf will load the Segment JavaScript library, identify participants (both referrers and referred friends) by their email address, and track events. Rest assured, if Segment is already installed, GrowSurf ensures the library is not loaded twice and prevents duplicate identity calls.
{% endhint %}

## Tracked Events

The following events will be emitted with the `growsurf_` prefix.

| Event                       | Description                            | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `growsurf_referral`         | \[Referred friend] New referral signup | <p>Records when a referred visitor signs up through a referral link.<br><br>This includes:</p><ul><li>Those who submit the form on your website that has referral tracking enabled (via the campaign editor)</li><li>Adding a referred participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul>                                                                                                                                                                                                                                                        |
| `growsurf_referral_trigger` | \[Referred friend] Referral triggered  | Records when a referred participant completes the desired qualifying action, which triggers a referral. Only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral).                                                                                                                                                                                                                                                                                                                                                                                                    |
| `growsurf_signup`           | \[Referrer] New referrer signup        | <p>Records when someone generates a referral link and joins the campaign as a participant.</p><p>This includes:</p><ul><li>Direct signups (someone entering in their email address on the GrowSurf form)</li><li>Passing in an email address via URL parameter <code>?grsf\_email</code></li><li>Passing in an email address via <code>data-grsf-email</code> attribute on an <a href="https://docs.growsurf.com/developer-tools/embeddable-elements">Embeddable Element</a></li><li>Adding a participant via <a href="https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant"><code>growsurf.addParticipant()</code></a></li></ul> |
| `growsurf_share`            | \[Referred] Social media share         | Records when a referrer shares their link by clicking 'Copy Link' or clicking a social media button                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `growsurf_invite`           | \[Referrer] Email invite(s) sent       | Records when a referrer sends invitation(s) via email                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Example Events

Events correspond with the events listed in the [`growsurf.subscribe()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) method. To see examples of the raw `JSON` data, please see the [*Example Response*](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#subscribe-to-event) section.

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Segment integration card and enter your Segment write key.

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Segment installed on your website, you do not need to enter in the Segment write key. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Segment installed.
{% endhint %}

<figure><img src="/files/nN4UVJIVGr2TvQV4CjpR" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Within your Segment account, make sure to whitelist the URLs where these events occur. These are primarily two locations: your referral portal (which might be part of your user portal or web app, or the [GrowSurf-hosted referral portal](https://support.growsurf.com/article/196-where-can-i-find-my-campaigns-dedicated-landing-page)) and the referred friend's landing page (the Share URL you enter in the *Campaign Editor > 5. Installation* step).
{% endhint %}

Once GrowSurf events get emitted, you will see them show up in *Segment > Connections > Sources > Debugger* (see image below).

<figure><img src="/files/weRXDH77Zg2ckM3KKVbo" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Please allow up to 15 minutes of processing time for events to appear (in some cases where Segment is backed up, it can take longer).
{% endhint %}

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If you are seeing a wrongly identified user:

There are 5 different ways that GrowSurf participants can be added to your campaign. Please make sure that the GrowSurf participant email address that you are passing in matches the one you were expecting for the Segment user:

* If you pass in a `data-grsf-email` attribute to a [GrowSurf embeddable element](https://docs.growsurf.com/developer-tools/embeddable-elements)
* If you pass in an email address via URL parameter `?grsf_email`
* If you are using [`growsurf.addParticipant()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#add-participant)
* If you enter an email address in via the GrowSurf form
* If you are a referred friend and you submit the form that has referral tracking configured on it from the *Campaign Editor > 5. Installation* step

#### If you are not receiving events, but were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Segment.
* Make sure to whitelist the URL where events are being tracked (e.g, if your referrer clicks the Facebook share button from *<https://app.yoursite.com/refer>*, you'll want to make sure you whitelist that root domain. If a referred friend signs up on your Share URL, make sure to whitelist the Share URL as well).
* If you just submitted an event, make sure that you've allowed up to 15 minutes for Segment to process the event.

#### If you are receiving events, but were NOT expecting them:

* To ensure no non-GrowSurf-related events are sent to your Segment account, disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you're receiving events without a GrowSurf-related suffix (e.g., `growsurf_`), it indicates that GrowSurf may not be emitting these events. Please check other parts of your code to find where these events might be occurring.


# SendGrid

Update/add SendGrid contacts with their unique share link and referrer information.

## Sync with your SendGrid List <a href="#sync-with-your-mailerlite-group" id="sync-with-your-mailerlite-group"></a>

**Step 2:** Login to SendGrid and [create a new SendGrid API key](https://sendgrid.com/docs/ui/account-and-settings/api-keys/#creating-an-api-key). Make sure the API key has *Full Access* to *Marketing:*

<figure><img src="/files/RQqIJdUZrzVlCPffaxsr" alt=""><figcaption></figcaption></figure>

**Step 2:** In GrowSurf *Campaign Editor > 4. Options > Integrations*, open the SendGrid integration card and enter your SendGrid API key.

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to SendGrid only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to SendGrid.
{% endhint %}

![](/files/-MSzLYu1ttwnTO4O_rL6)

{% hint style="danger" %}
**Getting an error while connecting your API key?**\
As of August 8, 2025, SendGrid requires separate purchases for their *Marketing Campaigns* and *Email API* products. Please make sure that you have paid access to their *Marketing Campaigns* product. Note that if you have purchased both products, you can use the same account (and API key) to send via the *Email API* or through *Marketing Campaigns.*
{% endhint %}

**Step 3:** Once connected, choose the SendGrid list that you want to automatically sync to. GrowSurf will add/update your SendGrid contacts every time a new participant is added or referred to your referral campaign.

**Step 4:** Save changes. You should now see a screen that looks like the one below:

![](/files/-MSzRKzivWABpzMDOP1q)

## Examples

[View our SendGrid tutorials](https://docs.growsurf.com/additional-integrations/sendgrid/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Fields** <a href="#subscriber-fields" id="subscriber-fields"></a>

GrowSurf will automatically create these new custom fields for your SendGrid contacts.

| **Custom fields**                        | **FIELD NAME**                         | **FIELD TYPE** | **Description**                                                                                                                                                                                           | **Example**                                                |
| ---------------------------------------- | -------------------------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                   | `growsurf_share_url`                   | text           | The participant's unique referral link                                                                                                                                                                    | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**              | `growsurf_participant_id`              | text           | The participant's unique GrowSurf ID                                                                                                                                                                      | abc123                                                     |
| **GrowSurf Referral Status**             | `growsurf_referral_status`             | text           | The referral status of the participant\*                                                                                                                                                                  |                                                            |
| **GrowSurf Participant First Name**      | `growsurf_participant_first_name`      | text           | The participant's first name                                                                                                                                                                              | Bob                                                        |
| **GrowSurf Participant Last Name**       | `growsurf_participant_last_name`       | text           | The participant's last name                                                                                                                                                                               | Loblaw                                                     |
| **GrowSurf Referrer First Name**         | `growsurf_referrer_first_name`         | text           | The first name of the participant's referrer (if applicable)                                                                                                                                              | Gavin                                                      |
| **GrowSurf Referrer Last Name**          | `growsurf_referrer_last_name`          | text           | The last name of the participant's referrer (if applicable)                                                                                                                                               | Belson                                                     |
| **GrowSurf Referrer Email**              | `growsurf_referrer_first_email`        | text           | The email address of the participant's referrer (if applicable)                                                                                                                                           | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**        | `growsurf_total_referral_count`        | number         | The participant's all-time referral count                                                                                                                                                                 | 0                                                          |
| **GrowSurf Monthly Referral Count**      | `growsurf_monthly_referral_count`      | number         | The participant's current month referral count                                                                                                                                                            | 19                                                         |
| **GrowSurf Prev Monthly Referral Count** | `growsurf_prev_monthly_referral_count` | number         | The participant's previous month referral count                                                                                                                                                           | 20                                                         |
| **GrowSurf Next Milestone**              | `growsurf_next_milestone`              | text           | The text for the next/upcoming milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**      | `growsurf_next_monthly_milestone`      | text           | The text for the next/upcoming monthly milestone reward (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**          | `growsurf_total_invite_count`          | number         | The participant's all-time invite count                                                                                                                                                                   | 112                                                        |
| **GrowSurf Total Impression Count**      | `growsurf_total_impression_count`      | number         | The participant's all-time impression count                                                                                                                                                               | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these new properties in your SendGrid email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include`growsurf_share_url` in your emails to provoke your contacts to make referrals!

[​Click here to learn more about how to create custom fields in SendGrid.​](https://sendgrid.com/docs/ui/managing-contacts/custom-fields/#creating-custom-fields)

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

* **If the new participant isn't being added to SendGrid, or if they are being added but their unique referral link isn't being synced to SendGrid:**
  * Activity logs will denote if a participant was added to SendGrid or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
* **I am having trouble connecting with my API key:**
  * As of August 8, 2025, SendGrid requires separate purchases for their *Marketing Campaigns* and *Email API* products. Please make sure that you have paid access to their *Marketing Campaigns* product. Note that if you have purchased both products, you can use the same account (and API key) to send via the *Email API* or through *Marketing Campaigns.*




---

[Next Page](/llms-full.txt/1)

