Home

PHP

Commission Report

The API call for Commissions Report returns a detailed report about all the transactions that were made through your affiliate links. Each transaction has some essential details associated to it: transaction date, tracking ID or SubID, the network through which the transaction was made, the name and id of the advertiser, the member's ID, the value of the commission earned, the total amount of the transaction or currency. Also, in this report you will also get the status of a transaction, either it is pending, approved, rejected or paid.

API Function: get_commisions_report

Parameters:

Name Type Description
username string Your API username. You should have received this with your account
subscription_id string Your Subscription ID. You can copy or regenerate it from your API management interface.
start_date / end_date string These parameters will allow you to filter results based on date. You can input any date string accepted by PHP but we recomed you use the "Y-m-D H:i:s" format.
currency string Currency code if you want to convert values to a certain currency. The converted values will use the exchange from the current day.
source_id numeric Use source_id if you want to get the report for the selected source only.

 

Response fields:

Name Type Description
statistics_id numeric Unique ID of the statistics
statistics_date string The date when the action was recorded
merchant_name string The name of the merchant associated with the action
merchant_id numeric Unique ID of the merchant associated with the commission
network_name string The name of the affiliate network who recorded the action
program_name string The name of the affiliate program where this action was recorded
tracking_id string The tracking ID/ SubID used for this record
clicks string The number of clicks recorded
sales string The number of sales reported by the merchant
member_id string The ID of the client's member who initiated the action
commission_confirmed numeric Value of the confirmed commission
commission_unconfirmed numeric Value of unconfirmed comission
cashback string Cashback value for the current sale and comission
commission_status string Current status of the commission {pending, approved, paid, rejected}
member_commission string Commission value to be paid to the member
currency_code string Currency code for the values of the commission
original_sales string Original sale value recorded in the network
original_commission_confirmed numeric Original value of the confirmed commission recorded in the network
original_commission_unconfirmed numeric Original value of unconfirmed comission recorded in the network
original_currency_code string Original currency code for the values of the commission recorded in the network
payment_status string Payment status. It can take one of the following values: not_paid, pending, paid
user_more_tracking string If you sent subid2 in the short link , you will receive that value in this field
subid3 string If you sent subid3 in the short link , you will receive that value in this field

 

              
              
              
              
<?php   
$api_username      = '*******';
$api_subscription  = '*******';

$api_currency      = '';  // return the report in this currency if is set, use currency code  
$api_start_date    = '';  // replace with start date
$api_end_date      = '';  // replace with end date

try
{
        $client    = new SoapClient('https://synced.io/api/v2?wsdl');
        $report    = $client->get_commisions_report($api_username, $api_subscription, $api_start_date, $api_end_date, $api_currency);			
}
catch(Exception $e)
{
        echo $e->getMessage();
}    


if(!empty($report))
{
    print_r($report);
}
?>