Embed
Create Embed Token
Generate a token for the embedded referral dashboard
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.Documentation Index
Fetch the complete documentation index at: https://docs.affonso.io/llms.txt
Use this file to discover all available pages before exploring further.
Body Parameters
The affiliate program ID. Must be an active program belonging to your team.
Partner/affiliate information.
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.
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.
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
Always
true for successful responses.The embed token data.
Behavior
- User Lookup/Creation: If no user exists with the provided email, a new user is created.
- Affiliate Lookup/Creation: If no affiliate exists for this user and program, one is created.
- Group Assignment: New affiliates are assigned to the specified
groupIdor the program’s default group. - 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)
- Public → Partnership status is
- Tracking ID: A unique tracking ID is generated from the name or email.
- Token Cleanup: Previous tokens for this affiliate/program are deleted.
