GetTerms
Description
The GetTerms method retrieves a specific Terms object from the EBizCharge platform.
Syntax
Terms GetTerms(SecurityToken securityToken , 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. | |
string | termsId | D | Identifies the Terms object to retrieve. Note: Required if |
string | termsInternalId | D | Identifies the Terms object to retrieve. Note: Required if |
Return Value
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
<soapenv:Header />
<soapenv:Body>
<ebiz:GetTerms>
<ebiz:securityToken>
<ebiz:SecurityId>*************-4621-b899-************</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityToken>
<ebiz:termsId/>
<ebiz:termsInternalId>*************-4149-8407-************</ebiz:termsInternalId>
</ebiz:GetTerms>
</soapenv:Body>
</soapenv:Envelope>private static void GetTerms()
{
IeBizService apiClient = new IeBizServiceClient();
SecurityToken securityToken = new SecurityToken
{
SecurityId = "*******-c870-41b8-aa5c-********",
UserId = "",
Password = ""
};
//Provide identifiers
string termsId = "Net30";
string termsInternalId = "";
//Call GetTerms API
Terms terms = apiClient.GetTerms(securityToken, termsId, termsInternalId);
//Display Terms details
Console.WriteLine($"Terms Internal ID: {terms.TermsInternalId}");
Console.WriteLine($"Terms ID: {terms.TermsId}");
Console.WriteLine($"Terms Name: {terms.TermsName}");
Console.WriteLine($"Terms Description: {terms.TermsDescription}");
Console.WriteLine($"Net Due In Days: {terms.NetDueInDays}");
Console.WriteLine($"Discount Percentage: {terms.DiscountPercentage}");
Console.WriteLine($"Discount If Paid Within: {terms.DiscountIfPaidWithinDays}");
Console.WriteLine($"Is Inactive: {terms.IsInactive}");
Console.ReadLine();
}function getTerms()
{
// Initialize the SOAP client (replace with your actual endpoint URL)
$client = new SoapClient("End point URL");
// Define the merchant security token
$securityToken = array(
'SecurityId' => '*******-c870-41b8-aa5c-********',
'UserId' => '',
'Password' => ''
);
// Prepare parameters for the GetSalesRep call
$params = array(
'securityToken' => $securityToken,
'termsId' => 'Net30',
'termsInternalId' => ''
);
try {
// Make the SOAP request
$response = $client->GetTerms($params);
// Extract result object from response
$result = $response->GetTermsResult;
// Display the response
echo "<pre>";
print_r($result);
echo "</pre>";
} catch (SoapFault $e) {
// Handle any SOAP errors
echo "SOAP Error: " . $e->getMessage();
}
}Example Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GetTermsResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<GetTermsResult>
<TermsInternalId>*************-4149-8407-************</TermsInternalId>
<TermsId>T-0001</TermsId>
<TermsName>Net30</TermsName>
<TermsDescription />
<NetDueInDays>30</NetDueInDays>
<DiscountPercentage>4.00</DiscountPercentage>
<DiscountIfPaidWithinDays>4</DiscountIfPaidWithinDays>
<IsInactive>false</IsInactive>
</GetTermsResult>
</GetTermsResponse>
</s:Body>
</s:Envelope><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:NotFound</faultcode>
<faultstring xml:lang="en-US">Not Found</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>Updated 6 months ago
