lookupAffiliate()
Looks up affiliate information by various attribution methods.
Signature
const affiliate = await window.FairShareSDK.lookupAffiliate(options);
Parameters
| Parameter | Type | Description |
|---|---|---|
options | object | Lookup options |
Lookup Options (use one):
| Property | Type | Description |
|---|---|---|
share_guid | string | Affiliate's share GUID |
email | string | Affiliate's email |
username | string | Affiliate's username |
external_id | string | External ID |
fluid_rep_id | number | Fluid Rep ID |
Returns
Promise<Affiliate | null> — Affiliate object, or null if not found.
Examples
By Share GUID
const affiliate = await window.FairShareSDK.lookupAffiliate({ share_guid: "abc123", });
By Email
const affiliate = await window.FairShareSDK.lookupAffiliate({ email: "affiliate@example.com", });
By Username
const affiliate = await window.FairShareSDK.lookupAffiliate({ username: "affiliateuser", });
Affiliate Object
{ id: 123, name: "John Doe", email: "john@example.com", image_url: "https://...", share_guid: "abc123" }