Add multiple customers to a (static) customer group. This endpoint assigns the specified customers to the customer group identified by the given ID. Only static customer groups support this operation.
If you would like to get a raw Response object use the other assignCustomerGroupMembers function.
An object containing the options for this method.
A promise of type CustomerGroupMemberResult.
Add multiple customers to a (static) customer group. This endpoint assigns the specified customers to the customer group identified by the given ID. Only static customer groups support this operation.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CustomerGroupMemberResult otherwise.
Creates a new customer address with the given address information.
If you would like to get a raw Response object use the other createAddressForCustomerInCustomerList function.
An object containing the options for this method.
A promise of type CustomerAddress.
Creates a new customer address with the given address information.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CustomerAddress otherwise.
Create a new customer. The customer is created using the specified customer number, credentials, and customer information. This action verifies:
If the action fails to create the customer, it returns a 400 fault with an appropriate message.
If you would like to get a raw Response object use the other createCustomerInCustomerList function.
An object containing the options for this method.
A promise of type Customer.
Create a new customer. The customer is created using the specified customer number, credentials, and customer information. This action verifies:
If the action fails to create the customer, it returns a 400 fault with an appropriate message.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Customer otherwise.
Create a new customer. The customer is created using the specified credentials and customer information. This action verifies:
If the action fails to create the customer, it returns a 400 fault with an appropriate message.
If you would like to get a raw Response object use the other createCustomerList function.
An object containing the options for this method.
A promise of type Customer.
Create a new customer. The customer is created using the specified credentials and customer information. This action verifies:
If the action fails to create the customer, it returns a 400 fault with an appropriate message.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Customer otherwise.
Deletes the customer, including all related information like the customer addresses.
If you would like to get a raw Response object use the other deleteCustomerFromCustomerList function.
An object containing the options for this method.
A promise of type void.
Deletes the customer, including all related information like the customer addresses.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Action that returns a single customer address from a customer list.
If you would like to get a raw Response object use the other getAddressForCustomerFromCustomerList function.
An object containing the options for this method.
A promise of type CustomerAddress.
Action that returns a single customer address from a customer list.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CustomerAddress otherwise.
Returns a list of all customer addresses in pages. The default page size is 10 customer addresses.
If you would like to get a raw Response object use the other getAddressesForCustomerFromCustomerList function.
An object containing the options for this method.
A promise of type CustomerAddressResult.
Returns a list of all customer addresses in pages. The default page size is 10 customer addresses.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CustomerAddressResult otherwise.
Action to get customer information.
If you would like to get a raw Response object use the other getCustomerFromCustomerList function.
An object containing the options for this method.
A promise of type Customer.
Action to get customer information.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Customer otherwise.
Returns a list of all customer groups for a given site in pages. The default page size is 25 customer groups.
If you would like to get a raw Response object use the other getCustomerGroups function.
An object containing the options for this method.
A promise of type CustomerGroupResult.
Returns a list of all customer groups for a given site in pages. The default page size is 25 customer groups.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CustomerGroupResult otherwise.
Deletes a customer address.
If you would like to get a raw Response object use the other removeAddressForCustomerInCustomerList function.
An object containing the options for this method.
A promise of type void.
Deletes a customer address.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Search for customer groups in a given site ID. The query attribute specifies a complex query that can be used to narrow down the search. The following list provides searchable attributes:
| Attribute | Type |
|---|---|
| id | String |
| description | String |
| type | String |
Note: This endpoint is available with B2C Commerce version 24.2.
If you would like to get a raw Response object use the other searchCustomerGroup function.
An object containing the options for this method.
A promise of type CustomerGroupSearchResult.
Search for customer groups in a given site ID. The query attribute specifies a complex query that can be used to narrow down the search. The following list provides searchable attributes:
| Attribute | Type |
|---|---|
| id | String |
| description | String |
| type | String |
Note: This endpoint is available with B2C Commerce version 24.2.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CustomerGroupSearchResult otherwise.
Search for customers in a customer list. The query attribute specifies a complex query that can be used to narrow down the search. The following list provides searchable attributes:
| Attribute | Type |
|---|---|
| customerNo | String |
| firstName | String |
| secondName | String |
| lastName | String |
| suffix | String |
| salutation | String |
| title | String |
| fax | String |
| phoneHome | String |
| phoneBusiness | String |
| phoneMobile | String |
| String | |
| gender | Integer |
| companyName | String |
| credentials.login | String |
| credentials.enabled | Boolean |
If you would like to get a raw Response object use the other searchCustomerInCustomerList function.
An object containing the options for this method.
A promise of type CustomerSearchResult.
Search for customers in a customer list. The query attribute specifies a complex query that can be used to narrow down the search. The following list provides searchable attributes:
| Attribute | Type |
|---|---|
| customerNo | String |
| firstName | String |
| secondName | String |
| lastName | String |
| suffix | String |
| salutation | String |
| title | String |
| fax | String |
| phoneHome | String |
| phoneBusiness | String |
| phoneMobile | String |
| String | |
| gender | Integer |
| companyName | String |
| credentials.login | String |
| credentials.enabled | Boolean |
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CustomerSearchResult otherwise.
Remove multiple customers from a (static) customer group. This endpoint unassigns the specified customers from the customer group identified by the given ID. Only static customer groups support this operation.
If you would like to get a raw Response object use the other unassignCustomerGroupMembers function.
An object containing the options for this method.
A promise of type void.
Remove multiple customers from a (static) customer group. This endpoint unassigns the specified customers from the customer group identified by the given ID. Only static customer groups support this operation.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Updates an address of a customer with the given address information.
If you would like to get a raw Response object use the other updateAddressForCustomerInCustomerList function.
An object containing the options for this method.
A promise of type CustomerAddress.
Updates an address of a customer with the given address information.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CustomerAddress otherwise.
Updates the customer with the specified information. The customer number can be updated, but results in a CustomerNumberAlreadyInUseException if there is another customer with the same customer number.
If you would like to get a raw Response object use the other updateCustomerInCustomerList function.
An object containing the options for this method.
A promise of type Customer.
Updates the customer with the specified information. The customer number can be updated, but results in a CustomerNumberAlreadyInUseException if there is another customer with the same customer number.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Customer otherwise.
Generated using TypeDoc
Customers
*Download API specification
API Overview
Use the Customers API to search for and manage customer information within a customer list. It also enables you to search for customer groups.
Once you find information for a customer, you can also use the API to manage customer addresses.
The
customerNois created when you create a shopper record. You can create a shopper record using the Customers API or Business Manager. For details, see registerCustomer and Create and Manage Customer Records.Authentication & Authorization
For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request.
You must include the relevant scope(s) in the client ID used to generate the token. For a full list of permissions, see the Authorization Scopes Catalog.
For detailed setup instructions, see the Authorization for Admin APIs guide.*
For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html
Example with admin auth
API Version: 1.4.4import { Customers, ClientConfig } from "commerce-sdk"; // or const { Customers, ClientConfig } = require("commerce-sdk"); const clientConfig: ClientConfig = { parameters: { clientId: "XXXXXX", organizationId: "XXXX", shortCode: "XXX", siteId: "XX" } }; token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' }; clientConfig.headers['authorization'] = `Bearer ${token.access_token}`; const customersClient = new Customers(clientConfig);Last Updated: