Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperCustomers<ConfigParameters>

*# API Overview

The Shopper Customers API enables you to develop functionality that lets customers log in, and manage their profiles and product lists. Profile management includes ability for shoppers to add or modify addresses and payment methods, and add or modify products to wishlists or favorites. Commerce Cloud provides a rich set of Authentication APIs that include logging in guest shoppers, registered shoppers, agents on behalf of customers and a trusted system authentication on behalf of customers. In all authentication scenarios involving customers, a JSON Web Token (JWT) is generated in Commerce Cloud. Using the JWT, customers can access other Shopper API resources like Orders and Baskets. The application must refresh the JWT every 30 minutes to save the shopper activity (for example, retain products in a shopper's cart) for prolonged periods of time.

Authentication & Authorization

The client requesting the customer information must have access to the Customer and Product List resources. The API requests pass a system-to-system bearer token in the header of the request. For the trusted system API, the trusted client must first authenticate against Account manager to log in on behalf of a customer.

For details on how to request a shopper access token from SLAS, see the guest user flows for public clients and private clients in the SLAS guides.

You must include the relevant scope(s) in the client ID used to generate the SLAS token. For details, see the Authorization Scopes Catalog.

Use Cases

Register a New Customer

In this use case, a customer who is browsing on a commerce shopping app built using B2C Commerce APIs would like to create a customer profile, so that they can track their order when logged in on the next visit.

The API flow is shown in the following diagram:

b2c-commerce-shopper-customers-screenshot-1.png

  1. The shopper opens the shopping app.
  2. Request an access token from SLAS. For details, see the guest user flows for public clients and private clients in the SLAS guides.
  3. The SLAS API responds with the shopper access token (JWT).
  4. The shopper adds a product to their basket.
  5. Use the Shopper Baskets API to create a basket. The shopper JWT from SLAS is supplied in the authorization header.
  6. Save the basket with a registered user customer ID (even though the shopper is still a guest). The shopper JWT from SLAS is supplied in the authorization header.
  7. The shopper creates a profile.
  8. Use the Shopper Customers API to register the customer.

Authenticate a Trusted System on Behalf of a Customer

In this cross-cloud use case, a Experience Cloud user places an order on Commerce Cloud from the Experience Cloud using the platform APIs. The Experience Cloud app is a trusted system that has a trusted relationship with Commerce Cloud using the OAuth client credentials grant against the Commerce Cloud Account Manager. The Experience Cloud user logs in with a redirect to Salesforce IDM and after successful login, the client application is able to call B2C Commerce APIs on behalf of the customer. Commerce Cloud returns a JWT for the Experience Cloud user and the Experience Cloud user is able to place orders on Commerce Cloud.

The API flow is shown in the following diagram:

b2c-commerce-shopper-customers-screenshot-2.png

Reset Customer Password

In this use case, a shopper who is browsing on a commerce shopping app, built using B2C Commerce APIs, requests to reset their password. The app verifies the shopper's credentials and returns a 404 if verification fails. Otherwise, when the shopper requests their password to be reset, the app first creates a password reset token using the shopper’s login ID, and an account manager token (obtained using the client credentials grant). After the app has the password reset token, the app can prompt the shopper for new password. Any app-level customization, such as sending a password reset email, can be done at this step. Finally, the app calls the reset endpoint to reset the customer’s password.

b2c-commerce-shopper-customers-screenshot-3.png

Update Shopper LoginId

In this use case, in order to update a shopper's loginId, the PATCH /customers/{customerId} call can be used starting B2C Commerce Cloud GA release 24.7. The new field in the request called currentPassword is mandatory and needs to match the shopper's existing password. If this field is not provided or does not match the existing shopper password when trying to update loginId, a HTTP 400 rsponse will be returned. If the loginId field is not sent in the PATCH request body, the currentPassword field is not required. *Note: After the loginId is updated, a new SLAS token must be fetched for the shopper for subsequent calls.

Use Hooks

For details working with hooks, see Extensibility with Hooks.*

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.33
Last Updated:

Type parameters

Hierarchy

  • ShopperCustomers

Index

Constructors

constructor

Properties

clientConfig

clientConfig: ClientConfig<ConfigParameters> & { baseUri: string }

Static Readonly defaultBaseUri

defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/v1" = currentBaseUri

Static Readonly paramKeys

paramKeys: { createCustomerAddress: ["customerId", "organizationId", "siteId"]; createCustomerAddressRequired: ["customerId", "organizationId", "siteId"]; createCustomerPaymentInstrument: ["customerId", "organizationId", "siteId"]; createCustomerPaymentInstrumentRequired: ["customerId", "organizationId", "siteId"]; createCustomerProductList: ["customerId", "organizationId", "siteId"]; createCustomerProductListItem: ["listId", "customerId", "organizationId", "siteId"]; createCustomerProductListItemRequired: ["listId", "customerId", "organizationId", "siteId"]; createCustomerProductListRequired: ["customerId", "organizationId", "siteId"]; deleteCustomerPaymentInstrument: ["paymentInstrumentId", "customerId", "organizationId", "siteId"]; deleteCustomerPaymentInstrumentRequired: ["paymentInstrumentId", "customerId", "organizationId", "siteId"]; deleteCustomerProductList: ["listId", "customerId", "organizationId", "siteId"]; deleteCustomerProductListItem: ["itemId", "listId", "customerId", "organizationId", "siteId"]; deleteCustomerProductListItemRequired: ["itemId", "listId", "customerId", "organizationId", "siteId"]; deleteCustomerProductListRequired: ["listId", "customerId", "organizationId", "siteId"]; getCustomer: ["customerId", "organizationId", "siteId"]; getCustomerAddress: ["addressName", "customerId", "organizationId", "siteId"]; getCustomerAddressRequired: ["addressName", "customerId", "organizationId", "siteId"]; getCustomerBaskets: ["customerId", "organizationId", "siteId"]; getCustomerBasketsRequired: ["customerId", "organizationId", "siteId"]; getCustomerOrders: ["customerId", "organizationId", "siteId", "crossSites", "from", "until", "status", "limit", "offset"]; getCustomerOrdersRequired: ["customerId", "organizationId", "siteId"]; getCustomerPaymentInstrument: ["paymentInstrumentId", "customerId", "organizationId", "siteId"]; getCustomerPaymentInstrumentRequired: ["paymentInstrumentId", "customerId", "organizationId", "siteId"]; getCustomerProductList: ["listId", "customerId", "organizationId", "siteId"]; getCustomerProductListItem: ["itemId", "listId", "customerId", "organizationId", "siteId"]; getCustomerProductListItemRequired: ["itemId", "listId", "customerId", "organizationId", "siteId"]; getCustomerProductListRequired: ["listId", "customerId", "organizationId", "siteId"]; getCustomerProductLists: ["customerId", "organizationId", "siteId"]; getCustomerProductListsRequired: ["customerId", "organizationId", "siteId"]; getCustomerRequired: ["customerId", "organizationId", "siteId"]; getExternalProfile: ["organizationId", "externalId", "authenticationProviderId", "siteId"]; getExternalProfileRequired: ["organizationId", "externalId", "authenticationProviderId", "siteId"]; getProductListItem: ["itemId", "listId", "organizationId", "siteId"]; getProductListItemRequired: ["itemId", "listId", "organizationId", "siteId"]; getPublicProductList: ["listId", "organizationId", "siteId"]; getPublicProductListRequired: ["listId", "organizationId", "siteId"]; getPublicProductListsBySearchTerm: ["organizationId", "siteId", "email", "firstName", "lastName"]; getPublicProductListsBySearchTermRequired: ["organizationId", "siteId"]; getResetPasswordToken: ["organizationId", "siteId"]; getResetPasswordTokenRequired: ["organizationId", "siteId"]; registerCustomer: ["organizationId", "siteId"]; registerCustomerRequired: ["organizationId", "siteId"]; registerExternalProfile: ["organizationId", "siteId"]; registerExternalProfileRequired: ["organizationId", "siteId"]; removeCustomerAddress: ["addressName", "customerId", "organizationId", "siteId"]; removeCustomerAddressRequired: ["addressName", "customerId", "organizationId", "siteId"]; resetPassword: ["organizationId", "siteId"]; resetPasswordRequired: ["organizationId", "siteId"]; updateCustomer: ["customerId", "organizationId", "siteId"]; updateCustomerAddress: ["addressName", "customerId", "organizationId", "siteId"]; updateCustomerAddressRequired: ["addressName", "customerId", "organizationId", "siteId"]; updateCustomerPassword: ["customerId", "organizationId", "siteId"]; updateCustomerPasswordRequired: ["customerId", "organizationId", "siteId"]; updateCustomerProductList: ["listId", "customerId", "organizationId", "siteId"]; updateCustomerProductListItem: ["itemId", "listId", "customerId", "organizationId", "siteId"]; updateCustomerProductListItemRequired: ["itemId", "listId", "customerId", "organizationId", "siteId"]; updateCustomerProductListRequired: ["listId", "customerId", "organizationId", "siteId"]; updateCustomerRequired: ["customerId", "organizationId", "siteId"] } = {createCustomerAddress: ['customerId','organizationId','siteId',],createCustomerAddressRequired: ['customerId','organizationId','siteId',],createCustomerPaymentInstrument: ['customerId','organizationId','siteId',],createCustomerPaymentInstrumentRequired: ['customerId','organizationId','siteId',],createCustomerProductList: ['customerId','organizationId','siteId',],createCustomerProductListRequired: ['customerId','organizationId','siteId',],createCustomerProductListItem: ['listId','customerId','organizationId','siteId',],createCustomerProductListItemRequired: ['listId','customerId','organizationId','siteId',],deleteCustomerPaymentInstrument: ['paymentInstrumentId','customerId','organizationId','siteId',],deleteCustomerPaymentInstrumentRequired: ['paymentInstrumentId','customerId','organizationId','siteId',],deleteCustomerProductList: ['listId','customerId','organizationId','siteId',],deleteCustomerProductListRequired: ['listId','customerId','organizationId','siteId',],deleteCustomerProductListItem: ['itemId','listId','customerId','organizationId','siteId',],deleteCustomerProductListItemRequired: ['itemId','listId','customerId','organizationId','siteId',],getCustomer: ['customerId','organizationId','siteId',],getCustomerRequired: ['customerId','organizationId','siteId',],getCustomerAddress: ['addressName','customerId','organizationId','siteId',],getCustomerAddressRequired: ['addressName','customerId','organizationId','siteId',],getCustomerBaskets: ['customerId','organizationId','siteId',],getCustomerBasketsRequired: ['customerId','organizationId','siteId',],getCustomerOrders: ['customerId','organizationId','siteId','crossSites','from','until','status','limit','offset',],getCustomerOrdersRequired: ['customerId','organizationId','siteId',],getCustomerPaymentInstrument: ['paymentInstrumentId','customerId','organizationId','siteId',],getCustomerPaymentInstrumentRequired: ['paymentInstrumentId','customerId','organizationId','siteId',],getCustomerProductList: ['listId','customerId','organizationId','siteId',],getCustomerProductListRequired: ['listId','customerId','organizationId','siteId',],getCustomerProductListItem: ['itemId','listId','customerId','organizationId','siteId',],getCustomerProductListItemRequired: ['itemId','listId','customerId','organizationId','siteId',],getCustomerProductLists: ['customerId','organizationId','siteId',],getCustomerProductListsRequired: ['customerId','organizationId','siteId',],getExternalProfile: ['organizationId','externalId','authenticationProviderId','siteId',],getExternalProfileRequired: ['organizationId','externalId','authenticationProviderId','siteId',],getProductListItem: ['itemId','listId','organizationId','siteId',],getProductListItemRequired: ['itemId','listId','organizationId','siteId',],getPublicProductList: ['listId','organizationId','siteId',],getPublicProductListRequired: ['listId','organizationId','siteId',],getPublicProductListsBySearchTerm: ['organizationId','siteId','email','firstName','lastName',],getPublicProductListsBySearchTermRequired: ['organizationId','siteId',],getResetPasswordToken: ['organizationId','siteId',],getResetPasswordTokenRequired: ['organizationId','siteId',],registerCustomer: ['organizationId','siteId',],registerCustomerRequired: ['organizationId','siteId',],registerExternalProfile: ['organizationId','siteId',],registerExternalProfileRequired: ['organizationId','siteId',],removeCustomerAddress: ['addressName','customerId','organizationId','siteId',],removeCustomerAddressRequired: ['addressName','customerId','organizationId','siteId',],resetPassword: ['organizationId','siteId',],resetPasswordRequired: ['organizationId','siteId',],updateCustomer: ['customerId','organizationId','siteId',],updateCustomerRequired: ['customerId','organizationId','siteId',],updateCustomerAddress: ['addressName','customerId','organizationId','siteId',],updateCustomerAddressRequired: ['addressName','customerId','organizationId','siteId',],updateCustomerPassword: ['customerId','organizationId','siteId',],updateCustomerPasswordRequired: ['customerId','organizationId','siteId',],updateCustomerProductList: ['listId','customerId','organizationId','siteId',],updateCustomerProductListRequired: ['listId','customerId','organizationId','siteId',],updateCustomerProductListItem: ['itemId','listId','customerId','organizationId','siteId',],updateCustomerProductListItemRequired: ['itemId','listId','customerId','organizationId','siteId',],} as const

Type declaration

  • createCustomerAddress: ["customerId", "organizationId", "siteId"]
  • createCustomerAddressRequired: ["customerId", "organizationId", "siteId"]
  • createCustomerPaymentInstrument: ["customerId", "organizationId", "siteId"]
  • createCustomerPaymentInstrumentRequired: ["customerId", "organizationId", "siteId"]
  • createCustomerProductList: ["customerId", "organizationId", "siteId"]
  • createCustomerProductListItem: ["listId", "customerId", "organizationId", "siteId"]
  • createCustomerProductListItemRequired: ["listId", "customerId", "organizationId", "siteId"]
  • createCustomerProductListRequired: ["customerId", "organizationId", "siteId"]
  • deleteCustomerPaymentInstrument: ["paymentInstrumentId", "customerId", "organizationId", "siteId"]
  • deleteCustomerPaymentInstrumentRequired: ["paymentInstrumentId", "customerId", "organizationId", "siteId"]
  • deleteCustomerProductList: ["listId", "customerId", "organizationId", "siteId"]
  • deleteCustomerProductListItem: ["itemId", "listId", "customerId", "organizationId", "siteId"]
  • deleteCustomerProductListItemRequired: ["itemId", "listId", "customerId", "organizationId", "siteId"]
  • deleteCustomerProductListRequired: ["listId", "customerId", "organizationId", "siteId"]
  • getCustomer: ["customerId", "organizationId", "siteId"]
  • getCustomerAddress: ["addressName", "customerId", "organizationId", "siteId"]
  • getCustomerAddressRequired: ["addressName", "customerId", "organizationId", "siteId"]
  • getCustomerBaskets: ["customerId", "organizationId", "siteId"]
  • getCustomerBasketsRequired: ["customerId", "organizationId", "siteId"]
  • getCustomerOrders: ["customerId", "organizationId", "siteId", "crossSites", "from", "until", "status", "limit", "offset"]
  • getCustomerOrdersRequired: ["customerId", "organizationId", "siteId"]
  • getCustomerPaymentInstrument: ["paymentInstrumentId", "customerId", "organizationId", "siteId"]
  • getCustomerPaymentInstrumentRequired: ["paymentInstrumentId", "customerId", "organizationId", "siteId"]
  • getCustomerProductList: ["listId", "customerId", "organizationId", "siteId"]
  • getCustomerProductListItem: ["itemId", "listId", "customerId", "organizationId", "siteId"]
  • getCustomerProductListItemRequired: ["itemId", "listId", "customerId", "organizationId", "siteId"]
  • getCustomerProductListRequired: ["listId", "customerId", "organizationId", "siteId"]
  • getCustomerProductLists: ["customerId", "organizationId", "siteId"]
  • getCustomerProductListsRequired: ["customerId", "organizationId", "siteId"]
  • getCustomerRequired: ["customerId", "organizationId", "siteId"]
  • getExternalProfile: ["organizationId", "externalId", "authenticationProviderId", "siteId"]
  • getExternalProfileRequired: ["organizationId", "externalId", "authenticationProviderId", "siteId"]
  • getProductListItem: ["itemId", "listId", "organizationId", "siteId"]
  • getProductListItemRequired: ["itemId", "listId", "organizationId", "siteId"]
  • getPublicProductList: ["listId", "organizationId", "siteId"]
  • getPublicProductListRequired: ["listId", "organizationId", "siteId"]
  • getPublicProductListsBySearchTerm: ["organizationId", "siteId", "email", "firstName", "lastName"]
  • getPublicProductListsBySearchTermRequired: ["organizationId", "siteId"]
  • getResetPasswordToken: ["organizationId", "siteId"]
  • getResetPasswordTokenRequired: ["organizationId", "siteId"]
  • registerCustomer: ["organizationId", "siteId"]
  • registerCustomerRequired: ["organizationId", "siteId"]
  • registerExternalProfile: ["organizationId", "siteId"]
  • registerExternalProfileRequired: ["organizationId", "siteId"]
  • removeCustomerAddress: ["addressName", "customerId", "organizationId", "siteId"]
  • removeCustomerAddressRequired: ["addressName", "customerId", "organizationId", "siteId"]
  • resetPassword: ["organizationId", "siteId"]
  • resetPasswordRequired: ["organizationId", "siteId"]
  • updateCustomer: ["customerId", "organizationId", "siteId"]
  • updateCustomerAddress: ["addressName", "customerId", "organizationId", "siteId"]
  • updateCustomerAddressRequired: ["addressName", "customerId", "organizationId", "siteId"]
  • updateCustomerPassword: ["customerId", "organizationId", "siteId"]
  • updateCustomerPasswordRequired: ["customerId", "organizationId", "siteId"]
  • updateCustomerProductList: ["listId", "customerId", "organizationId", "siteId"]
  • updateCustomerProductListItem: ["itemId", "listId", "customerId", "organizationId", "siteId"]
  • updateCustomerProductListItemRequired: ["itemId", "listId", "customerId", "organizationId", "siteId"]
  • updateCustomerProductListRequired: ["listId", "customerId", "organizationId", "siteId"]
  • updateCustomerRequired: ["customerId", "organizationId", "siteId"]

Methods

createCustomerAddress

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

    Parameters

    Returns Promise<CustomerAddress>

    A promise of type CustomerAddress.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : CustomerAddress>

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

createCustomerPaymentInstrument

createCustomerProductList

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

    Parameters

    Returns Promise<CustomerProductList>

    A promise of type CustomerProductList.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : CustomerProductList>

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

createCustomerProductListItem

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

    Considered values from the request body are:

    • type → The item type to be added to the customer's product. This value is required and must be a valid type. 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. Required when item type is product, and must be a valid product ID and only used for product item type. Otherwise, a ProductListProductIdMissingException or ProductListProductNotFoundException is thrown.
    • quantity → Only used for product item type. 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

    Returns Promise<CustomerProductListItem>

    A promise of type CustomerProductListItem.

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

    Considered values from the request body are:

    • type → The item type to be added to the customer's product. This value is required and must be a valid type. 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. Required when item type is product, and must be a valid product ID and only used for product item type. Otherwise, a ProductListProductIdMissingException or ProductListProductNotFoundException is thrown.
    • quantity → Only used for product item type. 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: boolean

    Parameters

    Returns Promise<T extends true ? Response : CustomerProductListItem>

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

deleteCustomerPaymentInstrument

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

    Parameters

    Returns Promise<void>

    A promise of type void.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ customerId: string; organizationId: string; paymentInstrumentId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

deleteCustomerProductList

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

    Returns Promise<void>

    A promise of type void.

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

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ customerId: string; listId: string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

deleteCustomerProductListItem

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

    Parameters

    Returns Promise<void>

    A promise of type void.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ customerId: string; itemId: string; listId: string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

getCustomer

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

    Parameters

    Returns Promise<Customer>

    A promise of type Customer.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : Customer>

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

getCustomerAddress

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

    Parameters

    Returns Promise<CustomerAddress>

    A promise of type CustomerAddress.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ addressName: string; customerId: string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

getCustomerBaskets

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

    Parameters

    Returns Promise<BasketsResult>

    A promise of type BasketsResult.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : BasketsResult>

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

getCustomerOrders

  • getCustomerOrders(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ crossSites?: undefined | false | true; customerId: string; from?: undefined | string; limit?: undefined | number; offset?: undefined | number; organizationId: string; siteId: string; status?: undefined | string; until?: undefined | string } & QueryParameters, ConfigParameters> }>): Promise<CustomerOrderResult>
  • getCustomerOrders<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ crossSites?: undefined | false | true; customerId: string; from?: undefined | string; limit?: undefined | number; offset?: undefined | number; organizationId: string; siteId: string; status?: undefined | string; until?: undefined | string } & QueryParameters, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : CustomerOrderResult>
  • If you would like to get a raw Response object use the other getCustomerOrders function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ crossSites?: undefined | false | true; customerId: string; from?: undefined | string; limit?: undefined | number; offset?: undefined | number; organizationId: string; siteId: string; status?: undefined | string; until?: undefined | string } & QueryParameters, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<CustomerOrderResult>

    A promise of type CustomerOrderResult.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ crossSites?: undefined | false | true; customerId: string; from?: undefined | string; limit?: undefined | number; offset?: undefined | number; organizationId: string; siteId: string; status?: undefined | string; until?: undefined | string } & QueryParameters, ConfigParameters> }>

      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.

getCustomerPaymentInstrument

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

    Parameters

    Returns Promise<CustomerPaymentInstrument>

    A promise of type CustomerPaymentInstrument.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ customerId: string; organizationId: string; paymentInstrumentId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

getCustomerProductList

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

    Parameters

    Returns Promise<CustomerProductList>

    A promise of type CustomerProductList.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ customerId: string; listId: string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

getCustomerProductListItem

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

    Parameters

    Returns Promise<CustomerProductListItem>

    A promise of type CustomerProductListItem.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ customerId: string; itemId: string; listId: string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

getCustomerProductLists

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

    Parameters

    Returns Promise<CustomerProductListResult>

    A promise of type CustomerProductListResult.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : CustomerProductListResult>

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

getExternalProfile

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

    Parameters

    Returns Promise<CustomerExternalProfile>

    A promise of type CustomerExternalProfile.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ authenticationProviderId: string; externalId: string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

getProductListItem

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

    Parameters

    Returns Promise<PublicProductListItem>

    A promise of type PublicProductListItem.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ itemId: string; listId: string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

getPublicProductList

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

    Parameters

    Returns Promise<PublicProductList>

    A promise of type PublicProductList.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : PublicProductList>

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

getPublicProductListsBySearchTerm

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

    Parameters

    Returns Promise<PublicProductListResult>

    A promise of type PublicProductListResult.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ email?: undefined | string; firstName?: undefined | string; lastName?: undefined | string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

getResetPasswordToken

  • This is the first step in the reset customer password flow, in which 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

    Returns Promise<ResetPasswordToken>

    A promise of type ResetPasswordToken.

  • This is the first step in the reset customer password flow, in which 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: boolean

    Parameters

    Returns Promise<T extends true ? Response : ResetPasswordToken>

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

registerCustomer

  • Mandatory data includes 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.

    Parameters

    Returns Promise<Customer>

    A promise of type Customer.

  • Mandatory data includes 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.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : Customer>

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

registerExternalProfile

removeCustomerAddress

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

    Parameters

    Returns Promise<void>

    A promise of type void.

  • Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ addressName: string; customerId: string; organizationId: string; siteId: string } & QueryParameters, ConfigParameters> }>

      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.

resetPassword

  • This is the second step in the reset customer password flow, in which a customer password is reset by providing 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

    Returns Promise<void>

    A promise of type void.

  • This is the second step in the reset customer password flow, in which a customer password is reset by providing new credentials along with a reset token. This call should be preceded by a call to the /create-reset-token endpoint.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : void>

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

updateCustomer

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

    Parameters

    Returns Promise<Customer>

    A promise of type Customer.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : Customer>

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

updateCustomerAddress

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

    Parameters

    Returns Promise<CustomerAddress>

    A promise of type CustomerAddress.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : CustomerAddress>

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

updateCustomerPassword

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

    Parameters

    Returns Promise<void>

    A promise of type void.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : void>

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

updateCustomerProductList

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

    Parameters

    Returns Promise<CustomerProductList>

    A promise of type CustomerProductList.

  • Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : CustomerProductList>

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

updateCustomerProductListItem

  • This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken. Considered values from the request body are:

    priority: The priority of the customer's product list item. public: The flag that indicates if the customer's product list item is public. quantity: The quantity of the customer's product list item. Onlyl used for product item type. custom properties in the form c_: The custom property must correspond to a custom attribute () 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

    Returns Promise<CustomerProductListItem>

    A promise of type CustomerProductListItem.

  • This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken. Considered values from the request body are:

    priority: The priority of the customer's product list item. public: The flag that indicates if the customer's product list item is public. quantity: The quantity of the customer's product list item. Onlyl used for product item type. custom properties in the form c_: The custom property must correspond to a custom attribute () defined for ProductListItem. The value of this property must be valid for the type of custom attribute defined for ProductListItem.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : CustomerProductListItem>

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

Object literals

Static Readonly apiPaths

apiPaths: object

createCustomerAddress

createCustomerAddress: string = "/organizations/{organizationId}/customers/{customerId}/addresses"

createCustomerPaymentInstrument

createCustomerPaymentInstrument: string = "/organizations/{organizationId}/customers/{customerId}/payment-instruments"

createCustomerProductList

createCustomerProductList: string = "/organizations/{organizationId}/customers/{customerId}/product-lists"

createCustomerProductListItem

createCustomerProductListItem: string = "/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items"

deleteCustomerPaymentInstrument

deleteCustomerPaymentInstrument: string = "/organizations/{organizationId}/customers/{customerId}/payment-instruments/{paymentInstrumentId}"

deleteCustomerProductList

deleteCustomerProductList: string = "/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}"

deleteCustomerProductListItem

deleteCustomerProductListItem: string = "/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}"

getCustomer

getCustomer: string = "/organizations/{organizationId}/customers/{customerId}"

getCustomerAddress

getCustomerAddress: string = "/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}"

getCustomerBaskets

getCustomerBaskets: string = "/organizations/{organizationId}/customers/{customerId}/baskets"

getCustomerOrders

getCustomerOrders: string = "/organizations/{organizationId}/customers/{customerId}/orders"

getCustomerPaymentInstrument

getCustomerPaymentInstrument: string = "/organizations/{organizationId}/customers/{customerId}/payment-instruments/{paymentInstrumentId}"

getCustomerProductList

getCustomerProductList: string = "/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}"

getCustomerProductListItem

getCustomerProductListItem: string = "/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}"

getCustomerProductLists

getCustomerProductLists: string = "/organizations/{organizationId}/customers/{customerId}/product-lists"

getExternalProfile

getExternalProfile: string = "/organizations/{organizationId}/customers/external-profile"

getProductListItem

getProductListItem: string = "/organizations/{organizationId}/product-lists/{listId}/items/{itemId}"

getPublicProductList

getPublicProductList: string = "/organizations/{organizationId}/product-lists/{listId}"

getPublicProductListsBySearchTerm

getPublicProductListsBySearchTerm: string = "/organizations/{organizationId}/product-lists"

getResetPasswordToken

getResetPasswordToken: string = "/organizations/{organizationId}/customers/password/actions/create-reset-token"

registerCustomer

registerCustomer: string = "/organizations/{organizationId}/customers"

registerExternalProfile

registerExternalProfile: string = "/organizations/{organizationId}/customers/external-profile"

removeCustomerAddress

removeCustomerAddress: string = "/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}"

resetPassword

resetPassword: string = "/organizations/{organizationId}/customers/password/actions/reset"

updateCustomer

updateCustomer: string = "/organizations/{organizationId}/customers/{customerId}"

updateCustomerAddress

updateCustomerAddress: string = "/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}"

updateCustomerPassword

updateCustomerPassword: string = "/organizations/{organizationId}/customers/{customerId}/password"

updateCustomerProductList

updateCustomerProductList: string = "/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}"

updateCustomerProductListItem

updateCustomerProductListItem: string = "/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}"

Generated using TypeDoc