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

# Outclick + Shopnomix — join clicks to conversions

> Pull Affiliate.com outclick data and join it to Shopnomix conversions for the full click-to-sale picture.

This guide shows how to pull individual click rows from Affiliate.com, pull individual
conversions from Shopnomix, and join them on a shared click id to get the full
**click → sale** picture.

## Overview

| Step                | Source                                        | What you get                                             |
| ------------------- | --------------------------------------------- | -------------------------------------------------------- |
| 1. Pull outclicks   | Affiliate.com `GET /v1/reports/outclick`      | Every click, plus product, price, merchant, and `sub_id` |
| 2. Pull conversions | Shopnomix `GET /api/v2/reporting/conversion`  | Revenue and commission status, only when a sale happens  |
| 3. Join             | `cl-` + outclick `id` = conversion `click_id` | Clicks matched to sales                                  |

<Info>
  You don't need to configure anything to make the join work. When Affiliate.com builds a
  Shopnomix outclick redirect, it automatically appends `cid=cl-<id>` to the outbound URL,
  where `<id>` is the same click identifier returned as the `id` field in the outclick
  report. Shopnomix captures that value in its `click_id` field.
</Info>

## Step 1 — Get clicks (Affiliate.com)

Use [`GET /v1/reports/outclick`](/api-reference/reports/outclick) to retrieve individual
click rows, including the product, price, merchant, and `sub_id`.

| Parameter  | Required | Notes                                                                                  |
| ---------- | -------- | -------------------------------------------------------------------------------------- |
| `start_at` | Yes      | Inclusive start. RFC 3339 timestamp or UTC date.                                       |
| `end_at`   | Yes      | Exclusive end. At least 5 minutes in the past; no more than 24 hours after `start_at`. |
| `page`     | No       | Defaults to `1`.                                                                       |
| `per_page` | No       | 1–1000. Defaults to `100`.                                                             |
| `sub_id`   | No       | Exact-match filter.                                                                    |

See the [endpoint reference](/api-reference/reports/outclick) for the full parameter and
response field list.

### Example request

```bash theme={null}
curl -s "https://api.affiliate.com/v1/reports/outclick\
?start_at=2026-07-27T00:00:00Z\
&end_at=2026-07-28T00:00:00Z\
&per_page=100" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <AFFILIATE_COM_API_KEY>"
```

### Example response row

```json theme={null}
{
  "id": "01kyn6z1rg0vnabvnenwfxr25c",
  "created_at": "2026-07-28T20:34:23.000000Z",
  "sub_id": "homepage",
  "product": {
    "id": "8544191246662442858",
    "name": "Bose QuietComfort Headphones",
    "final_price": 229.99,
    "currency": "USD",
    "merchant": { "id": "54419", "name": "Target" },
    "network": { "id": "335", "name": "Impact US" }
  },
  "client": { "country": "US", "device_type": "desktop" }
}
```

<Note>
  **Join key from this row.** Prefix the outclick `id` with `cl-` to get the value Shopnomix
  stores in `click_id`: `cl-01kyn6z1rg0vnabvnenwfxr25c`.
</Note>

## Step 2 — Get conversions (Shopnomix)

Use `GET /api/v2/reporting/conversion` on `https://r.v2i8b.com`. This returns individual
conversions, each with a `click_id` you can join on. Shopnomix does **not** expose a
per-click feed — only conversions.

| Parameter     | Required | Notes                       |
| ------------- | -------- | --------------------------- |
| `campaign_id` | Yes      | Your Shopnomix campaign ID. |
| `start_date`  | Yes      | `YYYY-MM-DD` (inclusive).   |
| `end_date`    | Yes      | `YYYY-MM-DD` (inclusive).   |
| `limit`       | No       | Page size (e.g. `1000`).    |

**Auth:** `Authorization: Bearer <SHOPNOMIX_API_KEY>` · **Pagination:** follow
`meta.next_page` until it is `null`.

### Example request

```bash theme={null}
curl -s "https://r.v2i8b.com/api/v2/reporting/conversion\
?campaign_id=<SHOPNOMIX_CAMPAIGN_ID>\
&start_date=2026-07-27\
&end_date=2026-07-28\
&limit=1000" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <SHOPNOMIX_API_KEY>"
```

### Example response

```json theme={null}
{
  "data": [
    {
      "commission_id": "5349.6782.1234927",
      "click_id": "cl-01kyn6z1rg0vnabvnenwfxr25c",
      "root_domain": "target.com",
      "revenue": "12.50",
      "status": "OPEN",
      "country": "US",
      "source": "homepage",
      "click_time": "2026-07-28T20:34:23",
      "last_updated": "2026-07-28T21:10:00.000000",
      "metadata": {}
    }
  ],
  "meta": {
    "next_page": null
  }
}
```

<Warning>
  Only rows with a non-null `click_id` can be joined. Conversions with `click_id: null` have
  no link back to the outclick report.
</Warning>

## Step 3 — Join for the full picture

Join on the click id, adding the `cl-` prefix to the outclick `id`:

```
conversion.click_id === "cl-" + outclick.id
```

For example, an outclick `id` of `01kyn6z1rg0vnabvnenwfxr25c` matches a Shopnomix
`click_id` of `cl-01kyn6z1rg0vnabvnenwfxr25c`.

| From Outclick                                    | From Shopnomix                                         |
| ------------------------------------------------ | ------------------------------------------------------ |
| Every click + product, price, merchant, `sub_id` | Revenue + commission status (only when a sale happens) |
| Outclick row with no matching conversion         | A click with no sale (yet)                             |
| —                                                | Conversion with `click_id: null` → cannot be joined    |

### Pseudo-code

```text theme={null}
outclicks    = GET api.affiliate.com /v1/reports/outclick?...
conversions  = GET r.v2i8b.com /api/v2/reporting/conversion?...

by_click_id = index conversions by click_id

for row in outclicks:
    cid  = "cl-" + row.id
    sale = by_click_id.get(cid)          # may be null

    # full picture = click fields + sale.revenue / sale.status
```
