api('commision.update')

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

commision.update updates commision

Parameters

Parameter Type Description
commisions array elements are commisions that we want to update
Name Type Description
key int commision ID
value array
Name Type Description
status int commision status: 0 - accepted 1 - unaccepted 2 - canceled
comments string commision comment

Example

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

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

    
$affily = new Affily($config);

    try
    {
        
$commisionUpdate $affily->api('commision.update', array(
            
'commisions' => array(
                
=> array(
                    
'status' => 2
                
),
                
=> array(
                    
'status' => 0
                
)
            )
        ));

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

This example describes the update of two statuses of commissions IDs 5 and 6

Response

PHP
Array
(
    [
5] => Array
        (
            [
status] => SUCCESS
        
)

    [
6] => Array
        (
            [
status] => SUCCESS
        
)
)

In the API response is information about update of commisions IDs 5 and 6. In this example, the API had communicated to us that status commission has been updated successfully in both cases.

Name Type Description
key int commision ID
value array API response about updated elements
Name Type Description
status string information about the commision status update:
SUCCESS - updated successfully ERROR - some error occured (not updated) IS_STATUS - status was updated earlier NOT_EXISTS - commision does not exist
comments string information about the commision comment update:
SUCCESS - updated successfully ERROR - some error occured (not updated)

Method list

affiliate

affiliate.add

create partner account

commision

commision.add

add commission

commision.report

get commisions from exact period

commision.update

commision update