api('commision.add')

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

commision.add adds commission for partner.

Parameters

Parameter Type Description Required
commision_id string commission ID yes
h_id string security string of characters yes
affiliate_id int partner ID yes
value decimal(x, 2) value on which the commission for partner is calculated only in the case of percentage commission
transaction_id string Transaction ID from your system no
step array param_step
Name Type Description Default
value int | string value for commision threshold null
type string value type allowed: int | str int
only in case of commisions with thresholds

commission_id and h_id we download from the admin panel when creating/editing the campaign in the commission table.

Example

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

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

    
$affily = new Affily($config);

    try
    {
        
$commision $affily->api('commision.add', array(
            
'commision_id'=> 'mkz',
            
'h_id'=> 'a7c878b8312cb9564ab0e2352de5d3b1',
            
'affiliate_id' => 1239,
            
'step' => array(
                
'value' => 1,
                
'type' => 'int'
            
)
        ));

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

Response

PHP
Array
(
    [
id] => 71675
)
Name Type Description
id int commission 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