NATS4 supports an API function to get affiliate payout data for a specific time frame. You can choose a specific site or receive the payout data back for all of the sites.
get_affiliate_payout accepts the following parameters:
- loginid - The affiliate ID. This parameter is required.
- siteid - The siteid you wish to grab payout data for. If not supplied, NATS will grab payout data for all sites.
- startDate - The beginning date for the data you wish to see. Date will be parsed by the PHP strtotime function. A valid date can be YYYY-MM-DD.
- endDate - The ending date for the data you wish to see. Date will be parsed by the PHP strtotime function. A valid date can be YYYY-MM-DD.
NuSOAP Example
This example continues from the main article NuSOAP Example):
$params = Array(
'loginid' => '2',
'siteid' => 3,
'startDate' => '2012-10-10',
'endDate' => '2012-10-31',
);
$result = $client->call('get_affiliate_payout', $params, 'natsapiadmin_wsdl');
print_r($result);
Payout Data Output
The output will be the amount (in cents) earned and stored within the time period.
Array
(
[earned] => 8753
[stored] => 51250
)