Pap_Api_PayoutsHistory

Grid object - this class handles requests to the list of payouts already payed to affiliates. You can use it to search and filter in merchant payouts history.

Note: This api is for merchant only.

Methods:

 

  • all methods are inherited from Gpf_Rpc_GridRequest class, check it's documentation.
  • getPayeesDeatilsInfo(payeeid) - gets info about affiliates in specified payout
Possible filters you can use:
  • dateinserted - date value
  • merchantnote - text value
  • userid - id of specified affiliate

 

Example retrieving list of all payments:

include '../api/PapApi.class.php';

$session = new Pap_Api_Session("https://yourserver.com/scripts/server.php");
if(!$session->login("your_merchant_name", "merchant_password")) {
  die('Failed authentication');
}

$payoutHistoryrequest = new Pap_Api_PayoutsHistoryGrid($session);

$payoutHistoryrequest->sendNow();

$historyGrid = $payoutHistoryrequest->getGrid();
$recordset = $historyGrid->getRecordset();

//print list of payouts
foreach($recordset as $rec) {
    echo $rec->get('id') . ';' . $rec->get('amount') . ';' . $rec->get('dateinserted') . ';' . $rec->get('users') .';' . '</br>';
}
Possible values you can get from grid:
  • payouthistoryid - id of payment
  • dateinserted - date of payment
  • merchantnote - note for merchant
  • affiliatenote - note for affiliate
 
Now we can add view details about specified payment like this:
//gets ifno about payment with id 'bbf38b55'
$rows = $request->getPayeesDeatilsInfo('bbf38b55');

foreach ($rows as $row) {
    echo $row->getValue('username') . '<br>';
}
Possible values we can get for payout details:
  • username - affiliate username
  • firstname - affiliate first name
  • lastname - affiliate last name
  • amount - amout payed to affiliate
×