Creates a new address with the given name for the given customer. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other createCustomerAddress function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerAddress.
Creates a new address with the given name for the given customer. This endpoint accepts a registered customer ShopperToken (JWT) only.
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 ShopperCustomers.CustomerAddress otherwise.
Adds a payment instrument to the customer information. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other createCustomerPaymentInstrument function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerPaymentInstrument.
Adds a payment instrument to the customer information. This endpoint accepts a registered customer ShopperToken (JWT) only.
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 ShopperCustomers.CustomerPaymentInstrument otherwise.
Creates a customer product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other createCustomerProductList function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerProductList.
Creates a customer product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.CustomerProductList otherwise.
Adds an item to the customer's product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
Considered values from the request body are:
type
→ The type of the item to be added to the customer's product. Must be a valid type. Mandatory.
list.priority
→ The priority of the item to be added to the customer's product list.public
→ The flag that determines whether the item to be added to the customer's product list is public.product_id
→ The ID (SKU) of the product related to the item to be added to the customer's product list. A valid product ID, used for product item type only. Must be a valid product ID; otherwise, a ProductListProductIdMissingException
or ProductListProductNotFoundException
is thrown. Mandatory when item type is product
.quantity
→ Used for product item type only. This is the quantity of the item to be added to the customer's product list.You can also use a custom property of the form c_\<CUSTOM_NAME\>
. The custom property must correspond to a custom attribute (\<CUSTOM_NAME\>
) that is defined for ProductListItem
. The value of this property must be valid for the type of custom attribute defined for ProductListItem
.
If you would like to get a raw Response object use the other createCustomerProductListItem function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerProductListItem.
Adds an item to the customer's product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
Considered values from the request body are:
type
→ The type of the item to be added to the customer's product. Must be a valid type. Mandatory.
list.priority
→ The priority of the item to be added to the customer's product list.public
→ The flag that determines whether the item to be added to the customer's product list is public.product_id
→ The ID (SKU) of the product related to the item to be added to the customer's product list. A valid product ID, used for product item type only. Must be a valid product ID; otherwise, a ProductListProductIdMissingException
or ProductListProductNotFoundException
is thrown. Mandatory when item type is product
.quantity
→ Used for product item type only. This is the quantity of the item to be added to the customer's product list.You can also use a custom property of the form c_\<CUSTOM_NAME\>
. The custom property must correspond to a custom attribute (\<CUSTOM_NAME\>
) that is defined for ProductListItem
. The value of this property must be valid for the type of custom attribute defined for ProductListItem
.
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 ShopperCustomers.CustomerProductListItem otherwise.
Deletes a customer's payment instrument. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other deleteCustomerPaymentInstrument function.
An object containing the options for this method.
A promise of type void.
Deletes a customer's payment instrument. This endpoint accepts a registered customer ShopperToken (JWT) only.
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.
Deletes a customer product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other deleteCustomerProductList function.
An object containing the options for this method.
A promise of type void.
Deletes a customer product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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.
Removes an item from a customer product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other deleteCustomerProductListItem function.
An object containing the options for this method.
A promise of type void.
Removes an item from a customer product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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.
Gets a customer with all existing addresses and payment instruments associated with the requested customer. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other getCustomer function.
An object containing the options for this method.
A promise of type ShopperCustomers.Customer.
Gets a customer with all existing addresses and payment instruments associated with the requested customer. This endpoint accepts a registered customer ShopperToken (JWT) only.
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 ShopperCustomers.Customer otherwise.
Retrieves a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other getCustomerAddress function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerAddress.
Retrieves a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.
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 ShopperCustomers.CustomerAddress otherwise.
Gets the baskets of a customer. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other getCustomerBaskets function.
An object containing the options for this method.
A promise of type ShopperCustomers.BasketsResult.
Gets the baskets of a customer. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.BasketsResult otherwise.
Returns a pageable list of all customer's orders. The default page size is 10. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other getCustomerOrders function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerOrderResult.
Returns a pageable list of all customer's orders. The default page size is 10. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.CustomerOrderResult otherwise.
Retrieves a customer's payment instrument by its ID. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other getCustomerPaymentInstrument function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerPaymentInstrument.
Retrieves a customer's payment instrument by its ID. This endpoint accepts a registered customer ShopperToken (JWT) only.
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 ShopperCustomers.CustomerPaymentInstrument otherwise.
Returns a customer product list of the given customer and the items in the list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other getCustomerProductList function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerProductList.
Returns a customer product list of the given customer and the items in the list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.CustomerProductList otherwise.
Returns an item of a customer product list and the actual product details like image, availability and price. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other getCustomerProductListItem function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerProductListItem.
Returns an item of a customer product list and the actual product details like image, availability and price. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.CustomerProductListItem otherwise.
Returns all customer product lists. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other getCustomerProductLists function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerProductListResult.
Returns all customer product lists. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.CustomerProductListResult otherwise.
Gets the new external profile for a customer. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other getExternalProfile function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerExternalProfile.
Gets the new external profile for a customer. This endpoint accepts a registered customer ShopperToken (JWT) only.
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 ShopperCustomers.CustomerExternalProfile otherwise.
Retrieves an item from a public product list and the actual product details like product, image, availability and price. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other getProductListItem function.
An object containing the options for this method.
A promise of type ShopperCustomers.PublicProductListItem.
Retrieves an item from a public product list and the actual product details like product, image, availability and price. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.PublicProductListItem otherwise.
Retrieves a public product list by ID and the items under that product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other getPublicProductList function.
An object containing the options for this method.
A promise of type ShopperCustomers.PublicProductList.
Retrieves a public product list by ID and the items under that product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.PublicProductList otherwise.
Retrieves all public product lists as defined by the given search term (for example, email OR first name and last name). This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other getPublicProductListsBySearchTerm function.
An object containing the options for this method.
A promise of type ShopperCustomers.PublicProductListResult.
Retrieves all public product lists as defined by the given search term (for example, email OR first name and last name). This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.PublicProductListResult otherwise.
Get reset password token. This is the first step in the reset customer password flow, where a password reset token is requested for future use to reset a customer password. This call should be followed by a call to the /reset endpoint.
If you would like to get a raw Response object use the other getResetPasswordToken function.
An object containing the options for this method.
A promise of type ShopperCustomers.ResetPasswordToken.
Get reset password token. This is the first step in the reset customer password flow, where a password reset token is requested for future use to reset a customer password. This call should be followed by a call to the /reset endpoint.
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 ShopperCustomers.ResetPasswordToken otherwise.
Registers a new customer. The mandatory data are the credentials, profile last name, and email. This requires a JSON Web Token (JWT) which needs to be obtained using the POST /customers/auth API with type "guest", or from the Shopper Login (SLAS) API. The return type object for this endpoint is a common customer object shared by multiple Shopper Customer endpoints. In this case, all customer object details are returned, but attributes that are not included in the response, although they might be part of the customer object, are ignored. For example, although address information is included in the customer object, it is not displayed in the response for this endpoint and is ignored.
If you would like to get a raw Response object use the other registerCustomer function.
An object containing the options for this method.
A promise of type ShopperCustomers.Customer.
Registers a new customer. The mandatory data are the credentials, profile last name, and email. This requires a JSON Web Token (JWT) which needs to be obtained using the POST /customers/auth API with type "guest", or from the Shopper Login (SLAS) API. The return type object for this endpoint is a common customer object shared by multiple Shopper Customer endpoints. In this case, all customer object details are returned, but attributes that are not included in the response, although they might be part of the customer object, are ignored. For example, although address information is included in the customer object, it is not displayed in the response for this endpoint and is ignored.
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 ShopperCustomers.Customer otherwise.
Registers a new external profile for a customer. This endpoint accepts a guest customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other registerExternalProfile function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerExternalProfile.
Registers a new external profile for a customer. This endpoint accepts a guest customer ShopperToken (JWT) only.
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 ShopperCustomers.CustomerExternalProfile otherwise.
Deletes a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other removeCustomerAddress function.
An object containing the options for this method.
A promise of type void.
Deletes a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.
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.
Reset customer password, after obtaining a reset token. This is the second step in the reset customer password flow, where a customer password is reset by providing the new credentials along with a reset token. This call should be preceded by a call to the /create-reset-token endpoint.
If you would like to get a raw Response object use the other resetPassword function.
An object containing the options for this method.
A promise of type void.
Reset customer password, after obtaining a reset token. This is the second step in the reset customer password flow, where a customer password is reset by providing the new credentials along with a reset token. This call should be preceded by a call to the /create-reset-token endpoint.
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 a customer. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other updateCustomer function.
An object containing the options for this method.
A promise of type ShopperCustomers.Customer.
Updates a customer. This endpoint accepts a registered customer ShopperToken (JWT) only.
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 ShopperCustomers.Customer otherwise.
Updates a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other updateCustomerAddress function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerAddress.
Updates a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.
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 ShopperCustomers.CustomerAddress otherwise.
Updates the customer's password. This endpoint accepts a registered customer ShopperToken (JWT) only.
If you would like to get a raw Response object use the other updateCustomerPassword function.
An object containing the options for this method.
A promise of type void.
Updates the customer's password. This endpoint accepts a registered customer ShopperToken (JWT) only.
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.
Changes a product list. Changeable properties are the name, description, and if the list is public. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
If you would like to get a raw Response object use the other updateCustomerProductList function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerProductList.
Changes a product list. Changeable properties are the name, description, and if the list is public. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.
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 ShopperCustomers.CustomerProductList otherwise.
Updates an item of a customer's product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken. Considered values from the request body are:
priority: This is the priority of the customer's product list item. public: This is the flag whether the customer's product list item is public. quantity: This is the quantity of the customer's product list item. Used for product item type only. custom properties in the form c_<CUSTOM_NAME>: The custom property must correspond to a custom attribute (<CUSTOM_NAME>) defined for ProductListItem. The value of this property must be valid for the type of custom attribute defined for ProductListItem.
If you would like to get a raw Response object use the other updateCustomerProductListItem function.
An object containing the options for this method.
A promise of type ShopperCustomers.CustomerProductListItem.
Updates an item of a customer's product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken. Considered values from the request body are:
priority: This is the priority of the customer's product list item. public: This is the flag whether the customer's product list item is public. quantity: This is the quantity of the customer's product list item. Used for product item type only. custom properties in the form c_<CUSTOM_NAME>: The custom property must correspond to a custom attribute (<CUSTOM_NAME>) defined for ProductListItem. The value of this property must be valid for the type of custom attribute defined for ProductListItem.
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 ShopperCustomers.CustomerProductListItem otherwise.
Generated using TypeDoc
Shopper Customers
Allow customers to manage their own profiles and product lists.
Example with shopper auth
API Version: 0.0.49import { Customer, ClientConfig, Customer, slasHelpers } from "commerce-sdk"; // or const { Customer, ClientConfig, Customer, slasHelpers } = require("commerce-sdk"); const clientConfig: ClientConfig = { parameters: { clientId: "XXXXXX", organizationId: "XXXX", shortCode: "XXX", siteId: "XX" } }; // must be registered in SLAS. On server, redirectURI is never called const redirectURI = "http://localhost:3000/callback"; const slasClient = new Customer.ShopperLogin(clientConfig); token = await slasHelpers.loginGuestUser(slasClient, { redirectURI }); clientConfig.headers['authorization'] = `Bearer ${token.access_token}`; const shopperCustomersClient = new Customer.ShopperCustomers(clientConfig);
Last Updated: