Retrieve all subscription preferences for the shopper (authenticated or guest).
Use the 'expand' parameter to include additional fields in the response:
The expand parameter provides privacy benefits by not exposing sensitive status information unless explicitly requested.
If you would like to get a raw Response object use the other getSubscriptions function.
An object containing the options for this method.
A promise of type ConsentSubscriptionResponse.
Retrieve all subscription preferences for the shopper (authenticated or guest).
Use the 'expand' parameter to include additional fields in the response:
The expand parameter provides privacy benefits by not exposing sensitive status information unless explicitly requested.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionResponse otherwise.
Update the consent status for a single subscription.
If you would like to get a raw Response object use the other updateSubscription function.
An object containing the options for this method.
A promise of type ConsentSubscriptionUpdateResponse.
Update the consent status for a single subscription.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionUpdateResponse otherwise.
Update the consent status for multiple subscriptions in a single bulk request. Supports 1-50 subscription updates per request with partial success handling.
If you would like to get a raw Response object use the other updateSubscriptions function.
An object containing the options for this method.
A promise of type ConsentSubscriptionBulkResponse.
Update the consent status for multiple subscriptions in a single bulk request. Supports 1-50 subscription updates per request with partial success handling.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionBulkResponse otherwise.
Generated using TypeDoc
Shopper Consents
*Download API specification
API Overview
The Shopper Consent API offers a centralized method for managing shopper consent. With this API, shoppers can view and update subscription preferences for marketing communications across various channels. This API controls how and where shoppers receive marketing messages while ensuring compliance with privacy regulations.
The Shopper Consent API provides sensible defaults for optional fields to simplify integration:
Authentication & Authorization
The Shopper Consent API requires a shopper access token from the Shopper Login and API Access Service (SLAS).
You must include the relevant scope(s) in the client ID used to generate the SLAS token.
sfcc.shopper-consents: Required for reading communication subscription data (GET operations).sfcc.shopper-consents.rw: Required for creating and modifying communication subscription consent data (POST operations).For a full list of required permissions, see the Authorization Scopes Catalog.
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.
Data Model
Subscriptions
Subscriptions represent a shopper's consent to receive specific types of marketing communications. Each subscription includes:
Channels
Channels define the communication methods available for a subscription:
email: Email communicationssms: SMS/text messageswhatsapp: WhatsApp messagingTags
Tags indicate where subscription options are displayed in your shopper experience. Tags are also accepted as optional filtering parameters in the retrieval of shopper consent subscriptions. For example:
homepage_banner: Main website homepageregistration: Shopper registration formcheckout: Checkout flowuser_profile: User profile management sectionUse Cases
Retrieve communication subscriptions
Retrieve relevant communication subscription options with rich display information.
expandparameter to conditionally include subscription status.Update individual subscription consent
Update consent status for a single subscription with simple request/response pattern.
Bulk subscription updates
Efficiently manage multiple subscription preferences with a single request.
Advanced Features
Expand Parameter
The
expandparameter provides conditional field inclusion:expand=[](default): Returns basic subscription informationexpand=["consentStatus"]: Include consent status information in the responseBest Practices
Simple example:
API Version: 0.0.33import { ShopperConsents } from "commerce-sdk-isomorphic"; const clientConfig = { parameters: { clientId: "XXXXXX", organizationId: "XXXX", shortCode: "XXX", siteId: "XX" } }; const shopperConsentsClient = new ShopperConsents(clientConfig);Last Updated: