Skip to content

MngGetOrCreateAffiliateLink

Returns the primary referral link for an affiliate in the effective brand. If no primary link is configured, the server adopts an existing active affiliate link or creates a default one. Repeated calls do not create duplicates.

{
  "command": "MngGetOrCreateAffiliateLink",
  "extID": "1",
  "data": {
    "affiliate_id": 15,
    "brand": "default"
  }
}

brand is resolved from manager scope for regular brand managers. A super administrator without a fixed brand must provide it explicitly.

{
  "affiliate_id": 15,
  "link_id": 42,
  "url": "https://brand.example/register?affiliate=AFF1024&link=REF-91a01d3f-825",
  "created": false
}

Use this command for the Generate link action when an old affiliate row has an empty primary_link. The command requires access_crm and set_customers.