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

# Hotmart and ClickFlare Integration Guide

> Track Hotmart sales in ClickFlare: pass the click ID in src or sck and relay Hotmart's purchase webhook to ClickFlare through Zapier, Make or n8n.

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

Hotmart is a platform for digital products such as courses, ebooks and memberships. Creators sell their products on it, and affiliates promote them through Hotmart links. Hotmart reports every sale, refund and chargeback through its **Webhook** tool.

To track Hotmart sales in ClickFlare, the click ID has to travel in both directions:

* **The Hotmart link** carries the ClickFlare click ID out, in Hotmart's tracking parameter `src` (sales page) or `sck` (checkout).
* **The Hotmart webhook** brings it back with every purchase event, inside a JSON body.

There is no ClickFlare template for Hotmart, and you can't paste a ClickFlare postback URL into Hotmart. Hotmart's webhook always sends the same fixed JSON body with its own field names, and ClickFlare expects its own keys. A relay in the middle (Zapier, Make or n8n) reads Hotmart's event and posts the values to ClickFlare under ClickFlare's keys. This guide covers the full setup, the field mapping and how to handle refunds.

***

## At a glance

To set up Hotmart with ClickFlare:

1. Set up your domain and custom conversions.
2. Add Hotmart as Other affiliate network.
3. Put the click ID in src.
4. Build the relay.
5. Create the Hotmart webhook.

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

| | Hotmart + ClickFlare |
| - | - |
| **How it connects** | Hotmart webhook + Zapier, Make or n8n relay |
| **What reaches ClickFlare** | Sales, refunds and chargebacks with commission |
| **Timing** | Real time, per webhook event |
| **Key parameters** | `src={cf_click_id}`, `sck`, `cf_click_id`, `payout`, `ct` |
| **Works with** | Affiliate links, sales pages and checkout links |
| **Good to know** | No ClickFlare template. Hotmart can't call a postback URL. |

***

## 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 presell lander → CTA uses the ClickFlare click URL]
  → https://go.hotmart.com/XYZ?src=CF_CLICK_ID
     (Hotmart stores the click ID as the origin of the sale)
  → Visitor buys on Hotmart's checkout
  → Hotmart sends a webhook (JSON) to your relay:
     event = PURCHASE_APPROVED, data.purchase.origin.src = 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": 12.5, "txid": "HP17715690036014", "ct": "purchase"}
     (ClickFlare matches the sale to the original click)
```

| Leg | Who sends it | Format | What it carries |
| - | - | - | - |
| **Hotmart link** | The visitor's browser, via ClickFlare's redirect | URL parameter | `src={cf_click_id}` or `sck={cf_click_id}` |
| **Hotmart webhook** | Hotmart, to your relay | Fixed JSON body | Event name, origin codes, commissions, transaction code |
| **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.** Hotmart's parameter is `src` (or `sck`). The value comes back in the webhook as `purchase.origin.src` (or `purchase.origin.sck`), 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 Hotmart account with access to the **Webhook** tool. Hotmart's developer docs describe the webhook payload for creators, co-creators and affiliates.
* 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, so changing it later means updating the relay too. 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 Hotmart event you want to see as its own column, for example `purchase`, `refund` and `chargeback`. The relay sends these names in `ct`, and they must match exactly. See [Custom conversions](/docs/en/settings/custom-conversions.md).

**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 Hotmart 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 "Hotmart". You don't need its postback URL: the relay posts to ClickFlare directly. Set **Payout currency** to the currency of your Hotmart commission.

**5. Create the offer with the click ID in src**

In the offer form, paste your Hotmart link into **Offer URL** and add the click ID in Hotmart's tracking parameter:

```text theme={null}
https://go.hotmart.com/XYZ?src={cf_click_id}
```

Hotmart uses two parameters:

| Parameter | Use it when | Comes back in the webhook as |
| - | - | - |
| `src` | You send traffic to an affiliate link (HotLink) or a sales page | `purchase.origin.src` |
| `sck` | You send traffic straight to the checkout (`pay.hotmart.com`) | `purchase.origin.sck` |

Write the parameter yourself and leave **Append Click ID to Offer Url** off. The Other affiliate network has no Hotmart parameter to add. 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 Hotmart link ending in src=\{cf\_click\_id}](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/hotmart/clickflare-hotmart-offer-url.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=bd7ad17a0d8171443b63f90fd04cc913)

> [!WARNING]
>
> Write `{cf_click_id}` with braces. Without them Hotmart stores the literal text, and the sale can't be matched to a click. Keep the click ID alone in `src`. Hotmart suggests pipe-separated values for its own reports, but extra text in the field breaks the match in ClickFlare.

**6. 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": 12.5, "txid": "HP17715690036014", "ct": "purchase"}'
```

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).

**7. Create the Hotmart webhook**

In your Hotmart account, open the **Webhook** tool and create a new configuration. Hotmart's "Using Webhooks" developer page links to it with **Create a setting**.

1. Paste the relay's URL as the receiving address.
2. Choose version **2.0.0**. The field names in this guide come from that version.
3. Select the products to track.
4. Select the purchase events: at least `PURCHASE_APPROVED`, plus `PURCHASE_REFUNDED` and `PURCHASE_CHARGEBACK` if you track refunds.
5. Save, then send a test event to the relay.

Hotmart keeps the event history for up to 60 days, so you can check what it sent.

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

If you send traffic through a presell page, its CTA must use the **ClickFlare click URL**, not the Hotmart link. ClickFlare then adds the click ID when it redirects to Hotmart.

**9. 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) before you spend on traffic.

***

## Field mapping

Hotmart's version 2.0.0 webhook sends the event name at the top level and the sale in `data`. The relay maps it like this:

| ClickFlare key | Hotmart field | Notes |
| - | - | - |
| `cf_click_id` | `data.purchase.origin.src` | Use `data.purchase.origin.sck` if your link uses `sck`. |
| `payout` | `data.commissions[].value` | `commissions` is a list. Pick the entry whose `source` is `AFFILIATE` if you're the affiliate, `PRODUCER` if you're the creator. |
| `txid` | `data.purchase.transaction` | Hotmart's transaction code, for example `HP17715690036014`. Keeps each sale its own conversion and stops a resent webhook from counting twice. |
| `ct` | Set from `event` | For example `PURCHASE_APPROVED` → `purchase`, `PURCHASE_REFUNDED` → `refund`. |
| `param1` (optional) | `data.product.name` | Any extra value you want in reports. `param1` to `param20` are free. |

Other fields you may want:

* `data.commissions[].currency_value` is the commission currency (ISO code such as `BRL` or `USD`). Match it to the affiliate network's **Payout currency** in ClickFlare.
* `data.purchase.price.value` is what the buyer paid, not what you earn. Use the commission for ROI.
* `data.purchase.order_bump.is_order_bump` tells you whether the sale was an order bump.

> [!NOTE]
>
> Pulling one entry out of the `commissions` list works natively in Make and n8n. In Zapier, a list arrives as line items. Add a Code by Zapier or Formatter by Zapier step that picks the commission for your source before the POST step.

***

## Events, refunds and repeat sales

Hotmart's purchase webhook can send `PURCHASE_APPROVED`, `PURCHASE_COMPLETE`, `PURCHASE_CANCELED`, `PURCHASE_BILLET_PRINTED`, `PURCHASE_PROTEST`, `PURCHASE_REFUNDED`, `PURCHASE_CHARGEBACK`, `PURCHASE_EXPIRED` and `PURCHASE_DELAYED`. A sensible start:

| Hotmart event | `ct` | `payout` |
| - | - | - |
| `PURCHASE_APPROVED` | `purchase` | Your commission |
| `PURCHASE_REFUNDED` | `refund` | Your commission as a negative number |
| `PURCHASE_CHARGEBACK` | `chargeback` | Your commission as a negative number |

Each `ct` is its own column in ClickFlare, so you see sales, refunds and chargebacks side by side. A negative payout subtracts the refunded commission from revenue. Check Hotmart's event descriptions before you map the other events. A boleto that is printed but never paid, for example, isn't a sale.

**Repeat sales on the same click.** ClickFlare keeps one conversion per click ID and custom conversion. Without a transaction ID, a second `purchase` on the same click, such as a subscription renewal, replaces the first one. Send Hotmart's transaction code in `txid` in the JSON body, as in [Field mapping](#field-mapping). A different `txid` makes each call its own conversion, and the same `txid` replaces the earlier one. If your relay uses the GET postback instead, put the code in the URL:

```text theme={null}
https://trk.yourdomain.com/cf/cv?click_id=CF_CLICK_ID&payout=12.5&ct=purchase&txid=HP17715690036014
```

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

***

## Security

Hotmart sends a unique account token, the **hottok**, in the `X-HOTMART-HOTTOK` header of every webhook and recommends checking it before you process the data. If your relay can read request headers, add a filter that stops the run when the header doesn't match your hottok. This keeps anyone who finds your relay URL from posting fake sales.

***

## Verify the setup

**1. Click through the campaign**

Open the ClickFlare campaign URL. When Hotmart loads, check the address bar: `src=` must be followed by a real click ID, not the text `{cf_click_id}`.

**2. Check the payload**

Send a test from Hotmart's Webhook tool, or make a real sale. In the relay's history, check that `data.purchase.origin.src` holds the click ID and that the commission is where you mapped it.

**3. Check ClickFlare**

The sale should appear on the campaign under the `purchase` custom conversion with your commission. In **Logs → Event Logs**, you can see the conversion as ClickFlare received it.

> [!TIP]
>
> While you set up, open the first real webhook in the relay's history and check that `purchase.origin.src` (or `sck`) holds the click ID. Hotmart's sales report also shows the `src` value in its **Source** field, so [Conversion Upload](/docs/en/settings/conversion-upload.md) can fill a gap from a file if you ever need it.

***

## Troubleshooting

> [accordion] Sales show in Hotmart but not in ClickFlare
>
> * **The webhook doesn't reach the relay.** Check Hotmart's event history for the configuration and the relay's run history.
> * **`origin.src` is empty.** The link has no `src`, the lander CTA goes straight to Hotmart, or you used `sck` on the link and mapped `src` (or the other way round).
> * **The relay posts the wrong value.** Look at the relay's last run. `cf_click_id` must be the click ID alone.
> * **The `ct` doesn't match.** `ct` must match a custom conversion name exactly, including case.
> * **The relay posts to the wrong domain.** Use your own tracking domain with `/cf/cv`.
>
> See [Troubleshooting S2S postbacks](/docs/en/tracking/troubleshooting-s2s-postback-url-in-clickflare.md).

> [accordion] The payout is 0 or too high
>
> * 0: the relay didn't find the commission. Check the path to `data.commissions` and the `source` you filter on.
> * Too high: the relay sends `purchase.price.value` (what the buyer paid) or the creator's commission instead of yours.
> * Wrong currency: set **Payout currency** on the Hotmart affiliate network to the commission currency.

> [accordion] Renewals or second purchases replace the first sale
>
> The relay doesn't send `txid`, so a second `purchase` on the same click replaces the first. Add `txid` to the body, set to `data.purchase.transaction`. See [Events, refunds and repeat sales](#events-refunds-and-repeat-sales).

> [accordion] ClickFlare receives the literal text cf\_click\_id
>
> The offer URL has the token without braces. It must be `src={cf_click_id}`.

***

## FAQ

> [accordion] Does ClickFlare integrate with Hotmart?
>
> Yes, through a relay. You pass the click ID in src or sck, and Zapier, Make or n8n turns Hotmart's purchase webhook into a ClickFlare conversion.

> [accordion] Why can't I paste the ClickFlare postback into Hotmart?
>
> Hotmart's webhook sends a fixed JSON body to a URL. It has no macros to put values into a postback URL, and it doesn't use ClickFlare's key names. The relay does that translation.

> [accordion] src or sck?
>
> `src` for affiliate links and sales pages, `sck` for links that go straight to the checkout. Use one per offer and map the matching field in the relay.

> [accordion] Do I need Zapier, Make or n8n?
>
> You need something that receives Hotmart's JSON and posts ClickFlare's JSON. Any of the three works, as does your own script. n8n can be self-hosted if you prefer to keep sales data on your own server.

> [accordion] Can I send Hotmart sales on to my traffic source?
>
> Yes. Once ClickFlare records the sale, it can send it to the traffic source through the traffic source's postback or conversion API. Map only the `purchase` custom conversion there if you don't want refunds sent.

***

## 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.