Core concepts

Tenancy model

Three levels, and the middle one is what you probably call a brand.

example
agency          One SmoothProfit customer. Owns billing and staff.
  └─ program    One brand. Its own domain, partners, and rules.
       └─ affiliate   One partner, in exactly one program.

Agency

The account that signs up. Holds the subscription, the team, and any number of programs. A single-brand company is just an agency with one program — you don't model it differently.

Program

A program is a brand. It owns its subdomain or custom domain, its product catalog, its commission plan, its fraud settings, and its partners. Two programs under one agency share nothing operationally — separate affiliates, separate catalogs, separate payouts.

API keys are program-scoped. An agency with three brands needs three keys. There is no agency-wide key, because there is no endpoint where operating across brands at once would be safe.

Affiliate

A partner belongs to exactly one program. The same person promoting two of your brands is two affiliate records with two referral codes — which is what you want, because their commission tiers, tax status, and payout account are all per-program.

  • They join a program, not a product. One application, one approval, then they can promote anything in the catalog. Per-product control exists, but as a permission — see Commission resolution.
  • parent_affiliate_id forms the downline. When 2-tier is enabled, a sale by a sub-affiliate also credits their upline.

Domains

Each role resolves from its own explicitly-mapped hostname:

agencies.console_domainThe agency's own white-labeled console
programs.portal_domainAffiliate portal — login, dashboard, page editor
programs.store_domainPublic affiliate storefronts
{subdomain}.smoothprofit.appDefault portal host, always available

Separate columns rather than one field disambiguated by an admin. prefix convention — an agency reselling to its own brands needs a fully custom console domain, and prefix conventions can't express that.