Support » Plugin: Affiliates » How can I add a new affiliate via API?

  • So, we have a 3rd party system that handles our affiliates. We want to create the itthinx-affiliates in a hook depending on the URL. For example

    
    // on ?affiliateId=uuid-1234-1234
    
    if (!empty($_GET['affiliateId'])) {
        $externalId = $_GET['affiliateId'];
        if (!affiliateExist($externalId)) {
            affiliateCreate([
                'name'     => $externalId,
                'email'    => null,
                'username' => $externalId,
                'from'     => (new DateTime())->format('Y-m-d'),
                'until'    => null
            ]);
        }
    
        $affiliate = affiliateFindByName($externalId);
        header("Location index.php?affiliates={$affiliate->id}");
    }
    

    So, we want to create affiliates on the fly. Is something like this possible?

    • This topic was modified 1 year, 1 month ago by stuardostr. Reason: code

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How can I add a new affiliate via API?’ is closed to new replies.