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

> ## Agent Instructions
> For new direct REST integrations, use the v2026-04 surfaces. The @fluid-app FairShare SDK continues to use its own published public-v2025-06 contract.
> Authenticate with the header Authorization: Bearer <token>; public storefront read endpoints require no auth.
> Lists use cursor pagination via the page[cursor] and page[limit] query params; follow meta.pagination.next_cursor until it is null.
> Never use /api/company/v1 or /api/v1 paths, page/per_page params, or offset pagination — they are legacy.
> The OpenAPI specs under api-reference/ are the authoritative contracts; prefer them over prose when in doubt. api-reference/storefront-v2026-04.yaml covers the v2026-04 storefront surface (/api/v202604/... paths); api-reference/auth-v0.yaml covers the unversioned auth surface (/api/... paths — authentication, MFA, social auth, and token exchange); api-reference/checkout-v2026-04.yaml covers the v2026-04 checkout surface (/api/checkout/v2026-04/... paths — carts, cart auth, discounts, items, subscriptions, orders, enrollments, and store config); api-reference/public-v2025-06.yaml covers the Public SDK surface used by the @fluid-app FairShare SDK, including its parallel cart lifecycle, browser integrations, versioned payment callbacks, unversioned public utilities, and the cart price-override operation; api-reference/payment-v2026-04.yaml covers the v2026-04 payment gateway admin surface (/api/payment/v2026-04/... paths, bearer-authenticated — gateway CRUD, gateway purchase/authorize/$0-verify, transaction list/show and capture/void/credit, and merchant payment configuration); api-reference/payments-v2026-04.yaml covers the v2026-04 cart payment surface (/api/payments/v2026-04/carts/{cart_token}/... paths, authenticated by the cart token in the path with no bearer — payment-method selection, VGS card tokenization, 3D Secure verification, and PayPal/Braintree/Klarna/Apple Pay flows); api-reference/commerce-v2026-04.yaml covers the v2026-04 commerce order-editing surface (/api/v202604/orders/{order_id}/edits paths, bearer-authenticated — post-checkout order edits that atomically insert items and add adjustments/discounts, with an optional dry-run preview); api-reference/webhooks-v0.yaml covers the unversioned webhooks surface (/api/... paths — webhook registration, delivery payloads, callback registrations, company events, and webhook/callback schemas).
> Successful responses wrap the resource payload alongside a top-level integer status and a meta object.

# FairShare: Sales Rep Attribution Across Multiple Domains

> FairShare accurately attributes sales credit to reps using cookies, fingerprints, and URL routes across multiple websites and domains.

FairShare is Fluid's JavaScript SDK that resolves one of the hardest problems in direct sales e-commerce: knowing which rep deserves credit for a sale when buyers move across multiple websites, clear cookies, or share links. Install a single script tag on any website — whether it runs on the Fluid platform or not — and FairShare starts capturing attribution data immediately, surfacing widgets for cart, lead capture, and media alongside it.

## How FairShare Works

FairShare runs entirely in the browser. When a visitor lands on a page that carries the FairShare script, the SDK evaluates all available signals to determine rep attribution and stores that attribution for the duration of the shopping session.

### Installation

Add the following script tag to the `<head>` of any page where you want attribution tracking and widgets:

```html theme={null}
<script
  src="https://assets.fluid.app/scripts/fluid-sdk/latest/web-widgets/index.js"
  data-fluid-shop="your-shop-identifier"
  async
></script>
```

Replace `your-shop-identifier` with the FairShare shop identifier from your Fluid dashboard. The `async` attribute ensures the script loads without blocking your page render.

### Attribution Methods

FairShare uses three complementary methods to identify the rep behind a visit. Using all three together maximises attribution accuracy across the scenarios you'll encounter in the real world:

* **Cookies** — When a rep's link is clicked, FairShare writes a first-party cookie to the visitor's browser. Subsequent visits from the same browser on the same domain resolve attribution from this cookie.
* **Browser fingerprints** — FairShare builds a lightweight fingerprint from browser and device characteristics. This provides attribution continuity even when cookies are cleared or unavailable.
* **URL-based routes** — Reps share URLs that encode attribution data directly in the path or query string. FairShare reads these parameters on page load and uses them as the highest-confidence attribution signal.

### Attribution Priority Order

When multiple attribution signals are present simultaneously, FairShare resolves them in the following order — earlier entries take precedence over later ones:

1. `share-guid` — a unique share identifier embedded in the rep's link
2. `fluid-rep-id` — the rep's Fluid platform identifier
3. `email` — the rep's registered email address
4. `username` — the rep's Fluid username
5. `external-id` — an identifier from an external system

## What FairShare Enables

Beyond attribution tracking, FairShare gives you a suite of embeddable widgets you can deploy on any page:

* **Cart widget** — A slide-out or inline cart that lets buyers add products and proceed to checkout without leaving your page. The cart is automatically scoped to the attributed rep.
* **Lead capture widget** — A form that collects visitor contact information and associates leads with the attributed rep in your Fluid dashboard.
* **Media widget** — Embed product images, videos, and rich media hosted on the Fluid platform directly on external sites.
* **Real-time cart updates** — FairShare integrates with Pusher to push live cart changes (items added, quantities updated, discounts applied) to the buyer's browser without a page refresh.

## Configuration Attributes

You control FairShare's behaviour using `data-*` attributes on the script tag. The table below lists all supported attributes:

| Attribute             | Description                                                                                       | Required |
| --------------------- | ------------------------------------------------------------------------------------------------- | -------- |
| `data-fluid-shop`     | Your FairShare shop identifier                                                                    | Yes      |
| `data-share-guid`     | Attribution override: supply a specific share GUID to force attribution to a particular rep share | No       |
| `data-fluid-rep-id`   | Attribution override: supply a Fluid Rep ID to force attribution to a specific rep                | No       |
| `data-pusher-enabled` | Set to `"true"` to enable real-time asynchronous cart updates via Pusher                          | No       |

<Note>
  FairShare can be installed on any website — it is not limited to sites built on or hosted by the Fluid platform. This means you can add attribution tracking to existing storefronts, marketing sites, or landing pages without migrating to Fluid's hosting.
</Note>

## Next Steps

Once FairShare is installed and attribution is flowing, you can connect it to your checkout experience and commission workflows.

For full setup instructions including widget configuration, domain allowlisting, and testing your attribution data, see the [SDK Installation guide](/sdk/installation).
