Offerit API Get Affiliate Sales
From Offerit
This function allows you to add a sale data for a specfic affiliate. To use this function, you must make a SOAP call with the following parameters:
- loginid - The affiliate ID to get sales of
- startDate - (optional) The date you want to start getting data
- endDate - (optional) The date to end getting data
- campaignid - (optional) The campaign ID of the affiliate for which you want data
NuSOAP Example
This example continues from the main article NuSOAP Example):
$values = Array( 'loginid' => 5, // 'startDate' => '2011-08-14', // (optional) 'endDate' => '', // (optional) 'campaignid' => '' // (optional) ); $result = $client->call('get_aff_sales_add', $values, 'offeritapiadmin_wsdl');
Sample Output
You will get a response similar to the following for each of the affiliate's sales:
Array ( [0] => Array ( [transaction_id] => 2 [identid] => 4 [loginid] => 2 [biller_time] => 0 [server_time] => 1314212671 [biller_transid] => 2 [billerid] => 0 [amount] => 0 [biller_amount] => 0 [biller_currency] => USD [exchange_rate] => 0 [trans_type_id] => 1 [member_subscription_id] => 1 [charges] => 0 [charge_deduct] => 0 [process_type] => 0 [related_transid] => 1 [historical] => 0 [retro_payout] => 3 [retrieval_type] => 9 [additional_trackingid] => 1 ) )
Server Request/Response
Request:
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:offeritapiadmin_wsdl"><SOAP-ENV:Body><tns:get_affiliate_sales xmlns:tns="urn:offeritapiadmin_wsdl"> <loginid xsi:type="xsd:int">2</loginid> <startDate xsi:type="xsd:string"></startDate> <endDate xsi:type="xsd:string"></endDate> <campaignid xsi:type="xsd:int"></campaignid> </tns:get_affiliate_sales></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response:
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:offeritapiadmin_wsdl"><SOAP-ENV:Body><ns1:get_affiliate_salesResponse xmlns:ns1="urn:offeritapiadmin_wsdl"> <return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:Transaction[9]"> <item xsi:type="tns:Transaction"> <transaction_id xsi:type="xsd:int">2</transaction_id> <identid xsi:type="xsd:int">4</identid> <loginid xsi:type="xsd:int">2</loginid> <biller_time xsi:type="xsd:int">0</biller_time> <server_time xsi:type="xsd:int">1314212671</server_time> <biller_transid xsi:type="xsd:string">2</biller_transid> <billerid xsi:type="xsd:int">0</billerid> <amount xsi:type="xsd:int">0</amount> <biller_amount xsi:type="xsd:int">0</biller_amount> <biller_currency xsi:type="xsd:string">USD</biller_currency> <exchange_rate xsi:type="xsd:int">0</exchange_rate> <trans_type_id xsi:type="xsd:int">1</trans_type_id> <member_subscription_id xsi:type="xsd:int">1</member_subscription_id> <charges xsi:type="xsd:int">0</charges> <charge_deduct xsi:type="xsd:int">0</charge_deduct> <process_type xsi:type="xsd:int">0</process_type> <related_transid xsi:type="xsd:string">1</related_transid> <historical xsi:type="xsd:int">0</historical> <retro_payout xsi:type="xsd:int">3</retro_payout> <retrieval_type xsi:type="xsd:int">9</retrieval_type> <additional_trackingid xsi:type="xsd:int">1</additional_trackingid> </item></return></ns1:get_affiliate_salesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>