Manage Merchant Profiles (SOAP)

SOAP API Reference

Print Friendly, PDF & Email

Manage Merchant Profiles (SOAP)

Click on one of the following topics to learn more!

The IsMerchantProfileInitialized operation can be used to verify that a specific Merchant Profile has been saved at least once, or "initialized", for a specific Tender Type.

 

Operation

bool IsMerchantProfileInitialized(string sessionToken, string serviceId, string merchantProfileId, TenderType tenderType);
 

Parameters

Parameter Data Type Description
sessionToken String The limited-life token used to authenticate to CWS.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
merchantProfileId String The specific Merchant Profile to verify.
tenderType TenderType The tender type associated with the Merchant Profile.
 

Return Type

Data Type Description
Boolean Returns ‘true’ if the Merchant Profile has been initialized.
 

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault
For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.
 

Code Snippets

public bool IsMerchantProfileInitialized(string sessionToken, string serviceId, string merchantProfileId, TenderType tenderType)
{
  using (var client = new CWSServiceInformationClient(ConfigurationManager.AppSetting["Bindings.StsSoap"]))
  {
    try
    {
      return client.IsMerchantProfileInitialized(sessionToken, serviceId, merchantProfileId, tenderType);
    }
    catch (FaultException ex)
    {
      SoapFaultHandler.HandleFaultException(ex);
    }
  }
};
public function isMerchantProfileInitialized($merchProfileId, $serviceId)
{
  if (! $this->signOn ())
    return false;
  try
  {
    $mi = new IsMerchantProfileInitialized ();
    $mi->sessionToken = $this->session_token;
    $mi->serviceId = $serviceId;
    $mi->tenderType = 'Credit';
    $mi->merchantProfileId = $merchProfileId;
    $response = $this->serviceInfo->isMerchantProfileInitialized ( $mi );
    //echo ('
'.$this->serviceInfo->__getLastRequest());
    //echo ('
'.$this->serviceInfo->__getLastResponse());
    return $response;
  }
  catch ( SoapFault $e )
  {
    echo 'SERVER ERROR: Error Checking if Merchant Profile is Initialized.
';
    $xmlFault = $this->serviceInfo->__getLastResponse ();
    $errors = handleSvcInfoFault ( $e, $xmlFault );
    echo $errors;
    exit ();
  }
}
Note: The HTTP Authorization Header must contain the required sessionToken value.
 

The GetMerchantProfile operation retrieves a specific Merchant Profile and associated profile data (MerchantProfile) for a specific Service ID and Tender Type. To retrieve all profiles in a list, refer to the GetMerchantProfiles operation.

 

Operation

MerchantProfile GetMerchantProfile(string sessionToken, string merchantProfileId, string serviceId, TenderType tenderType);
 

Parameters

Parameter Data Type Description
sessionToken String The limited-life token used to authenticate to CWS.
merchantProfileId String The specific Merchant Profile to retrieve.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation. Note: Not specifying the serviceId will return all merchantProfileIds associated with all serviceIds.
tenderType The tender type associated with the Merchant Profile.
 

Return Type

Data Type Description
MerchantProfile The requested Merchant Profile and associated profile data.
 

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault
For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.
 

Code Snippets

public function getMerchantProfile($svcId, $merchProfId, $tndrType)
{
  if (! $this->signOn ())
    return false;
  try
  {
    $mp = new GetMerchantProfile ();
    $mp->sessionToken = $this->session_token;
    $mp->serviceId = $svcId;
    $mp->merchantProfileId = $merchProfId;
    $mp->tenderType = $tndrType;
    $response = $this->serviceInfo->GetMerchantProfile ( $mp );
    return $response->GetMerchantProfilesResult->MerchantProfile;
  }
  catch ( SoapFault $e )
  {
    echo 'SERVER ERROR: Error Retrieving Merchant Profiles.
';
    $xmlFault = $this->serviceInfo->__getLastResponse ();
    $errors = handleSvcInfoFault ( $e, $xmlFault );
    echo $errors;
    exit ();
  }
}

The GetMerchantProfiles operation retrieves all merchantProfileId‘s and associated profile data (MerchantProfile) for a specific Service ID and Tender Type. This is useful in multi-merchant application scenarios to allow for the update of a specific Merchant Profile by passing the merchantProfileId with the GetMerchantProfile operation.

 

Operation

List GetMerchantProfiles(string sessionToken, string serviceId, TenderType tenderType);
 

Parameters

Parameter Data Type Description
sessionToken String The limited-life token used to authenticate to CWS.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation. Note: Not specifying the serviceId will return all merchantProfileIds associated with all serviceIds.
tenderType TenderType The tender type associated with the Merchant Profile.
 

Return Type

Data Type Description
List<MerchantProfile> A collection of Merchant Profiles with associated profile data.
 

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault
For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.
 

Code Snippets

public List GetMerchantProfiles(string sessionToken, string serviceId, TenderType tenderType, string merchantProfileId = null)
{
  using (var client = new CWSServiceInformationClient(ConfigurationManager.AppSettings["Bindings.StsSoap"]))
  {
    try
    {
      return client.GetMerchantProfiles(sessionToken, serviceId, tenderType).ToList();
    }
    catch (FaultException ex)
    {
      SoapFaultHandler.HandleFaultException(ex);
    }
  }
}
public function getMerchantProfiles($svcId, $tndrType)
{
  if (! $this->signOn ())
    return false;
  try
  {
    $mp = new GetMerchantProfiles ();
    $mp->sessionToken = $this->session_token;
    $mp->serviceId = $svcId;
    $mp->tenderType = $tndrType;
    $response = $this->serviceInfo->GetMerchantProfiles ( $mp );
    //echo ('
'.$this->serviceInfo->__getLastRequestHeaders());
    //echo ('
'.$this->serviceInfo->__getLastRequest());
    //echo ('
'.$this->serviceInfo->__getLastResponseHeaders());
    //echo ('
'.$this->serviceInfo->__getLastResponse());
    return $response->GetMerchantProfilesResult->MerchantProfile;
  }
  catch ( SoapFault $e )
  {
    echo 'SERVER ERROR: Error Retrieving Merchant Profiles.
';
    $xmlFault = $this->serviceInfo->__getLastResponse ();
    $errors = handleSvcInfoFault ( $e, $xmlFault );
    echo $errors;
    exit ();
  }
}

/* Return only the Merchant Profile Id */

public function getMerchantProfileId()
{
  $response = $this->getMerchantProfiles ();
  if ($response)
  return $response->GetMerchantProfilesResult->MerchantProfile->ProfileId;
  return false;
}

The GetMerchantProfileIds operation retrieves a list of all merchantProfileId’s associated with a specific Service ID and Tender Type, without returning any merchant profile data (MerchantProfile). Once retrieved, the application should invoke either GetMerchantProfile or GetMerchantProfiles to retrieve profile data associated with specific merchantProfileId’s.

 

Operation

List GetMerchantProfileIds(string sessionToken, string serviceId, TenderType tenderType);
 

Parameters

Parameter Data Type Description
sessionToken String The limited-life token used to authenticate to CWS.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation. Note: Not specifying the serviceId will return all merchantProfileIds associated with all serviceIds.
tenderType TenderType The tender type associated with the Merchant Profile.
 

Return Type

Data Type Description
List A list of Merchant Profiles only.
 

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault
For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.
 

Code Snippets

 

None

The GetMerchantProfilesByProfileId operation retrieves all merchant specific Merchant Profiles and associated profile data (MerchantProfile) by merchantProfileid.

 

Operation

List MerchantProfile GetMerchantProfilesByProfileId (string sessionToken, string merchantProfileId);
 

Parameters

Parameter Data Type Description
sessionToken String The limited-life token used to authenticate to CWS.
merchantProfileId String The specific merchant profile to retrieve.
 

Return Type

Data Type Description
List MerchantProfile A list of merchant specific Merchant Profiles with associated profile data.
 

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault
For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.
 

Code Snippets

 

None