UpdateTerms
Description
The UpdateTerms method updates an existing Terms object in the EBizCharge platform.
Syntax
TermsResponse UpdateTerms(SecurityToken securityToken, Terms terms, string termsId, string termsInternalId)
Arguments
Type | Name | Description | |
|---|---|---|---|
securityToken | R | A unique token that is used to identify a merchant and authenticate the API request. | |
terms | R | The updated Terms object that replaces the existing one. Warning: Omitting a field clears its value. Required Fields
| |
string | termsId | D | Identifies the Terms object to update. Note: Required if |
string | termsInternalId | D | Identifies the Terms object to update. Note: Required if |
Return Value
| Type | Description |
|---|---|
| TermsResponse | Indicates whether the operation was successful. |
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
<soapenv:Header />
<soapenv:Body>
<ebiz:UpdateTerms>
<ebiz:securityToken>
<ebiz:SecurityId>*************-4621-b899-************</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityToken>
<ebiz:terms>
<ebiz:TermsId>Net30</ebiz:TermsId>
<ebiz:TermsName/>
<ebiz:TermsDescription/>
<ebiz:NetDueInDays>30</ebiz:NetDueInDays>
<ebiz:DiscountPercentage>4</ebiz:DiscountPercentage>
<ebiz:DiscountIfPaidWithinDays>4</ebiz:DiscountIfPaidWithinDays>
<ebiz:IsInactive>false</ebiz:IsInactive>
</ebiz:terms>
<ebiz:termsId/>
<ebiz:termsInternalId>*************-4149-8407-************</ebiz:termsInternalId>
</ebiz:UpdateTerms>
</soapenv:Body>
</soapenv:Envelope>private static void UpdateTerms()
{
IeBizService apiClient = new IeBizServiceClient();
SecurityToken securityToken = new SecurityToken
{
SecurityId = "*******-c870-41b8-aa5c-********", // Replace with your actual token
UserId = "", // Optional: only if your account enforces user credentials
Password = ""
};
//Required fields
string termsId = "Net30";
string termsInternalId = "97b24891-9a15-4911-ab6b-dc9ebc24a1ed";
//Create the Terms object with updated information
Terms terms = new Terms();
terms.TermsName = "Net30";
terms.NetDueInDays = 69;
terms.IsInactive = false;
terms.ExternalUniqueId = "Net30";
//Optional fields
terms.TermsDescription = "Net 30 payment terms";
terms.DiscountPercentage = 0;
terms.DiscountIfPaidWithinDays = 0;
TermsResponse response = apiClient.UpdateTerms(securityToken, terms, termsId, termsInternalId);
//Display results
Console.WriteLine($"Status: {response.Status}");
Console.WriteLine($"Status Code: {response.StatusCode}");
Console.WriteLine($"Error: {response.Error}");
Console.WriteLine($"Error Code: {response.ErrorCode}");
Console.ReadLine();
}function updateTerms()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '******-454757-4567457-777',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$terms = array(
'TermsId' => 'Net30',
'TermsName' => 'Net30',
'TermsDescription' => 'Net30',
'NetDueInDays' => '30',
'DiscountPercentage' =>'2',
'DiscountIfPaidWithinDays' => '10',
'IsInactive' => 0,
'ExternalUniqueId' => 'Net30'
);
$updateTerms = array(
'securityToken' => $securityToken,
'terms' => $terms,
'termsId' => 'Net30',
'termsInternalId' => 'Net30'
);
$updateTermsResponse = $client->UpdateTerms($updateTerms);
$updateTermsResponseResult = $addTermsResponse->UpdateTermsResult;
}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">
<UpdateTermsResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<UpdateTermsResult>
<Status>Success</Status>
<StatusCode>1</StatusCode>
<Error/>
<ErrorCode>0</ErrorCode>
</UpdateTermsResult>
</UpdateTermsResponse>
</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">
<UpdateTermsResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<UpdateTermsResult>
<Status>Error</Status>
<StatusCode>0</StatusCode>
<Error>Record not found</Error>
<ErrorCode>3</ErrorCode>
</UpdateTermsResult>
</UpdateTermsResponse>
</s:Body>
</s:Envelope>Updated 6 months ago
