Referral codes let projects create shareable codes for their users. When a user accepts a referral code, a permanent referrer-user relationship is created. The SDK provides methods to list, generate, check, use, and delete referral codes.
Referral codes are generated by the project on behalf of users β they are auto-generated (random 7-char alphanumeric) and scoped to a single project. Affiliate codes can also be activated as referral codes within a project.
Referral codes are different from affiliate codes. Affiliate codes are custom, created by the affiliate with a wallet signature, and embedded in tracking links (?af=code) for automatic attribution. Referral codes are project-generated and require the user to explicitly accept the code.
Check whether a user was referred and with which code:
conststatus=awaitFuul.getReferralStatus({user_identifier:'0x1234...',user_identifier_type:UserIdentifierType.EvmAddress,});if (status.referred) {console.log('User was referred with code:',status.code);}
Check if a code is available
Accept a referral code
When a user accepts a referral code, a permanent referrer-user relationship is created β all future conversions by this user will be attributed to the referrer.
The signed message must follow this exact format: I am using invite code ${code}
Note: the signature says "invite code" for legacy reasons β this applies to all referral codes, regardless of how your project uses them.
Requiring a signature ensures event validity and prevents fraud. This is mandatory.
Set a referrer via API
If you manage your own referral system (e.g. a fintech or exchange with existing user relationships), you can create or update referrer-referee relationships directly through the API instead of using referral codes (API reference):
If you include a referral_code, the code is validated and its rebate rate is locked into the relationship. The response includes a referral_code_id you can use to trace which code established the referral.
This endpoint requires a service_role API key. If the user already has a referrer, the existing relationship is overwritten.
Get user referrer
Get the current referrer for a specific user:
Delete a referral
Allows users to remove a referral relationship they have, freeing up a use on the referral code. The referral code's usage count will be incremented by one.
The signed message must follow this format:
I am deleting referral for user ${user_identifier} from code ${code}
Resolving email recipients
When payouts are created for email identifiers but no wallet address is mapped yet, they remain in a "pending resolution" state. Use these endpoints to check for unresolved payouts and create email-to-address mappings so the rewards can be claimed.
List emails with pending unresolved payouts (API reference):
Create mappings to resolve pending payouts to wallet addresses (API reference):
Once a mapping is created, pending movements for that email are asynchronously resolved to the target address. You can send up to 100 mappings per request.