Update reseller information
Last updated: 02-May-2017
Rate this article:
Overview
Use this method to update the details for an existing reseller entity in the Avangate platform.
Note: Updating the details of a reseller does not impact the reseller information already attached to existing partner orders. Let's assume that you added Reseller 1 to Order 1, and then update Reseller 1 changing the company name. Reseller 1 for Order 1 will continue to feature the old Reseller 1 information. To swap it for the new details, add the reseller to the order again using setOrderReseller.
Requirements
Parameters
Parameter | Type/Description |
---|---|
sessionID | Required (string) |
Session identifier, which is the output of the Login method. An exception will be thrown if the values are incorrect. | |
Reseller | Required (object) |
Response
Parameter | Type/Description |
---|---|
Result | Boolean |
Request
<?php
require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner
$Reseller = new stdClass(); // Reseller details that will be updated
$Reseller ->ResellerCode = 'YOUR_RESELLER_CODE'; // Reseller code identifying the reseller whose details are updated. Must belong to an existing reseller.
$Reseller->Company = 'NewCompanyName';
$Reseller->FirstName = ' NewFirstName';
$Reseller->LastName = 'NewLastName';
$Reseller->Email = 'Newemail@example.com';
$Reseller->Phone = '123333344';
$Reseller->Fax = '12234567';
$Reseller->Country = 'US';
$Reseller->State = 'California';
$Reseller->City = 'LA';
$Reseller->Address = 'Address';
$Reseller->PostalCode = '90210';
try {
$UpdatedReseller= $client->updateReseller($sessionID, $Reseller);
} catch (SoapFault $e) {
Echo "UpdatedReseller: " . $e->getMessage();
exit;
}
var_dump ("UpdatedReseller ", $UpdatedReseller);
//If the reseller is attached to an existing order you need to reassign the updated reseller details to the order, as the info won't be refreshed automatically.
try {
$Reseller= $client->getOrderReseller ($sessionID, $RefNo);
} catch (SoapFault $e) {
Echo "Reseller: " . $e->getMessage();
exit;
}
var_dump ("Reseller ", $Reseller);
$ResellerCodeNew = $Reseller->ResellerCode;
try {
$AddedReseller= $client->setOrderReseller ($sessionID, $RefNo, $ResellerCodeNew);
} catch (SoapFault $e) {
Echo "orderReseller: " . $e->getMessage();
exit;
}
var_dump ("orderReseller ", $AddedReseller);
Rate this article: