UpdateSubCustomer
Description
The UpdateSubCustomer method updates an existing SubCustomer object in the EBizCharge platform.
Syntax
SubCustomerResponse UpdateSubCustomer(SecurityToken securityToken, SubCustomer subCustomer, string customerId, string subCustomerId, string subCustomerInternalId)
Arguments
Type | Name | Description | |
|---|---|---|---|
securityToken | R | A unique token that is used to identify a merchant and authenticate the API request. | |
subCustomer | R | The updated SubCustomer object. Warning: Omitting a field clears its value. Required FieldsIf using the objects below, the following fields are required. Unused objects must be removed from the request.
Recommended Fields
| |
string | customerId | D | Identifies the Customer object associated with the SubCustomer object to update. Note: Required if |
string | subCustomerId | D | Identifies the SubCustomer object to update. Note: Required if |
string | subCustomerInternalId | D | Identifies the SubCustomer object to update. Note: Required if |
Note: It is best practice to provide either subCustomerInternalId, or customerId and subCustomerId — but not all three.
Return Value
| Type | Description |
|---|---|
| SubCustomerResponse | Indicates whether the operation was successful. If successful, returns the CustomerId and SubCustomerId. Otherwise, returns error information. |
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
<soapenv:Header/>
<soapenv:Body>
<ebiz:UpdateSubCustomer>
<ebiz:securityToken>
<ebiz:SecurityId>*************-4621-b899-************</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityToken>
<ebiz:subCustomer>
<ebiz:CustomerId>CUST-0001</ebiz:CustomerId>
<ebiz:SubCustomerId>SUB-CUST-001</ebiz:SubCustomerId>
<ebiz:BillingAddress>
<ebiz:FirstName/>
<ebiz:LastName/>
<ebiz:CompanyName/>
<ebiz:Address1/>
<ebiz:City/>
<ebiz:State/>
<ebiz:ZipCode/>
<ebiz:Country/>
<ebiz:IsDefault>true</ebiz:IsDefault>
<ebiz:AddressId/>
</ebiz:BillingAddress>
<ebiz:ShippingAddress/>
<ebiz:FirstName/>
<ebiz:LastName/>
<ebiz:CompanyName/>
<ebiz:Phone/>
<ebiz:CellPhone/>
<ebiz:Fax/>
<ebiz:Email/>
<ebiz:WebSite/>
<ebiz:SubCustomerNotes/>
<ebiz:SoftwareId/>
<ebiz:SubCustomerCustomFields>
<!--Zero or more repetitions:-->
<ebiz:EbizCustomField>
<ebiz:FieldId/>
<ebiz:FieldCaption/>
<ebiz:FieldName/>
<ebiz:FieldValue/>
<ebiz:FieldType/>
<ebiz:FieldDataType/>
<ebiz:FieldDescription/>
</ebiz:EbizCustomField>
</ebiz:SubCustomerCustomFields>
<ebiz:DivisionId/>
</ebiz:subCustomer>
<ebiz:customerId/>
<ebiz:subCustomerId/>
<ebiz:subCustomerInternalId>*************-4b9c-9ba1-************</ebiz:subCustomerInternalId>
</ebiz:UpdateSubCustomer>
</soapenv:Body>
</soapenv:Envelope>public void UpdateSubCustomer()
{
eBizService apiClient = new eBizService();
SecurityToken securityToken = new SecurityToken
{
SecurityId = "*******-c870-41b8-aa5c-************",
UserId = "",
Password = ""
};
var subCustomer = apiClient.GetSubCustomer(securityToken, "","", "*************-41b3-a2e7-************");
subCustomer.FirstName = "Mark update";
subCustomer.LastName = "Wilson update";
subCustomer.CompanyName = "CBS";
subCustomer.CellPhone = "714-555-1111";
subCustomer.Fax = "714-555-1235";
subCustomer.Phone = "714-555-2525";
var response = apiClient.UpdateSubCustomer(securityToken, subCustomer, "", "","*************-41b3-a2e7-************");
Console.WriteLine(response.SubCustomerInternalId);
Console.WriteLine(response.CustomerId);
Console.ReadLine();
}public function UpdateSubCustomer()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '******-454757-*******',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$response = $client->UpdateSubCustomer(
array(
'securityToken' => $securityToken,
'customerId' => '123',
'subCustomerId' => '1234',
'subCustomerInternalId' => '****-43343-*******',
'subcustomer' => array(
'FirstName' => 'Frank',
'LastName' => 'Jones',
'CompanyName' => 'CBS',
'Phone' => 10000000,
'CellPhone' => 10000000,
'Fax' => 10000000,
'Email' => '[email protected]',
'WebSite' => '',
'BillingAddress' => array(),
'ShippingAddress' => array(),
'DateTimeCreated' => date('Y-m-d H:i:s'),
'DateTimeModified' => date('Y-m-d H:i:s'),
)
)
);
$result = $response->UpdateSubCustomerResult;
}Example Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UpdateSubCustomerResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<UpdateSubCustomerResult>
<CustomerId>CUST-0001</CustomerId>
<SubCustomerId>SUB-CUST-001</SubCustomerId>
<SubCustomerInternalId>*************-4b9c-9ba1-************</SubCustomerInternalId>
<Status>Success</Status>
<StatusCode>1</StatusCode>
<Error/>
<ErrorCode>0</ErrorCode>
</UpdateSubCustomerResult>
</UpdateSubCustomerResponse>
</s:Body>
</s:Envelope><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UpdateSubCustomerResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<UpdateSubCustomerResult>
<CustomerId/>
<SubCustomerInternalId/>
<Status>Failed</Status>
<StatusCode>0</StatusCode>
<Error/>
<ErrorCode>0</ErrorCode>
</UpdateSubCustomerResult>
</UpdateSubCustomerResponse>
</s:Body>
</s:Envelope>Updated 6 months ago
