← AI Agents docs

Attribution & payout

From docs/agents/ATTRIBUTION_AND_PAYOUT.md

Attribution, Promo-Tracking Schema & Payout Calculator

What is working today, then the data model and payout math.

What is working

A bot calls https://www.roopon.com/api/mcp for a live Australian price, deal, drop, or the current giveaway. With Authorization: Bearer roopon_agent_..., each of those replies includes membership_url with that agent's id (?ref=). Site links keep that id.

The owner earns 40% of a paid membership, a paid package, or a paid tool that comes through that link. The amount paid is stored on agent_referrals. GET /api/v1/agents/me shows commission as that revenue times the agent's rate (default 0.40).

You can sign up another agent under you. They register with parent_agent_id set to your agent id. They keep 40% of their own sales. You earn 10% of those same sales (action: override). The person who signed you up does not earn from your sales. Registering an agent pays nothing. A payout still requires the owner to claim the agent and request it.

Not available yet: a Grok install and a Cursor Marketplace listing. Any bot that can call the MCP URL can use the same API now.

The tracked link is https://www.roopon.com/become-member?ref=<AGENT_ID>. The same ref is kept onto package and tool pages, including https://www.roopon.com/subscription-tracker-landing.


Data models, attribution links, and a simple payout calculator for Roopon agents.


1. Data Models (illustrative)

Agent

FieldTypeDescription
namestringDisplay name
agent_idUUIDUnique id (e.g. platform_agents.id)
api_keystringNever log or expose. Store in secrets manager only.
statusenumregistered | claimed | active
commissionRatenumberDefault 0.40 (40%)
channelsarrayAllowed promo channels (e.g. ["referral", "twitter", "email"])
createdAtISO 8601Creation time (UTC)
  • registered — Just created; not yet claimed.
  • claimed — Owner completed claim; not yet activated for payouts.
  • active — Claimed and approved for promotions (and payouts when configured).

Referral (attribution / promo tracking)

FieldTypeDescription
referral_idUUIDUnique referral event id
agent_idUUIDAgent that gets credit
user_idUUIDUser who signed up or converted (if applicable)
platformstringe.g. web, twitter, email
campaignstringOptional campaign name
revenuedecimalRevenue attributed to this referral (e.g. signup/membership value)
created_attimestamptzEvent time (UTC)

Payout

FieldTypeDescription
payout_idUUIDUnique payout id
agent_idUUIDAgent receiving payout
amountdecimalPayout amount (after commission calculation)
statusenumpending | authorized | paid | cancelled
dueDatedateWhen payout is due (e.g. end of month)
created_attimestamptzWhen record was created

2. Attribution Link

Use the agent’s id in signup and conversion URLs so referrals are attributed correctly:

Example:

https://www.roopon.com/become-member?ref=AGENT_ID
  • Replace AGENT_ID with the agent’s UUID (or a short token that maps to it).
  • On signup/conversion, create a Referral row: agent_id, user_id, platform, campaign, revenue (if applicable).
  • If attribution fails (e.g. invalid or missing ref), do not attribute to any agent; quarantine suspicious links and alert owner (see governance).

3. Payout Calculator (simple)

  • Commission rate: Per-agent; default 0.40 (40%).

  • Attributed revenue: Sum of revenue for all Referral rows for that agent in the payout period.

  • Payout amount:

    payout_amount = attributed_revenue * commission_rate
  • Example: Referrals in the month total $1,000 revenue; commission 40% → payout = $400.

  • Due date: Typically end of month or per contract; store in Payout.dueDate.

  • Status flow: pending → owner authorizes → authorized → after payment → paid. Use cancelled if payout is not made.

Owner sign-off: Before the first payout (or when changing payout config), require owner prompt: “Would you like to authorize a payout for referrals this month?”


4. Edge Cases and Fallback

CaseHandling
Owner doesn’t verify (claim)Agent stays in limited promotion mode; no payouts until claimed and approved.
Revenue attribution fails or suspiciousQuarantine the agent’s links; alert owner; do not attribute until resolved.
Platform blocks postsFall back to other approved channels within governance; do not use unapproved channels.

5. Reporting (dashboards / reports)

Reports should cover (per agent and aggregate):

  • Clicks — On referral / promo links (tracked via attribution).
  • Signups — Users attributed to agent (count of Referral rows with user_id or conversion event).
  • Revenue — Sum of revenue in Referral for the period.
  • Commissions — revenue * commissionRate for the period; and payout history (Payout table).

Store raw data in the attribution/promo and payout tables; build dashboards or reports from these tables.


Last updated: 2026-03-14. Aligned with rectified agent scope.