AddTerms

Description

The AddTerms method is used to create a new Terms object in the EBizCharge platform.

Syntax

TermsResponse AddTerms(SecurityToken securityToken, Terms terms)

Arguments

Type

Name

Req.

Description

SecurityToken

securityToken

R

A unique token that is used to identify a merchant and authenticate the API request.

Terms

terms

R

Details of the new Terms object.

Required Fields
  • TermsId
  • NetDueInDays
  • DiscountPercentage
  • DiscountIfPaidWithinDays
  • IsInactive

Return Value

TypeDescription
TermsResponseIndicates whether the operation was successful. If successful, returns the assigned TermsInternalId. 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:AddTerms>
         <ebiz:securityToken>
            <ebiz:SecurityId>*******-1906-4be3-b01d-************</ebiz:SecurityId>
            <ebiz:UserId>cbs01</ebiz:UserId>
            <ebiz:Password>cbs01</ebiz:Password>
         </ebiz:securityToken>
         <ebiz:terms>
            <ebiz:TermsId>Net30</ebiz:TermsId>
            <ebiz:TermsName/>
            <ebiz:TermsDescription/>
            <ebiz:NetDueInDays>30</ebiz:NetDueInDays>
            <ebiz:DiscountPercentage>2</ebiz:DiscountPercentage>
            <ebiz:DiscountIfPaidWithinDays>10</ebiz:DiscountIfPaidWithinDays>
            <ebiz:IsInactive>0</ebiz:IsInactive>
            <ebiz:ExternalUniqueId/>
         </ebiz:terms>
      </ebiz:AddTerms>
   </soapenv:Body>
</soapenv:Envelope>
private static void AddTerms()
{
  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 = ""
    };

  Terms terms = new Terms();
  //Required fields
  terms.TermsId = "Net30";
  terms.TermsInternalId = "";
  terms.TermsName = "Net30";
  terms.NetDueInDays = 30;
  terms.IsInactive = false;
  terms.ExternalUniqueId = "Net30";

  //Optional fields
  terms.TermsDescription = "Net 30 payment terms";
  terms.DiscountPercentage = 0;
  terms.DiscountIfPaidWithinDays = 0;

  TermsResponse response = apiClient.AddTerms(securityToken, terms);

  Console.WriteLine($"Status: {response.Status}");
  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 addTerms()
{
  $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'
  );
  $addTerms = array(
    'SecurityToken' => $securityToken,
    'Terms' => $terms
  );
  $addTermsResponse = $client->AddTerms($addTerms);
  $addTermsResponseResult = $addTermsResponse->AddTermsResult;
}

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">
      <AddTermsResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <AddTermsResult>
            <TermsId>Net30</TermsId>
            <TermsInternalId>********-0022-4114-b267-************</TermsInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </AddTermsResult>
      </AddTermsResponse>
   </s:Body>
</s:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <s:Fault>
         <faultcode>s:Client</faultcode>
         <faultstring xml:lang="en-US">Invalid TermsId</faultstring>
      </s:Fault>
   </s:Body>
</s:Envelope>