Offerit API Edit Affiliate Sale
From Offerit
Revision as of 14:46, 25 October 2011 by OfferitJames (talk | contribs) (Created page with "{{Offerit Manual | show_api_admin_section = true }} This function allows you to edit an existing sale for a specfic affiliate. To use this function, you must make a SOAP call wit...")
This function allows you to edit an existing sale for a specfic affiliate. To use this function, you must make a SOAP call with the following parameters:
- related_transactionid -
- amount - the amount to which the sale is being changed
- member - name of the array used to pass in member data
<?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_edit xmlns:tns="urn:offeritapiadmin_wsdl"> <related_transactionid xsi:type="xsd:string">287</related_transactionid> <amount xsi:type="xsd:string">10.95</amount> <member xsi:type="tns:Member"> <memberid xsi:type="xsd:int">134</memberid><affid xsi:type="xsd:int">2</affid> <programid xsi:type="xsd:int">1</programid><campaignid xsi:type="xsd:int">1</campaignid> <landing_pageid xsi:type="xsd:int">18</landing_pageid><adtoolid xsi:type="xsd:int">3</adtoolid> <loginid_nice xsi:type="xsd:string">tmmadam</loginid_nice><expired xsi:type="xsd:int">18</expired> <offerid xsi:type="xsd:int">2</offerid><username xsi:type="xsd:string">username</username> <password xsi:type="xsd:string">password</password><email xsi:type="xsd:string">test@email.com</email> <mailok xsi:type="xsd:int">1</mailok><memberidx xsi:type="xsd:string">6a81db6c8b01330e407fb0f8ed45804b</memberidx> <active xsi:type="xsd:int">1</active><expires xsi:type="xsd:int">1317790800</expires> <offerit_expires xsi:type="xsd:int">1317790800</offerit_expires><firstname xsi:type="xsd:string">first</firstname> <lastname xsi:type="xsd:string">last</lastname><address1 xsi:type="xsd:string">123 Main St</address1> <address2 xsi:type="xsd:string">Apt 123</address2><zip xsi:type="xsd:string">00000-0000</zip> <city xsi:type="xsd:string">Anytown</city><country xsi:type="xsd:string">US</country> <state xsi:type="xsd:string">NJ</state><shipping_firstname xsi:type="xsd:string">sfirst</shipping_firstname> <shipping_lastname xsi:type="xsd:string">slast</shipping_lastname> <shipping_address1 xsi:type="xsd:string">987 1st Ave</shipping_address1> <shipping_address2 xsi:type="xsd:string">Suite 123</shipping_address2> <shipping_zip xsi:type="xsd:string">00000-0000</shipping_zip><shipping_city xsi:type="xsd:string">Anytown</shipping_city> <shipping_country xsi:type="xsd:string">US</shipping_country><shipping_state xsi:type="xsd:string">NJ</shipping_state> <phone xsi:type="xsd:string">123-456-7890</phone><custom1 xsi:type="xsd:string">custom1</custom1> <custom2 xsi:type="xsd:string">custom2</custom2><custom3 xsi:type="xsd:string">custom3</custom3> <custom4 xsi:type="xsd:string">custom4</custom4><custom5 xsi:type="xsd:string">custom5</custom5></member> <reason xsi:type="xsd:string">Mistakenly credited sale to the wrong offer</reason> <currency xsi:nil="true" xsi:type="xsd:string"/><time xsi:nil="true" xsi:type="xsd:string"/> </tns:set_aff_sales_edit></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_editResponse xmlns:ns1="urn:offeritapiadmin_wsdl"> <return xsi:type="xsd:string">Edit Success</return></ns1:set_aff_sales_editResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
NuSOAP Example
This example continues from the main article NuSOAP Example):
$values = Array( 'related_transactionid' => 287, //REQUIRED 'amount' => 10.95, //REQUIRED 'member'=> Array( 'memberid' => 134, //REQUIRED 'memberidx' => '6a81db6c8b01330e407fb0f8ed45804b', //REQUIRED 'affid' => 2, 'programid' => 1, //REQUIRED (if affid is specified) 'campaignid' => 1, 'landing_pageid' => 18, 'adtoolid' => 3, 'loginid_nice' => 'tmmadam', 'expired' => 18, 'offerid' => 2, 'username' => 'username', 'password' => 'password', 'email' => 'test@email.com', 'mailok' => 1, 'active' => 1, 'expires' => 1317790800, 'offerit_expires' => 1317790800, 'firstname' => 'first', 'lastname' => 'last', 'address1' => '123 Main St', 'address2' => 'Apt 123', 'zip' => '00000-0000', 'city' => 'Anytown', 'country' => 'US', 'state' => 'NJ', 'shipping_firstname' => 'sfirst', 'shipping_lastname' => 'slast', 'shipping_address1' => '987 1st Ave', 'shipping_address2' => 'Suite 123', 'shipping_zip' => '00000-0000', 'shipping_city' => 'Anytown', 'shipping_country' => 'US', 'shipping_state' => 'NJ', 'phone' => '123-456-7890', 'custom1' => 'custom1', 'custom2' => 'custom2', 'custom3' => 'custom3', 'custom4' => 'custom4', 'custom5' => 'custom5' ), 'affiliate_campaign' => 'test_campaign', 'reason' => 'Mistakenly credited sale to the wrong offer' ); $result = $client->call('set_aff_sales_add', Array(), 'offeritapiadmin_wsdl');
Sample Output
on success: Edit SUCCESS on error: error message