# Affilyflow developer docs

> Technical reference for tracking sales with Affilyflow and the affiliate API – for developers and AI coding assistants.

## What's here

The English docs cover the technical reference. Store setup guides for each platform are in [Danish](https://www.affilyflow.com/docs).

- [track.js](https://www.affilyflow.com/docs/en/reference/track-js) – the tracking script: attributes, JavaScript API, cookies and consent.
- [Sale line](https://www.affilyflow.com/docs/en/reference/sale-line) – report the sale from the order confirmation page with one line of HTML.
- [Google Analytics](https://www.affilyflow.com/docs/en/reference/google-analytics) – read the purchase from the site's GA4 event, no field names needed.
- [Conversion API](https://www.affilyflow.com/docs/en/reference/conversion-api) – report sales from your own server.
- [Status codes](https://www.affilyflow.com/docs/en/reference/status-codes) – what each response means and what to do.
- [REST API](https://www.affilyflow.com/docs/en/affiliate/rest-api) and [MCP](https://www.affilyflow.com/docs/en/affiliate/mcp) – for affiliates and their AI assistants.

## How it fits together

1. An affiliate shares a link. The click goes through Affilyflow and lands on the store with a click id (`?afid=c_…`).
2. The store's tracking remembers the click (the Shopify app's Web Pixel, the WooCommerce plugin or `track.js`).
3. The customer buys. The sale is reported with order number and amount and linked to the click.
4. The commission is locked on the click and approved once the approval period has passed, unless the store rejects the sale.

> [!TIP]
> Every page is also available as Markdown (add `.md` to the address), and the whole documentation is in `/llms-full.txt` for your AI coding assistant.

Kilde: https://www.affilyflow.com/docs/en
