api('affiliate.add')

Affily::api('affiliate.add'[, array $params[, string $responseType]])

affiliate.add adds partner to the platform. The number of partners is visible in the admin panel at "Partners » Partners list" - where you can administer them freely .

After successful addition of a partner, the method returns their ID, which needs to be written down if we want to use it e.g.: to add commission.

Parameters

Parameter Type Description Required
email string e-mail address yes
password string partner panel password yes
first_name string first name no
last_name string last name no

Example

PHP
    require_once("php-sdk/affily.php");

    
$config = array(
        
'id' => ''# ID App
        
'secret' => '' # Secret Code
    
);

    
$affily = new Affily($config);

    try
    {
        
$affiliate $affily->api('affiliate.add', array(
            
'email'=> 'mail@example.com',
            
'password' => '3WkX9w1NsM'
        
));

        
print_r($affiliate['id']); // return ID
    
}
    catch (
AffilyException $e)
    {
        
error_log($e->getMessage());
    }

Response

PHP
Array
(
    [
id] => 1239
)
Name Type Description
id int partner ID

Method list

affiliate

affiliate.add

create partner account

commision

commision.add

add commission

commision.report

get commisions from exact period

commision.update

commision update