Class ShopperCustomers<ConfigParameters>

Shopper Customers

Allow customers to manage their own profiles and product lists.

Simple example:

  import { ShopperCustomers } from "commerce-sdk-isomorphic";

const clientConfig = {
parameters: {
clientId: "XXXXXX",
organizationId: "XXXX",
shortCode: "XXX",
siteId: "XX"
}
};
const shopperCustomersClient = new ShopperCustomers(clientConfig);
API Version: 0.0.43
Last Updated:

Type Parameters

Hierarchy

  • ShopperCustomers

Constructors

Methods

  • 🚨 DEPRECATION NOTICE

    To enhance the security and availability of Salesforce services, this endpoint is now deprecated, and we plan to remove it in mid-2022. This endpoint is not available to new customers, and we discourage existing customers from using it. Instead, we strongly recommend using the endpoints of the Shopper Login and API Access Service (SLAS) because they meet our rigorous standards for security and availability.


    Obtains a new JSON Web Token (JWT) for a guest or registered customer. Tokens are returned as an HTTP Authorization: Bearer response header entry. The following kinds of request are supported, as specified by the type:

    • \{\"type\": \"guest\"\} → Creates a guest (non-authenticated) customer and returns a token for the customer.
    • \{\"type\": \"credentials\"\} → Authenticates credentials passed in the HTTP Authorization: Basic request header and returns a token for a successfully authenticated customer (otherwise, it throws an AuthenticationFailedException). This type of request also updates profile attributes for the customer (for example, last-visited) and handles the maximum number of failed login attempts.
    • \{\"type\": \"refresh\"\} → Examines the token passed in the HTTP Authorization: Bearer request header. If valid, a new token is returned with an updated expiry time.

    The JWT contains 3 sections:

    1. Header: Specifies token type and algorithm used.
    2. Payload: Contains customer information, client ID, issue, and expiration time.
    3. Signature: Records the token signature.

    A token is created and returned to the client whenever a registered customer logs in (credentials type) or a guest customer requests it (guest type). The token is returned in the response header as Authorization: Bearer --token--.

    The client has to include the token in the request header as Authorization: Bearer --token-- in any follow-up request. The server declines any follow-up requests without a token. The server declines any requests that cannot be verified based on the token signature or expiration time. A token nearing its expiration time should be exchanged for a new one (refresh type).

    If you would like to get a raw Response object use the other authorizeCustomer function.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: AuthRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "clientId" | "organizationId" | "siteId"]: (Omit<{
                  clientId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  clientId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Customer>

    A promise of type Customer.

  • 🚨 DEPRECATION NOTICE

    To enhance the security and availability of Salesforce services, this endpoint is now deprecated, and we plan to remove it in mid-2022. This endpoint is not available to new customers, and we discourage existing customers from using it. Instead, we strongly recommend using the endpoints of the Shopper Login and API Access Service (SLAS) because they meet our rigorous standards for security and availability.


    Obtains a new JSON Web Token (JWT) for a guest or registered customer. Tokens are returned as an HTTP Authorization: Bearer response header entry. The following kinds of request are supported, as specified by the type:

    • \{\"type\": \"guest\"\} → Creates a guest (non-authenticated) customer and returns a token for the customer.
    • \{\"type\": \"credentials\"\} → Authenticates credentials passed in the HTTP Authorization: Basic request header and returns a token for a successfully authenticated customer (otherwise, it throws an AuthenticationFailedException). This type of request also updates profile attributes for the customer (for example, last-visited) and handles the maximum number of failed login attempts.
    • \{\"type\": \"refresh\"\} → Examines the token passed in the HTTP Authorization: Bearer request header. If valid, a new token is returned with an updated expiry time.

    The JWT contains 3 sections:

    1. Header: Specifies token type and algorithm used.
    2. Payload: Contains customer information, client ID, issue, and expiration time.
    3. Signature: Records the token signature.

    A token is created and returned to the client whenever a registered customer logs in (credentials type) or a guest customer requests it (guest type). The token is returned in the response header as Authorization: Bearer --token--.

    The client has to include the token in the request header as Authorization: Bearer --token-- in any follow-up request. The server declines any follow-up requests without a token. The server declines any requests that cannot be verified based on the token signature or expiration time. A token nearing its expiration time should be exchanged for a new one (refresh type).

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: AuthRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "clientId" | "organizationId" | "siteId"]: (Omit<{
                  clientId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  clientId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Customer>

    A promise of type Response if rawResponse is true, a promise of type Customer otherwise.

  • 🚨 DEPRECATION NOTICE

    To enhance the security and availability of Salesforce services, this endpoint is now deprecated, and we plan to remove it in mid-2022. This endpoint is not available to new customers, and we discourage existing customers from using it. Instead, we strongly recommend using the endpoints of the Shopper Login and API Access Service (SLAS) because they meet our rigorous standards for security and availability.


    Obtain the JSON Web Token (JWT) for registered customers whose credentials are stored using a third party system. Accepts loginId and clientId, returns a customer object in the response body and the JWT generated against the clientId in the response header.

    If you would like to get a raw Response object use the other authorizeTrustedSystem function.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: TrustedSystemAuthRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Customer>

    A promise of type Customer.

  • 🚨 DEPRECATION NOTICE

    To enhance the security and availability of Salesforce services, this endpoint is now deprecated, and we plan to remove it in mid-2022. This endpoint is not available to new customers, and we discourage existing customers from using it. Instead, we strongly recommend using the endpoints of the Shopper Login and API Access Service (SLAS) because they meet our rigorous standards for security and availability.


    Obtain the JSON Web Token (JWT) for registered customers whose credentials are stored using a third party system. Accepts loginId and clientId, returns a customer object in the response body and the JWT generated against the clientId in the response header.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: TrustedSystemAuthRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Customer>

    A promise of type Response if rawResponse is true, a promise of type Customer otherwise.

  • 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerAddress;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerAddress>

    A promise of type CustomerAddress.

  • Creates a new address with the given name for the given customer. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerAddress;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerAddress>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerPaymentInstrumentRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerPaymentInstrument>

    A promise of type CustomerPaymentInstrument.

  • Adds a payment instrument to the customer information. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerPaymentInstrumentRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerPaymentInstrument>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerProductList;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerProductList>

    A promise of type CustomerProductList.

  • Creates a customer product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerProductList;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerProductList>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerProductListItem;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "listId"]: (Omit<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerProductListItem>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerProductListItem;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "listId"]: (Omit<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerProductListItem>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "paymentInstrumentId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<void>

    A promise of type void.

  • Deletes a customer's payment instrument. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "paymentInstrumentId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : void>

    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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "listId"]: (Omit<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<void>

    A promise of type void.

  • Deletes a customer product list. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "listId"]: (Omit<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : void>

    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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "itemId" | "listId"]: (Omit<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<void>

    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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "itemId" | "listId"]: (Omit<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : void>

    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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Customer>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Customer>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "addressName"]: (Omit<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerAddress>

    A promise of type CustomerAddress.

  • Retrieves a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "addressName"]: (Omit<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerAddress>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<BasketsResult$0>

    A promise of type BasketsResult.

  • Gets the baskets of a customer. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : BasketsResult$0>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "crossSites" | "from" | "until" | "status" | "offset" | "limit"]: (Omit<{
                  crossSites?: boolean;
                  customerId: string;
                  from?: string;
                  limit?: number;
                  offset?: any;
                  organizationId: string;
                  siteId: string;
                  status?: string;
                  until?: string;
              }, keyof ConfigParameters> & Partial<{
                  crossSites?: boolean;
                  customerId: string;
                  from?: string;
                  limit?: number;
                  offset?: any;
                  organizationId: string;
                  siteId: string;
                  status?: string;
                  until?: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerOrderResult>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "crossSites" | "from" | "until" | "status" | "offset" | "limit"]: (Omit<{
                  crossSites?: boolean;
                  customerId: string;
                  from?: string;
                  limit?: number;
                  offset?: any;
                  organizationId: string;
                  siteId: string;
                  status?: string;
                  until?: string;
              }, keyof ConfigParameters> & Partial<{
                  crossSites?: boolean;
                  customerId: string;
                  from?: string;
                  limit?: number;
                  offset?: any;
                  organizationId: string;
                  siteId: string;
                  status?: string;
                  until?: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerOrderResult>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "paymentInstrumentId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerPaymentInstrument>

    A promise of type CustomerPaymentInstrument.

  • Retrieves a customer's payment instrument by its ID. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "paymentInstrumentId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerPaymentInstrument>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "listId"]: (Omit<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerProductList>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "listId"]: (Omit<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerProductList>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "itemId" | "listId"]: (Omit<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerProductListItem>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "itemId" | "listId"]: (Omit<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerProductListItem>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerProductListResult>

    A promise of type CustomerProductListResult.

  • Returns all customer product lists. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerProductListResult>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "externalId" | "authenticationProviderId"]: (Omit<{
                  authenticationProviderId: string;
                  externalId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  authenticationProviderId: string;
                  externalId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerExternalProfile>

    A promise of type CustomerExternalProfile.

  • Gets the new external profile for a customer. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "externalId" | "authenticationProviderId"]: (Omit<{
                  authenticationProviderId: string;
                  externalId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  authenticationProviderId: string;
                  externalId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerExternalProfile>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "itemId" | "listId"]: (Omit<{
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<PublicProductListItem>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "itemId" | "listId"]: (Omit<{
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : PublicProductListItem>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "listId"]: (Omit<{
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<PublicProductList>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "listId"]: (Omit<{
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : PublicProductList>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "email" | "firstName" | "lastName"]: (Omit<{
                  email?: string;
                  firstName?: string;
                  lastName?: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  email?: string;
                  firstName?: string;
                  lastName?: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<PublicProductListResult>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "email" | "firstName" | "lastName"]: (Omit<{
                  email?: string;
                  firstName?: string;
                  lastName?: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  email?: string;
                  firstName?: string;
                  lastName?: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : PublicProductListResult>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: ResetPasswordTokenRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<ResetPasswordToken>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: ResetPasswordTokenRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : ResetPasswordToken>

    A promise of type Response if rawResponse is true, a promise of type ResetPasswordToken otherwise.

  • 🚨 DEPRECATION NOTICE

    To enhance the security and availability of Salesforce services, this endpoint is now deprecated, and we plan to remove it in mid-2022. This endpoint is not available to new customers, and we discourage existing customers from using it. Instead, we strongly recommend using the endpoints of the Shopper Login and API Access Service (SLAS) because they meet our rigorous standards for security and availability.


    Log the user out.

    If you would like to get a raw Response object use the other invalidateCustomerAuth function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<void>

    A promise of type void.

  • 🚨 DEPRECATION NOTICE

    To enhance the security and availability of Salesforce services, this endpoint is now deprecated, and we plan to remove it in mid-2022. This endpoint is not available to new customers, and we discourage existing customers from using it. Instead, we strongly recommend using the endpoints of the Shopper Login and API Access Service (SLAS) because they meet our rigorous standards for security and availability.


    Log the user out.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : void>

    A promise of type Response if rawResponse is true, a promise of type void 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.

    If you would like to get a raw Response object use the other registerCustomer function.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerRegistration;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Customer>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerRegistration;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Customer>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerExtProfileRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerExternalProfile>

    A promise of type CustomerExternalProfile.

  • Registers a new external profile for a customer. This endpoint accepts a guest customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerExtProfileRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerExternalProfile>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "addressName"]: (Omit<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<void>

    A promise of type void.

  • Deletes a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "addressName"]: (Omit<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : void>

    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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: ResetPasswordRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<void>

    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.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: ResetPasswordRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId"]: (Omit<{
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : void>

    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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: Customer;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Customer>

    A promise of type Customer.

  • Updates a customer. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: Customer;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Customer>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerAddress;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "addressName"]: (Omit<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerAddress>

    A promise of type CustomerAddress.

  • Updates a customer's address by address name. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerAddress;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "addressName"]: (Omit<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  addressName: string;
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerAddress>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: PasswordChangeRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<void>

    A promise of type void.

  • Updates the customer's password. This endpoint accepts a registered customer ShopperToken (JWT) only.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: PasswordChangeRequest;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId"]: (Omit<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : void>

    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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerProductList;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "listId"]: (Omit<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerProductList>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerProductList;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "listId"]: (Omit<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerProductList>

    A promise of type Response if rawResponse is true, a promise of type 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerProductListItem;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "itemId" | "listId"]: (Omit<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<CustomerProductListItem>

    A promise of type 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.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: CustomerProductListItem;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "customerId" | "itemId" | "listId"]: (Omit<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  customerId: string;
                  itemId: string;
                  listId: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : CustomerProductListItem>

    A promise of type Response if rawResponse is true, a promise of type CustomerProductListItem otherwise.

Properties

clientConfig: ClientConfig<ConfigParameters> & {
    baseUri: string;
}
defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/{version}" = "https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/{version}"