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

# How Partnero works

> How programs, partners, customers, links, transactions, commissions, rewards and payouts fit together in affiliate and refer-a-friend programs.

Partnero runs two kinds of referral programs, and they track referrals differently:

* In an **affiliate program**, partners promote you from the outside. They join through the partner portal, share a `?aff=` link and earn commissions that you pay out.
* In a **refer-a-friend program**, your own customers do the referring. Every customer is created in Partnero, gets a `?ref=` link and earns rewards when a friend signs up or buys.

Both start with a referral link and end with someone getting paid. In between, PartneroJS, your sign-up flow and your billing tool record each step, and Partnero works out who earned what.

## Affiliate and refer-a-friend side by side

The same ideas apply in both programs, with different people and different payouts. Daniel Hughes is the referrer in both examples.

> [!TIP]
>
> PartneroJS handles both. The same `po('customers', 'signup', …)` call sends `partner.key` in an affiliate program and `referring_customer.key` in a refer-a-friend program, read from the cookie.

## From click to payout

> [tab] Affiliate program
>
> | Step | What it is | Where it comes from |
> | - | - | - |
> | **Click** | A visit through the partner's link. PartneroJS stores the partner in the `partnero_partner` cookie. | [PartneroJS](https://docs.partnero.com/guides/tracking/javascript-tracking.md), or [`POST /v1/analytics/register_click`](https://docs.partnero.com/api-reference/analytics/register-click) |
> | **Customer** | The visitor who signs up, linked to the partner by your customer key. | `po('customers', 'signup', …)`, [`POST /v1/customers`](https://docs.partnero.com/api-reference/customers/create) with `partner.key`, or a [billing integration](https://docs.partnero.com/integrations/overview.md) |
> | **Transaction** | A payment from that customer, including every renewal. | A billing integration, `po('transactions', 'create', …)`, or [`POST /v1/transactions`](https://docs.partnero.com/api-reference/transactions/create) |
> | **Commission** | What the partner earns from the transaction. It can wait in a review period before it becomes available. | Created automatically from your commission settings |
> | **Payout** | Available commissions, paid out together. | Payout requests or automatic payouts |
>
> Promotion codes, lead submissions and postbacks are other ways to link a customer to a partner. After that, everything works the same.

> [tab] Refer-a-friend program
>
> | Step | What it is | Where it comes from |
> | - | - | - |
> | **Referrer** | Daniel, created in Partnero when he signs up for your product. His customer key becomes his referral link. | `po('customers', 'signup', …)` or [`POST /v1/customers`](https://docs.partnero.com/api-reference/customers/create) without `referring_customer` |
> | **Click** | A friend visits Daniel's link. PartneroJS stores Daniel's key in the `partnero_referral` cookie. | [PartneroJS](https://docs.partnero.com/guides/tracking/javascript-tracking.md) |
> | **Friend** | The friend who signs up, created as a customer and linked to Daniel. The friend gets their own link too. | `po('customers', 'signup', …)` or [`POST /v1/customers`](https://docs.partnero.com/api-reference/customers/create) with `referring_customer.key` |
> | **Transaction** | A payment from the friend. Only needed when a reward is triggered by a purchase. | A billing integration or [`POST /v1/transactions`](https://docs.partnero.com/api-reference/transactions/create) |
> | **Reward** | What Daniel, the friend or both receive. | Created automatically from your [reward settings](https://docs.partnero.com/knowledge-base/referral-programs/how-to-create-a-reward.md) |
> | **Balance** | Daniel's rewards, shown in the referral portal or your app. Money rewards can be paid out through Partnero. | [Balance API](https://docs.partnero.com/guides/referral-programs/api-integration.md) |

## Why the sign-up decides attribution

The cookie only has to last until the customer is created in Partnero. At that moment the customer is permanently linked to Daniel Hughes, and the cookie is no longer needed. Payments that arrive months later are matched by customer key, not by cookie, so they still count for Daniel. How much he earns on them, and for how long, comes from your commission or reward settings.

If the visitor signs up after the attribution window has ended, there is no referral to link, and later payments don't count for anyone.

Jane, referred by Daniel Hughes
30-day attribution window

> [!NOTE]
>
> Send the same customer key with every transaction. Partnero finds the referrer through the customer, so a transaction for an unknown key is rejected with "Customer not found" unless you pass `options.create_customer`.

## Next steps

> [card] [Affiliate programs](https://docs.partnero.com/guides/partner-programs/overview.md)
>
> Set up partners, links and commissions

> [card] [Refer-a-friend programs](https://docs.partnero.com/guides/referral-programs/api-integration.md)
>
> Track referring customers and reward both sides

> [card] [Track with JavaScript](https://docs.partnero.com/guides/tracking/javascript-tracking.md)
>
> Add PartneroJS and record sign-ups

> [card] [Key concepts](https://docs.partnero.com/key-concepts.md)
>
> Every term used across these docs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.