How to remove affiliates

If you want to remove affiliates, you can use method deleteRows in class Pap_Merchants_User_AffiliateForm.
 
<?php

include 'PapApi.class.php'; //the PapApi.class.php can be found at the PAP installation folder, in the 'api' directory $session = new Pap_Api_Session("http://your_pap_url/scripts/server.php"); if(!$session->login("merchant login","password")) { die("Cannot login. Message: ". $session->getMessage()); }
$userIds = array('11111111','6f4936c8'); //delete affiliats with these userIds $request = new Gpf_Rpc_Request("Pap_Merchants_User_AffiliateForm", "deleteRows", $session); $request->addParam('ids', new Gpf_Rpc_Array($userIds)); $request->addParam('moveChildAffiliates', 'N'); try { $request->sendNow(); } catch(Exception $e) { die("API call error: ".$e->getMessage()); } $response = $request->getStdResponse(); if ($response->success == 'Y') { echo 'Success: ' . $response->infoMessage; } else { echo 'Unsuccess: ' . $response->errorMessage; }
?>