Operate · 10
Affiliate programme
The affiliate programme lets approved partners share branded links and earn on referred orders. Codes, links, clicks, orders, commissions and payouts are first-party records with an audit trail.
Programme settings
AffiliateProgramSettings controls whether the programme is open, auto-approval, the default and maximum commission rates, the attribution window and the minimum payout. Edit it from the affiliate dashboard or Advanced admin.
| Setting | Default | Meaning |
|---|---|---|
| Enabled | On | Off closes new applications; existing partners can still sign in. |
| Auto-approve | On | New applications are approved immediately when enabled. |
| Default rate | 10% | Commission applied to new partners. |
| Maximum rate | 20% | Hard cap for every partner. |
| Attribution window | 30 days | First-party cookie lifetime. |
| Minimum payout | 50 | Balance required before a request. |
Codes and links
Every partner gets a unique 5–8 character code made of lowercase letters and numbers. Reserved words such as admin, shop, i and checkout are rejected. Partners can rebrand their default code from the partner console; collisions are checked across profile codes and extra link codes.
Partners can also create product links or custom destination links. Each gets its own 5–8 character short code and records clicks and conversions independently.
Short URL forms
When a dedicated short host is configured, the default link is https://go.perfumz.com/<code>. Without it, the link is https://perfumz.com/i/<code>/. Legacy /r/<code>/ and /a/<code>/ routes remain available.
The short host must be a subdomain of the canonical site so the attribution cookie survives the redirect. The production settings refuse a different domain.
| Form | Example | DNS / TLS |
|---|---|---|
| Path | /i/house7/ | No extra DNS. |
| Subdomain | go.perfumz.com/house7 | Add the host to DNS, ALLOWED_HOSTS, Nginx and the certificate. |
Attribution and commission
A click records the partner, optional link, path, IP, user agent, referrer, session and conversion state. The partner code and link code are stored on the order at checkout. A paid order creates a referral commission; cancellation or full refund reverses it.
The commission rate is capped by the programme maximum. Commission is calculated on the order subtotal, not shipping or tax. Link conversions and partner lifetime totals update automatically.
Partner console
/account/affiliate/ lets a partner apply, copy their default link, rebrand their code, create product/custom links, view referrals and commission, save payout details and request a payout. The console shows clicks, conversions, conversion rate, total earned, balance and payout history.
Public programme and terms
/affiliates/ contains the programme story, the application form and the full #affiliate-terms agreement: joining, branded codes, attribution, commission and returns, payouts, promotion standards, termination and contact. The copy is translated into French, Spanish, Portuguese and Arabic.
Staff operations
/dashboard/affiliates/ shows programme state, partner/applicant counts, clicks, orders, conversion rate, commission earned and available balance. Staff can approve or suspend a partner, adjust the rate within the cap, record a direct payout, and mark or cancel pending payout requests.
# Affiliate regression suite
python manage.py test apps.affiliate
# Inspect a partner code and link
.venv/bin/python manage.py shell -c "from apps.affiliate.models import AffiliateProfile; print(list(AffiliateProfile.objects.values_list('code','status')))"Every application, decision, code change, link change and payout writes an audit entry and, where relevant, a notification or webhook.