NATS4 API Get Affiliate Payout
From TMM Wiki
Jump to navigationJump to searchThe printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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 )