SearchTerms

Description

The SearchTerms method retrieves Terms objects from the EBizCharge platform. Results can be sorted by field name and filtered by termsInternalId or termsId. If neither ID is included, the method returns all Terms objects.

Syntax

Terms[] SearchTerms(SecurityToken securityToken , string termsInternalId, string termsId, int start, int limit, string sort)

Arguments

TypeNameReq.Description
SecurityTokensecurityTokenRA unique token that is used to identify a merchant and authenticate the API request.
stringtermsInternalIdOInternal ID for the Terms object to search for.
stringtermsIdOTerms ID for the Terms object to search for.
intstartR

Index of the first object to return in the array.

Note: Must be ≥ 0.

intlimitR

Maximum number of objects to return.

Note: Must be > 0.

stringsortOSorts by field name.
Supported Sort Parameters
  • TermsId
  • TermsName
  • TermsDescription
  • NetDueInDays
  • DiscountPercentage
  • DiscountIfPaidWithinDays
  • IsInactive

Return Value

TypeDescription
Terms[]On success, returns an array of Terms objects matching the searched parameters. Otherwise, a fault is returned.

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header />
   <soapenv:Body>
      <ebiz:SearchTerms>
         <ebiz:securityToken>
            <ebiz:SecurityId>********-55ee-434c-b126-************</ebiz:SecurityId>
            <ebiz:UserId />
            <ebiz:Password />
         </ebiz:securityToken>
         <ebiz:termsInternalId />
         <ebiz:termsId />
         <ebiz:start>0</ebiz:start>
         <ebiz:limit>10</ebiz:limit>
         <ebiz:sort />
      </ebiz:SearchTerms>
   </soapenv:Body>
</soapenv:Envelope>
private static void searchTerms()
{
  IeBizService apiClient = new IeBizServiceClient();
  SecurityToken securityToken = new SecurityToken
  {
    SecurityId = "*******-c870-41b8-aa5c-********",
    UserId = "",
    Password = ""
    };
  string termsInternalId = "";
  string termsId = "Net30";

  //Define pagination and sorting
  int start = 0;      // Start index (0 = first record)
  int limit = 10;     // Maximum number of records to return
  string sort = "true"; // Sort results by field (optional)
  //Call SearchTerms API
  Terms[] termsList = apiClient.SearchTerms(
    securityToken,
    termsInternalId,
    termsId,
    start,
    limit,
    sort
  );
  //Display results
  foreach (var terms in termsList)
  {
    Console.WriteLine($"TermsInternalId:       {terms.TermsInternalId}");
    Console.WriteLine($"TermsId:               {terms.TermsId}");
    Console.WriteLine($"TermsName:             {terms.TermsName}");
    Console.WriteLine($"TermsDescription:      {terms.TermsDescription}");
    Console.WriteLine($"NetDueInDays:          {terms.NetDueInDays}");
    Console.WriteLine($"DiscountPercentage:    {terms.DiscountPercentage}");
    Console.WriteLine($"DiscountIfPaidWithin:  {terms.DiscountIfPaidWithinDays}");
    Console.WriteLine($"IsInactive:           {terms.IsInactive}");
    Console.ReadLine();
  }
}
function searchTerms()
{
  // 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'   => ''
  );



  // Parameters for the SearchSalesRep request
  $params = array(
    'securityToken'       => $securityToken,
    'termsInternalId'  => '',    
    'termsId'          => 'Net30',    
    'start'               => 0, //Start position, defaults to 0 (first payment found)
    'limit'               => 10, //Maximum number of payments to return in result. Default Max 1000.
    'sort'                => ''     
  );

  try {
    // Make the SOAP request
    $response = $client->SearchTerms($params);

    // Extract the result
    $result = $response->SearchTermsResult;

    // Display the response
    echo "<pre>";
    print_r($result);
    echo "</pre>";

  } catch (SoapFault $e) {
    // Handle SOAP errors
    echo "SOAP Error: " . $e->getMessage();
  }
}

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">
      <SearchTermsResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <SearchTermsResult>
            <Terms>
               <TermsInternalId>********-a1df-4f5e-998e-************</TermsInternalId>
               <TermsId>T-0001</TermsId>
               <TermsName>Net30</TermsName>
               <TermsDescription/>
               <NetDueInDays>30</NetDueInDays>
               <DiscountPercentage>4.00</DiscountPercentage>
               <DiscountIfPaidWithinDays>4</DiscountIfPaidWithinDays>
               <IsInactive>false</IsInactive>
            </Terms>
         </SearchTermsResult>
      </SearchTermsResponse>
   </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>