# AffiliateRail documentation > Affiliate program software for SaaS. These docs cover the dashboard, the tracking script, the partner portal, the REST API and the MCP server. Base URL: https://docs.affiliaterail.com - [API reference (interactive)](https://docs.affiliaterail.com/reference) - [OpenAPI 3.1 document](https://docs.affiliaterail.com/openapi.json) - [Full API contract as text](https://api.affiliaterail.com/llms-full.txt) Every page below links to its markdown. Append `.md` to any docs URL for the same thing. ## Pages - [AffiliateRail documentation](https://docs.affiliaterail.com/index.md): Run an affiliate program for your SaaS: the dashboard, the tracking script, the partner portal, the REST API and the MCP server. - [Typed clients and LLM access](https://docs.affiliaterail.com/api/clients.md): Generate a typed client from the OpenAPI document, and point models at the contract as plain text. - [API overview](https://docs.affiliaterail.com/api.md): One consistent REST contract over every object in your program, with a generated, interactive reference. - [Rate limits, errors and versioning](https://docs.affiliaterail.com/api/rate-limits.md): The operational contract: limits and their headers, idempotent retries, the error catalogue, and how the API versions. - [Webhooks](https://docs.affiliaterail.com/api/webhooks.md): Signed HTTP delivery for every event in your program, with verification, retries and partner postbacks. - [Authentication](https://docs.affiliaterail.com/getting-started/authentication.md): API keys, scopes, live and test mode, and how assistants connect over MCP. - [Concepts](https://docs.affiliaterail.com/getting-started/concepts.md): The objects an affiliate program is made of, and the lifecycle a referral moves through. - [Getting started](https://docs.affiliaterail.com/getting-started.md): What AffiliateRail is, how the pieces fit together, and the fastest route to a working program. - [Quickstart](https://docs.affiliaterail.com/getting-started/quickstart.md): From an empty account to an attributed test-mode sale, using nothing but this page. - [Attribution and tracking](https://docs.affiliaterail.com/guides/attribution.md): How the script tracks referrals, proving your install, the four attribution paths, and fixing unattributed sales. - [Commission flows](https://docs.affiliaterail.com/guides/flows.md): Multi-branch commission rules: how flows are judged, the six templates, conditions, priority, approval, and the preview. - [Imports](https://docs.affiliaterail.com/guides/imports.md): Bring partners, customers and transaction history with you, with a dry run first and a one-click rollback. - [Platform guides](https://docs.affiliaterail.com/guides.md): Task-by-task guides to the dashboard: settings, flows, attribution, payouts, the portal, messaging, imports and safeguards. - [Links and domains](https://docs.affiliaterail.com/guides/links-and-domains.md): Partner links, short-link domains, the portal on your own domain, and a first-party tracker host. - [Messaging](https://docs.affiliaterail.com/guides/messaging.md): Automated emails, campaigns, sequences, in-portal announcements, resources, and sending from your own domain. - [The partner portal](https://docs.affiliaterail.com/guides/partner-portal.md): What partners see, how they sign in, applications and review, branding, and per-group signup links. - [PayPal payouts](https://docs.affiliaterail.com/guides/payouts-paypal.md): Create a PayPal Business account, switch on Payouts, and connect the Client ID and Secret. - [Wise payouts](https://docs.affiliaterail.com/guides/payouts-wise.md): Open a Wise Business account, create a full-access API token, and connect it with your profile ID. - [Payouts](https://docs.affiliaterail.com/guides/payouts.md): Non-custodial payouts from your own account: eligibility, batching, PayPal and Wise, the manual rails, and tax forms. - [Program setup](https://docs.affiliaterail.com/guides/program-setup.md): The getting started checklist, the program settings tabs, groups and tags, and customer auto-enrolment. - [Safeguards and risk](https://docs.affiliaterail.com/guides/safeguards.md): Referral safeguards on every plan, and hourly fraud monitoring on Scale. - [MCP overview](https://docs.affiliaterail.com/mcp.md): Ask your assistant about your affiliate program instead of opening the dashboard. - [Sample prompts](https://docs.affiliaterail.com/mcp/prompts.md): Prompts that map cleanly onto the server's tools, from daily questions to a Monday-morning briefing. - [Security](https://docs.affiliaterail.com/mcp/security.md): How the MCP connection is secured: OAuth with PKCE, scoped keys, short-lived tokens, and the boundaries that never move. - [Connect Claude or ChatGPT](https://docs.affiliaterail.com/mcp/setup.md): Add the AffiliateRail MCP server to your assistant in about two minutes. - [Tool reference](https://docs.affiliaterail.com/mcp/tools.md): Every tool and resource the MCP server exposes, with inputs, defaults and what comes back. - [Server-side attribution](https://docs.affiliaterail.com/api/attribution.md): Attribute sales without Stripe Checkout: read the referral cookie and pass one metadata field. - [Next.js](https://docs.affiliaterail.com/api/attribution/nextjs.md): Attribute a Stripe customer from a server action with the App Router. - [Node](https://docs.affiliaterail.com/api/attribution/node.md): Read the referral cookie and attribute a Stripe customer from any Node handler. - [Python](https://docs.affiliaterail.com/api/attribution/python.md): Attribute a Stripe customer from Flask, Django or FastAPI.