Skip to main content
POST
Generate a token to display an affiliate’s dashboard within your application. The token automatically creates the affiliate account if it doesn’t exist.

Body Parameters

string
required
The affiliate program ID. Must be an active program belonging to your team.
object
required
Partner/affiliate information.
string
Optional affiliate group ID. If not provided, uses the program’s default group. Use this to assign new affiliates to specific commission tiers or groups.
string
Your external user ID for linking referral users to your own user system. Useful for matching affiliates back to users in your application. Maximum 255 characters. If provided and the affiliate already exists, this will update their external user ID.
object
Custom key-value data for storing additional information about the affiliate (e.g., {"plan": "pro", "signup_source": "app"}). If provided and the affiliate already exists, this will update their metadata.

Response

boolean
Always true for successful responses.
object
The embed token data.

Behavior

  1. User Lookup/Creation: If no user exists with the provided email, a new user is created.
  2. Affiliate Lookup/Creation: If no affiliate exists for this user and program, one is created.
  3. Group Assignment: New affiliates are assigned to the specified groupId or the program’s default group.
  4. Partnership: New affiliates are enrolled in the program with a status based on your program’s Access Mode setting:
    • Public → Partnership status is APPROVED (affiliate can start referring immediately)
    • Private → Partnership status is PENDING (requires manual approval in dashboard)
    • Invite → Partnership status is APPROVED (but only pre-invited affiliates can join)
  5. Tracking ID: A unique tracking ID is generated from the name or email.
  6. Token Cleanup: Previous tokens for this affiliate/program are deleted.

With Custom Group

Assign new affiliates to a specific group with different commission rates:
Tokens expire after 30 minutes. Generate a new token on each page load rather than caching tokens.