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

# PartnerStack and ClickFlare Integration Guide

> Track PartnerStack rewards in ClickFlare: pass the click ID as a sid sub ID and relay PartnerStack's JSON postbacks through Zapier, Make or n8n.

![PartnerStack and ClickFlare Integration](https://mintcdn.com/clickflare/gS923ib4WFySqxSL/images/integrations/covers/partnerstack.png?fit=max\&auto=format\&n=gS923ib4WFySqxSL\&q=85\&s=88a3d7422405e0ff4a1957b566bbc8d9)

PartnerStack is a partner platform that software companies use to run their affiliate and referral programs. As a partner, you join programs in one PartnerStack dashboard, get a referral link per program and earn rewards when the people you refer sign up or pay.

To track PartnerStack programs in ClickFlare, the click ID has to travel in both directions:

* **The referral link** carries the ClickFlare click ID out, as a PartnerStack **sub ID** in `sid`.
* **PartnerStack's postback** brings it back with each reward, inside a JSON body, in `customer.sub_ids`.

There is no ClickFlare template for PartnerStack, and you can't paste a ClickFlare postback URL into PartnerStack. PartnerStack's postbacks are HTTP POST requests with a fixed JSON body and its own key names. A relay in the middle (Zapier, Make or n8n) reads the event and posts the values to ClickFlare under ClickFlare's keys. This guide covers the setup, the field mapping, reward statuses and how to check it all works.

***

## At a glance

To set up PartnerStack with ClickFlare:

1. Set up your domain and custom conversions.
2. Add PartnerStack as Other affiliate network.
3. Add sid to your referral link.
4. Build the relay.
5. Register the postback in PartnerStack.

Each step is explained in [Setup](#setup).

| | PartnerStack + ClickFlare |
| - | - |
| **How it connects** | PartnerStack postback + Zapier, Make or n8n relay |
| **What reaches ClickFlare** | Rewards with amount and status per click |
| **Timing** | Real time, per reward event |
| **Key parameters** | `sid={cf_click_id}`, `customer.sub_ids`, `amount`, `reward_status` |
| **Works with** | reward.created and reward.updated events |
| **Good to know** | Amounts arrive in USD cents. Divide by 100 in the relay. |

***

## How the data flows

```text theme={null}
Ad click
  → https://trk.yourdomain.com/cf/r/CAMPAIGN?...
     (ClickFlare records the click and generates the click ID)
  → [optional lander → CTA uses the ClickFlare click URL]
  → https://company.grsm.io/PartnerABC?sid=CF_CLICK_ID
     (PartnerStack captures the sub ID at the click)
  → Visitor signs up or pays on the company's site
  → PartnerStack POSTs a JSON event to your relay:
     event = reward.created, data.amount = 5000, data.customer.sub_ids = ["CF_CLICK_ID"]
  → The relay maps the fields and posts to ClickFlare:
     POST https://trk.yourdomain.com/cf/cv
     {"cf_click_id": "CF_CLICK_ID", "payout": 50, "txid": "rwrd_GWCpiWvW3ZekLe", "ct": "approved"}
     (ClickFlare matches the reward to the original click)
```

| Leg | Who sends it | Format | What it carries |
| - | - | - | - |
| **Referral link** | The visitor's browser, via ClickFlare's redirect | URL parameter | `sid={cf_click_id}` |
| **PartnerStack postback** | PartnerStack, to your relay | Fixed JSON body (POST) | Event, reward amount in cents, status, sub IDs |
| **ClickFlare postback** | Your relay, to ClickFlare | JSON POST to `/cf/cv` | `cf_click_id`, `payout`, `txid`, `ct` |

> [!NOTE]
>
> **Link = their parameter + your token. Postback = your parameter + their value.** PartnerStack's parameter is `sid`. The value comes back as the first entry of `customer.sub_ids`, and the relay sends it to ClickFlare as `cf_click_id`.

***

## What you'll need

* A ClickFlare account with your **own tracking domain**. Shared domains get flagged. See [Tracking domains](/docs/en/settings/tracking-domains.md).
* A PartnerStack partner account, approved for the program you want to promote.
* An account on a relay tool: [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md), [Make](/docs/en/integrations/make-click-flare-integration-guide.md) or [n8n](/docs/en/integrations/n8n-click-flare-integration-guide.md). A small script on your own server works too.

***

## Setup

**1. Set up your own tracking domain**

Add a custom tracking domain first, for example `trk.yourdomain.com`. The relay posts conversions to this domain. See [Tracking domains](/docs/en/settings/tracking-domains.md).

**2. Create the custom conversions**

Go to **Settings → Custom Conversions** and create one custom conversion per reward status you want as a column, for example `pending`, `approved` and `declined`. The relay sends these names in `ct`, and they must match exactly. See [Custom conversions](/docs/en/settings/custom-conversions.md) and [Reward statuses](#reward-statuses).

**3. Create the campaign**

Go to **Campaigns → New Campaign**, choose **Redirect tracking**, pick your traffic source and select your tracking domain. See [Creating a campaign](/docs/en/campaigns/creating-a-campaign-in-click-flare.md).

**4. Add PartnerStack as an affiliate network**

While you create the offer, open its **Affiliate Network** field and create a new network. Pick **Other affiliate network** and name it "PartnerStack". You don't need its postback URL: the relay posts to ClickFlare directly. Set **Payout currency** to **USD**, because PartnerStack reports reward amounts in US dollars.

**5. Get your referral link**

In PartnerStack, click **Switch programs** in the top right and pick the program. Open the **Links** tab and copy your referral link. It looks like this:

```text theme={null}
https://companyname.grsm.io/PartnerABC
```

If the program supports custom links, you can use one, but don't put the sub ID inside the custom link text. Sub IDs are always added at the end.

**6. Create the offer with the click ID in sid**

In the offer form, paste the link into **Offer URL** with the sub ID at the end:

```text theme={null}
https://companyname.grsm.io/PartnerABC?sid={cf_click_id}
```

Write the parameter yourself and leave **Append Click ID to Offer Url** off. Set the payout to **Auto** so ClickFlare uses the value the relay sends.

![The Offer URL field of the ClickFlare New Offer form with a PartnerStack link ending in sid=\{cf\_click\_id}](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/partnerstack/clickflare-partnerstack-offer-url.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=513021633b927ec60002cf7df3704b5a)

PartnerStack sub IDs take up to 255 characters. For more than one, use `sid1`, `sid2`, `sid3` and so on, for example `?sid1={cf_click_id}&sid2=facebook`. Keep the click ID in the first one so the relay can find it.

> [!WARNING]
>
> Write `{cf_click_id}` with braces. PartnerStack also notes that sub IDs may not work with every company you partner with. Run a test click and signup on each new program before you scale.

**7. Build the relay**

Create a webhook trigger in your relay tool and copy its URL:

* **Zapier**: Webhooks by Zapier → **Catch Hook**.
* **Make**: Webhooks → **Custom webhook**.
* **n8n**: a **Webhook** node, method POST. Use the production URL.

Then add the step that posts to ClickFlare, with the mapping in [Field mapping](#field-mapping):

```bash theme={null}
curl -X POST 'https://trk.yourdomain.com/cf/cv' \
  -H 'Content-Type: application/json' \
  --data '{"cf_click_id": "CF_CLICK_ID", "payout": 50, "txid": "rwrd_GWCpiWvW3ZekLe", "ct": "approved"}'
```

Each relay guide shows this step in its own tool: [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md), [Make](/docs/en/integrations/make-click-flare-integration-guide.md), [n8n](/docs/en/integrations/n8n-click-flare-integration-guide.md).

**8. Register the postback in PartnerStack**

Go to `https://dash.partnerstack.com/settings/postbacks`, or open your profile settings and then **Postback**. Create a new postback:

| Field | What to enter |
| - | - |
| **Endpoint URL** | The relay's webhook URL |
| **Name** | Something that says where it goes, for example "ClickFlare relay" |
| **Event Types** | `reward.created` and `reward.updated`. Add others only if you need them. |

Save it, then send the test event. The relay should receive `{"event": "test", "data": {"message": "Test event sent!"}}`. Add a filter in the relay that skips `test` events so they never reach ClickFlare.

**9. Add a lander (optional)**

If you send traffic through a lander or comparison page, its CTA must use the **ClickFlare click URL**, not the PartnerStack link. ClickFlare then adds the click ID when it redirects.

**10. Save the campaign and launch**

Save the campaign, copy the campaign URL from the **Tracking** tab and use it in your ads. Run the checks in [Verify the setup](#verify-the-setup) first.

***

## Field mapping

PartnerStack's reward events look like this (from its postback docs):

```json theme={null}
{
  "event": "reward.created",
  "data": {
    "key": "rwrd_GWCpiWvW3ZekLe",
    "amount": 5000,
    "reward_status": "approved",
    "source": "transaction",
    "company": { "key": "co_1IfoLwRHJjObNrdv", "name": "IdeaAI" },
    "customer": { "key": "cus_1IfoLwRHJjObNrdv", "sub_ids": ["CF_CLICK_ID"] }
  }
}
```

The relay maps it like this:

| ClickFlare key | PartnerStack field | Notes |
| - | - | - |
| `cf_click_id` | `data.customer.sub_ids[0]` | `sub_ids` is a list. The click ID is the first entry if it's in `sid` or `sid1`. |
| `payout` | `data.amount` ÷ 100 | PartnerStack sends cents in USD. 5000 means 50.00. |
| `txid` | `data.key` | The reward key, for example `rwrd_GWCpiWvW3ZekLe`. Keeps each reward its own conversion. See [Reward statuses](#reward-statuses). |
| `ct` | `data.reward_status` | Or a fixed name such as `reward`. See [Reward statuses](#reward-statuses). |
| `param1` (optional) | `data.company.name` | The program, so you can split rewards by company. |
| `param2` (optional) | `data.source` | What triggered the reward: `transaction`, `lead`, `deal` and others. |

> [!NOTE]
>
> Make and n8n can read `sub_ids[0]` and divide by 100 in the mapping itself. In Zapier, add a Formatter by Zapier step for the division, or a Code by Zapier step for both.

***

## Reward statuses

Each reward carries a `reward_status`: `hold`, `pending`, `approved`, `declined` or `paid`. PartnerStack sends `reward.updated` when it changes. Sending the status as `ct` gives you each stage as its own column in ClickFlare:

| `reward_status` | `ct` | `payout` |
| - | - | - |
| `hold`, `pending` | `pending` | 0, or the amount if you want to see expected revenue |
| `approved` | `approved` | The reward amount |
| `declined` | `declined` | 0 |
| `paid` | skip, or `paid` | Already counted under `approved` |

Pick one stage to carry the money, usually `approved`, so the same reward isn't counted twice in revenue. Then send only that custom conversion on to your traffic source.

**Several rewards from one customer.** ClickFlare keeps one conversion per click ID and custom conversion. A program that pays per transaction can create several `approved` rewards for the same customer. Without a transaction ID each would replace the last, so send the reward key `data.key` as `txid` in the JSON body. A different `txid` makes each reward its own conversion. If your relay uses the GET postback instead, put it in the URL:

```text theme={null}
https://trk.yourdomain.com/cf/cv?click_id=CF_CLICK_ID&payout=50&ct=approved&txid=rwrd_GWCpiWvW3ZekLe
```

See [Postback parameters](/docs/en/tracking/click-flare-parameters-in-postback-urls.md).

***

## Other events

PartnerStack postbacks also cover action events (`action.created`, `action.updated`), customer events (`customer.created`, `customer.updated`, `customer.deleted`) and transaction events (`transaction.created`, `transaction.updated`). All of them carry `customer.sub_ids`. Two are useful:

* `customer.created` can report a signup as its own custom conversion, for example `ct=signup` with payout 0.
* `transaction.created` carries the customer's payment in `amount_usd` (cents). That is revenue for the company, not your reward, so don't use it as payout.

***

## Verify the setup

**1. Click through the campaign**

Open the ClickFlare campaign URL. When the company's site loads, check that the first request to `grsm.io` had `sid=` followed by a real click ID, not the text `{cf_click_id}`.

**2. Sign up as a test customer**

Sign up in an incognito window, as PartnerStack suggests for testing referral links. In PartnerStack's **Reporting** tab, open **Commissions** or **Customer performance**. The Sub ID columns on the right show the click ID once a commission exists.

**3. Check the relay and ClickFlare**

When the reward event arrives, check the relay's run: `cf_click_id` should be the click ID and `payout` should be in dollars. In ClickFlare, the conversion appears on the campaign under the custom conversion you sent, and in **Logs → Event Logs**.

***

## Troubleshooting

> [accordion] Rewards show in PartnerStack but not in ClickFlare
>
> * **The postback isn't subscribed to reward events.** Open it in PartnerStack's postback settings and check **Event Types**.
> * **`sub_ids` is empty.** The link has no `sid`, the lander CTA goes straight to PartnerStack, or this company doesn't support sub IDs.
> * **The relay reads the wrong entry.** If you use several sub IDs, check which position holds the click ID.
> * **The `ct` doesn't match.** `ct` must match a custom conversion name exactly, including case.
>
> See [Troubleshooting S2S postbacks](/docs/en/tracking/troubleshooting-s2s-postback-url-in-clickflare.md).

> [accordion] The payout is 100 times too high
>
> The relay sends `data.amount` as it is. PartnerStack uses cents: divide by 100.

> [accordion] Only one reward per customer shows in ClickFlare
>
> Repeat rewards with the same `ct` and no `txid` replace each other. Add `txid` to the body, set to `data.key`. See [Reward statuses](#reward-statuses).

> [accordion] Test events show up as conversions
>
> Add a filter in the relay that only continues when `event` starts with `reward.`.

***

## FAQ

> [accordion] Does ClickFlare integrate with PartnerStack?
>
> Yes, through a relay. You pass the click ID as a sid sub ID, and Zapier, Make or n8n turns PartnerStack's reward postback into a ClickFlare conversion.

> [accordion] Why do I need a relay?
>
> PartnerStack posts a fixed JSON body with its own keys, such as `amount` and `customer.sub_ids`. ClickFlare's JSON endpoint expects `cf_click_id` and `payout`. Something has to translate, and convert cents to dollars.

> [accordion] Can I promote several PartnerStack programs?
>
> Yes. One PartnerStack postback covers all your partnerships, and one relay can serve all of them. Create one offer per program in ClickFlare, each with its own link and `sid={cf_click_id}`. Send `data.company.name` in a `param` to split rewards by program.

> [accordion] Where do I see sub IDs in PartnerStack?
>
> In the **Reporting** tab, under **Commissions** or **Customer performance**, in the Sub ID columns on the right.

***

## Related

> [card] [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md)
>
> Relay with a Zap

> [card] [Make](/docs/en/integrations/make-click-flare-integration-guide.md)
>
> Relay with a scenario

> [card] [n8n](/docs/en/integrations/n8n-click-flare-integration-guide.md)
>
> Relay with a workflow


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.