APIs for Customer Search

Many customers use the Salesforce B2C Commerce scripting API to run customer searches. B2C Commerce automatically performs a full-text search.

Note: We highly recommend that you convert all code to use the searchProfiles and processProfiles methods to take advantage of the search relevance functionality and its improved performance.

API Usage

The dw.customer.CustomerMgr APIs behave as follows:

Customer Profile Batch Processing API

The scripting API, dw.customer.CustomerMgr.processProfiles() enables you to process customer profiles in batch mode. This API, based on the full text search service, can process a large number of profile objects with optimized search performance and memory management.

Use this API in custom jobs to replace these older APIs:

The dw.customer.CustomerMgr.processProfiles(…) API accepts a customer profile object query and a JavaScript callback function as input parameters. The method searches customer profiles based on the specified query parameters and executes the specified callback function for each search result.

This is an example of how you would use this API:

function callback(profile: Profile)
{
 // PROCESSING CODE GOES HERE 
}
 dw. customer.CustomerMgr.processProfiles("gender=1", callback);

Related Links

Customer Data for Developers

B2C Commerce API documentation