GetCustomerToken

Description

The GetCustomerToken method retrieves the customer token (CustNum) associated to a Customer.

Syntax

string GetCustomerToken(SecurityToken securityToken, string CustomerId, string customerInternalId)

Arguments

Type

Name

Req.

Description

SecurityToken

securityToken

R

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

string

CustomerId

D

Identifies the Customer associated with the CustNum .

Note: Required if customerInternalId is not provided.

string

customerInternalId

D

Identifies the Customer associated with the CustNum.

Note: Required if CustomerId is not provided.

Return Value

TypeDescription
stringOn success, retrieves the CustNum . Otherwise, returns a fault.

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:GetCustomerToken>
         <ebiz:securityToken>
            <ebiz:SecurityId>***********4a38-ad78***********</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:CustomerId>test</ebiz:CustomerId>
         <ebiz:customerInternalId/>
      </ebiz:GetCustomerToken>
   </soapenv:Body>
</soapenv:Envelope>
var client = new IeBizServiceClient();

SecurityToken securityToken = new SecurityToken
{
    SecurityId = "***********4bf0-91cd***********",
    UserId = "",
    Password = ""
};

string customerId = "1";
string customerInternalId = "";

string customerToken = client.GetCustomerToken(securityToken, customerId, customerInternalId);
Console.WriteLine($"{customerToken}");
function getCustomerToken(){
  $client = new SoapClient('End point URL');
  $securityToken = array(
    'SecurityId' => '***********4757-4567***********',
    'UserId' => 'merchant1',
    'Password' => 'merchant1'
  );
  $getCustomerToken = array(
    'securityToken' => $securityToken,
    'customerToken' => '*******'
  );
  $getCustomerTokenResponse = $client->GetCustomerToken($getCustomerToken);
  $getCustomerTokenResponseResult = $getCustomerTokenResponse->GetCustomerTokenResult;
}

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">
      <GetCustomerTokenResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <GetCustomerTokenResult>*******</GetCustomerTokenResult>
      </GetCustomerTokenResponse>
   </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">Customer Not Found</faultstring>
      </s:Fault>
   </s:Body>
</s:Envelope>