api('commision.report')

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

commision.report gets commisions list for exact date range

Parameters

Parameter Type Description Required
from string a date from which the system should get the commisions yes
to string a date to which the system should get the commisions yes
status mixed statuses of the commisions: 0 - accepted 1 - unaccepted 2 - canceled no

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.report', array(
            
'from' => '2014-01-01',  // format: Y-m-d
            
'to' => '2014-01-14',    // format: Y-m-d
            
'status' => array(       // integer | array
                
012
            
)
        ));

        
print_r($commision); // return Array
    
}
    catch (
AffilyException $e)
    {
        
error_log($e->getMessage());
    }

Response

PHP
Array
(
    [
0] => Array
        (
            [
id] => 5
            
[value] => 10.00
            
[status] => 1
            
[transaction_id] => QVcuW78y40
            
[date] => 2014-01-10 03:54:54
            
[comments] => 
            [
partner] => Array
                (
                    [
id] => 1239
                    
[first_name] => John
                    
[last_name] => Doe
                    
[company_name] => Example Company
                
)

            [
campaign] => Array
                (
                    [
id] => 123
                    
[name] => Example Campaign
                
)

        )

    [
1] => Array
        (
            [
id] => 6
            
[value] => 10.00
            
[status] => 0
            
[transaction_id] => pHWiExG4Ao
            
[date] => 2014-01-10 03:57:21
            
[comments] => 
            [
partner] => Array
                (
                    [
id] => 1239
                    
[first_name] => John
                    
[last_name] => Doe
                    
[company_name] => Example Company
                
)

            [
campaign] => Array
                (
                    [
id] => 123
                    
[name] => Example Campaign
                
)

        )
)
Name Type Description
id int Commision ID
value decimal(x, 2) commision value
status int statuses of the commisions: 0 - accepted 1 - unaccepted 2 - canceled
transaction_id string Transaction ID from your system
date string Date of calculating the commision
comments string Comments
partner array
Name Type Description
id int Affiliate ID
first_name string Name
last_name string Surname
company_name string Company name
campaign array
Name Type Description
id int Campaign ID
name string Campaign name

Method list

affiliate

affiliate.add

create partner account

commision

commision.add

add commission

commision.report

get commisions from exact period

commision.update

commision update