Difference between revisions of "Offerit API Add Affiliate Sale"
From Offerit
Line 57: | Line 57: | ||
); | ); | ||
− | $result = $client->call(' | + | $result = $client->call('set_aff_sales_add', Array(), 'offeritapiadmin_wsdl'); |
</pre> | </pre> | ||
Revision as of 14:45, 25 October 2011
This function allows you to add a sale for a specfic affiliate. To use this function, you must make a SOAP call with the following parameters:
- amount - the amount of the sale (required)
- member - the name of the array used to pass in sale data (required)
- affid - the login ID of the affiliate to which you are adding a sale. (must be passed in through the member array)
- programid - the program ID under which the sale is occurring
- offerid - the offer ID for the sale
- landing_pageid - the landing page of the sale
- currency - the three-letter abbreviation of the currency type
- time - the time the sale occurred as a unix timestamp
<?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:set_aff_sales_add xmlns:tns="urn:offeritapiadmin_wsdl"> <amount xsi:type="xsd:string">1</amount> <member xsi:type="tns:Member"> <affid xsi:type="xsd:int">2</affid> <programid xsi:type="xsd:int">1</programid> <landing_pageid xsi:type="xsd:int">2</landing_pageid> <offerid xsi:type="xsd:int">2</offerid></member> <currency xsi:type="xsd:string">USD</currency> <time xsi:type="xsd:string">1319475600</time> </tns:set_aff_sales_add></SOAP-ENV:Body></SOAP-ENV:Envelope>
You will get a response similar to the following:
<?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/"> <SOAP-ENV:Body><ns1:set_aff_sales_addResponse xmlns:ns1="urn:offeritapiadmin_wsdl"> <return xsi:type="xsd:string">Add Success</return></ns1:set_aff_sales_addResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
NuSOAP Example
This example continues from the main article NuSOAP Example):
$values = Array( 'amount'=>1, //REQUIRED 'member'=>Array( //REQUIRED 'affid'=>2, 'programid'=>1, 'offerid'=>2, 'landing_pageid'=>2 ), 'currency'=>'USD', 'time'=>'1319475600' ); $result = $client->call('set_aff_sales_add', Array(), 'offeritapiadmin_wsdl');
Sample Output
on success: Add SUCCESS on error: error message