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

# Postbacks

> Set up postback notifications for CPL campaigns on OnlyTraffic. Learn about events, URL macros, and integration with external trackers.

## What Are Postbacks?

Postbacks are **HTTP notifications** that OnlyTraffic sends to your server or tracking platform when specific events occur — like a new subscriber joining or a transaction happening. They let you track conversions in real time without manually checking the dashboard.

## Setup Levels

You can configure postbacks at two levels:

| Level                       | Scope                                     | Use Case                     |
| --------------------------- | ----------------------------------------- | ---------------------------- |
| **Account-level (Default)** | Applies to all your campaigns             | Set once, works everywhere   |
| **Campaign-level**          | Overrides default for a specific campaign | Custom tracking per campaign |

Campaign-level postbacks take priority over account-level settings when both are configured.

To set up default postbacks, go to your **account settings**. To configure campaign-level postbacks, edit the specific campaign.

## Available Events

### `new_subscriber`

Fired when a new fan subscribes through your campaign.

### `new_transaction`

Fired when a fan makes a purchase (tip, paid message, paid post, subscription, resubscription, or stream).

### `marketing_stop`

Fired when a campaign or CPL order is stopped (completed, cancelled, or paused).

## URL Template & Macros

Build your postback URL using macros that get replaced with actual values when the event fires.

### Event Macro

| Macro       | Description                                                          |
| ----------- | -------------------------------------------------------------------- |
| `{{event}}` | Event name: `new_subscriber`, `new_transaction`, or `marketing_stop` |

### Campaign Macros

| Macro                      | Description                                                       |
| -------------------------- | ----------------------------------------------------------------- |
| `{{campaign.id}}`          | Marketing campaign ID                                             |
| `{{campaign.name}}`        | Campaign name (URL-encoded)                                       |
| `{{campaign.date_create}}` | Campaign creation date (UNIX timestamp)                           |
| `{{campaign.onlyfans_id}}` | OnlyFans model account user ID                                    |
| `{{campaign.order_id}}`    | CPL order ID (for `marketing_stop` event)                         |
| `{{campaign.date_finish}}` | Campaign finish date, UNIX timestamp (for `marketing_stop` event) |

### Subscriber Macros

Available for `new_subscriber` and `new_transaction` events:

| Macro                           | Description                                  |
| ------------------------------- | -------------------------------------------- |
| `{{subscriber.id}}`             | OnlyFans subscriber user ID                  |
| `{{subscriber.campaign_id}}`    | Marketing campaign ID                        |
| `{{subscriber.onlyfans_id}}`    | OnlyFans model account user ID               |
| `{{subscriber.name}}`           | Subscriber's name (URL-encoded)              |
| `{{subscriber.revenue}}`        | Total commission earned from this subscriber |
| `{{subscriber.date_subscribe}}` | Subscription date (UNIX timestamp)           |
| `{{subscriber.click_id}}`       | Your click ID (if using tracking links)      |

### Transaction Macros

Available for the `new_transaction` event:

| Macro                           | Description                                                                         |
| ------------------------------- | ----------------------------------------------------------------------------------- |
| `{{transaction.id}}`            | Unique transaction ID                                                               |
| `{{transaction.campaign_id}}`   | Marketing campaign ID                                                               |
| `{{transaction.subscriber_id}}` | OnlyFans subscriber user ID                                                         |
| `{{transaction.onlyfans_id}}`   | OnlyFans model account user ID                                                      |
| `{{transaction.type}}`          | Type: `tip`, `message`, `post`, `subscription`, `resubscription`, `stream`, `other` |
| `{{transaction.amount}}`        | Total transaction amount                                                            |
| `{{transaction.revenue}}`       | Your commission from this transaction                                               |
| `{{transaction.date}}`          | Transaction date (UNIX timestamp)                                                   |

### Click Macros

Available when using OT Tracking Links or Smart Links:

| Macro                         | Description                                            |
| ----------------------------- | ------------------------------------------------------ |
| `{{click.click_id}}`          | Internal click ID                                      |
| `{{click.url}}`               | OnlyFans destination URL                               |
| `{{click.external_click_id}}` | Your custom click ID (passed via `click_id` parameter) |
| `{{click.expires_ts}}`        | URL expiration date (UNIX timestamp)                   |
| `{{click.expires}}`           | URL expiration date (ISO 8601 string)                  |

## HTTP Methods

| Method   | Behavior                                                |
| -------- | ------------------------------------------------------- |
| **GET**  | Macros are placed directly in the URL query string      |
| **POST** | Macros can be used in both the URL and the request body |

## Custom Headers

You can add custom HTTP headers to your postback requests. This is useful for:

* Authentication tokens (e.g., `Authorization: Bearer your_token`)
* Content type specification (e.g., `Content-Type: application/json`)
* Any custom headers your tracking platform requires

## Example Postback URLs

<CodeGroup>
  ```text Simple GET theme={null}
  https://your-tracker.com/postback?event={{event}}&sub_id={{subscriber.id}}&revenue={{subscriber.revenue}}&click_id={{click.external_click_id}}
  ```

  ```text Voluum theme={null}
  https://your-voluum-domain.com/postback?cid={{click.external_click_id}}&payout={{subscriber.revenue}}
  ```

  ```text Binom theme={null}
  https://your-binom-domain.com/click/pb?cnv_id={{click.external_click_id}}&payout={{subscriber.revenue}}&event={{event}}
  ```

  ```text Keitaro theme={null}
  https://your-keitaro-domain.com/postback?subid={{click.external_click_id}}&sum={{subscriber.revenue}}&status={{event}}
  ```
</CodeGroup>

## Testing Postbacks

You can test your postback configuration before going live:

<Steps>
  <Step title="Set up your postback URL">
    Configure your postback URL with the desired macros.
  </Step>

  <Step title="Click Send Test">
    Use the **Send Test** button in the postback configuration form. The system will send a test request with sample data to your URL.
  </Step>

  <Step title="Verify receipt">
    Check that your server or tracking platform received the test postback and parsed the parameters correctly.
  </Step>
</Steps>

<Tip>
  Use a service like [webhook.site](https://webhook.site) to inspect postback requests during setup. This helps you verify the exact data being sent before connecting to your production tracker.
</Tip>

<Info>
  Postbacks work best with [OT Tracking Links](/partners/tracking-links) that support the `click_id` parameter. This allows you to match each conversion back to the exact click in your external tracker.
</Info>
