# Deep links, smartlinks and feeds

> For AI agents: the index of these docs is at https://referalli.com/docs/llms.txt (every page it lists has a Markdown version like this one).

Network-style tools for partners: link to any shop page, one link that picks the best offer, product and coupon feeds, and the traffic sources a program allows.

The tools affiliate networks give publishers, built into every Referalli program.

## Deep links

Add `url` to any partner link to land on a specific page instead of the link's destination:

```
https://referalli.com/go/<orgToken>/<code>?url=https%3A%2F%2Fshop.example%2Fproducts%2Fmug&sub=newsletter
```

The click is tracked exactly as usual, with `sub` kept. The target must be `https` and its host must belong to the program: the host of the link's own destination or the program's default destination, a verified link or portal domain, or the host of an active [catalog](https://referalli.com/docs/product-catalog) item, including their subdomains. Anything else is ignored and the visitor goes to the link's normal destination, so a deep link can never redirect off the shop.

To check a target before sharing, partners call `POST /v1/partner/links/deep` with `{ "linkId": "lnk_...", "url": "https://shop.example/..." }`. It returns `{ "url": "..." }`, or `400 validation_error` with `allowedHosts` when the host isn't allowed. The portal's Links page builds deep links too.

## Smartlinks

A smartlink is one partner link that sends each visitor to the best of several programs the partner is approved in:

```bash
curl -X POST https://referalli.com/v1/partner/smartlinks \
  -d '{ "name": "VPN offers", "programIds": ["prg_a", "prg_b"], "strategy": "epc" }'
```

Share `https://referalli.com/sl/<code>` (optionally with `?sub=`). On each visit it drops programs whose [country targeting](https://referalli.com/docs/commission-rules) excludes the visitor, then picks:

- `epc`: the highest earnings per click for this partner over the last 30 days (the program-wide figure when the partner has no clicks there yet);
- `rotate`: the next program in turn.

It then redirects through the partner's normal tracked link for that program. A smartlink takes 2 to 20 programs. Smartlinks are managed from the portal's Smartlinks page or with a partner session (`GET`, `POST`, `DELETE /v1/partner/smartlinks`); partner API tokens can't manage them yet.

## Product and coupon feeds

Approved partners download a program's catalog with their own tracked link on every item, for comparison sites, apps and price tools:

```bash
curl "https://referalli.com/v1/partner/feeds/products?programId=prg_...&format=csv" -H "Authorization: Bearer rpt_..."
curl "https://referalli.com/v1/partner/feeds/coupons?programId=prg_...&format=json" -H "Authorization: Bearer rpt_..."
```

Product rows carry the link, price, image, category, stock and what the item earns (at most 2,000 items). Coupon rows are the partner's own codes with a tracking link. JSON is the default; `format=csv` returns `text/csv`. The portal's Products page has download buttons. A partner API token with read scope works.

## Allowed traffic sources

A program can say how partners may promote it:

```bash
curl -X PATCH https://referalli.com/v1/programs/prg_... \
  -H "Authorization: Bearer rk_live_..." \
  -d '{ "trafficSources": { "allowed": ["content", "social", "email"], "notes": "No coupon sites." } }'
```

Sources are `content`, `social`, `email`, `paid_search`, `paid_social`, `display`, `coupon`, `cashback`, `incentivized`, `sub_network` and `mobile_app`; all are allowed by default. The list shows in the program terms and the marketplace. Partners declare their sources and a promotion URL when they apply (`POST /v1/partner/programs/{programId}/apply` with `trafficSources` and `promotionUrl`); a declared source the program doesn't allow doesn't block the application but shows as `trafficMismatch` in `GET /v1/programs/{id}/enrollments`. Paid search on your brand stays controlled by the program setting `allowPaidSearch`.

## Caps and country targeting

Conversion caps and allowed countries are program settings, documented with [commission rules](https://referalli.com/docs/commission-rules).

---

## For AI agents

- This page for a human reader: https://referalli.com/docs/deep-links-smartlinks-feeds
- The whole space as one Markdown file: https://referalli.com/docs/llms-full.txt
- Live search + fetch over MCP: https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/mcp
  - Install (Claude CLI): `claude mcp add referalli --transport http https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
