commerce-sdk-isomorphic 4.0.0-nightly-20251029080754 → 4.0.0-nightly-20251031080733

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/lib/helpers.cjs.js +1 -1
  2. package/lib/helpers.js +1 -1
  3. package/lib/index.cjs.d.ts +800 -166
  4. package/lib/index.cjs.js +1 -1
  5. package/lib/index.esm.d.ts +800 -166
  6. package/lib/index.esm.js +1 -1
  7. package/lib/shopperBaskets.cjs.js +1 -1
  8. package/lib/shopperBaskets.js +1 -1
  9. package/lib/shopperBasketsv2.cjs.js +1 -1
  10. package/lib/shopperBasketsv2.js +1 -1
  11. package/lib/shopperConfigurations.cjs.js +1 -1
  12. package/lib/shopperConfigurations.js +1 -1
  13. package/lib/shopperConsents.cjs.d.ts +799 -165
  14. package/lib/shopperConsents.cjs.js +1 -1
  15. package/lib/shopperConsents.d.ts +799 -165
  16. package/lib/shopperConsents.js +1 -1
  17. package/lib/shopperContext.cjs.js +1 -1
  18. package/lib/shopperContext.js +1 -1
  19. package/lib/shopperCustomers.cjs.js +1 -1
  20. package/lib/shopperCustomers.js +1 -1
  21. package/lib/shopperExperience.cjs.js +1 -1
  22. package/lib/shopperExperience.js +1 -1
  23. package/lib/shopperGiftCertificates.cjs.js +1 -1
  24. package/lib/shopperGiftCertificates.js +1 -1
  25. package/lib/shopperLogin.cjs.js +1 -1
  26. package/lib/shopperLogin.js +1 -1
  27. package/lib/shopperOrders.cjs.js +1 -1
  28. package/lib/shopperOrders.js +1 -1
  29. package/lib/shopperPayments.cjs.js +1 -1
  30. package/lib/shopperPayments.js +1 -1
  31. package/lib/shopperProducts.cjs.js +1 -1
  32. package/lib/shopperProducts.js +1 -1
  33. package/lib/shopperPromotions.cjs.js +1 -1
  34. package/lib/shopperPromotions.js +1 -1
  35. package/lib/shopperSearch.cjs.js +1 -1
  36. package/lib/shopperSearch.js +1 -1
  37. package/lib/shopperSeo.cjs.js +1 -1
  38. package/lib/shopperSeo.js +1 -1
  39. package/lib/shopperStores.cjs.js +1 -1
  40. package/lib/shopperStores.js +1 -1
  41. package/lib/version.cjs.d.ts +1 -1
  42. package/lib/version.cjs.js +1 -1
  43. package/lib/version.d.ts +1 -1
  44. package/lib/version.js +1 -1
  45. package/package.json +2 -2
@@ -21112,14 +21112,33 @@ declare namespace ShopperConfigurationsTypes {
21112
21112
  type ModelConfiguration = ShopperConfigurationsModelTypes.ModelConfiguration;
21113
21113
  type SiteConfiguration = ShopperConfigurationsModelTypes.SiteConfiguration;
21114
21114
  }
21115
+ /**
21116
+ *
21117
+ */
21118
+ type ChannelType = "email" | "sms" | "whatsapp";
21115
21119
  /**
21116
21120
  * The consent status of the subscription as supplied or recorded by this system
21117
21121
  */
21118
21122
  type ConsentStatus = "opt_in" | "opt_out";
21119
21123
  /**
21124
+ * @type SubscriptionStatusEntry: Individual subscription status entry for a specific channel
21125
+ *
21126
+ * @property channel:
21127
+ *
21128
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
21129
+ * - **Min Length:** 3
21130
+ * - **Max Length:** 320
21131
+ *
21132
+ * @property status:
21120
21133
  *
21121
21134
  */
21122
- type SubscriptionChannel = "email" | "sms" | "push_notification" | "in_app" | "postal_mail" | "whatsapp";
21135
+ type SubscriptionStatusEntry = {
21136
+ channel: ChannelType;
21137
+ contactPointValue: string;
21138
+ status: ConsentStatus;
21139
+ } & {
21140
+ [key: string]: any;
21141
+ };
21123
21142
  /**
21124
21143
  * @type ConsentSubscription:
21125
21144
  *
@@ -21128,41 +21147,42 @@ type SubscriptionChannel = "email" | "sms" | "push_notification" | "in_app" | "p
21128
21147
  * - **Min Length:** 1
21129
21148
  * - **Max Length:** 255
21130
21149
  *
21131
- * @property consentId: Identifier for the shopper communication subscription consent -- formatted as `<contactPointValue>#<communicationSubscriptionChannelId>`
21132
- * - **Min Length:** 19
21133
- * - **Max Length:** 339
21134
- *
21135
- * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
21136
- * - **Min Length:** 3
21137
- * - **Max Length:** 320
21138
- *
21139
- * @property channel:
21150
+ * @property channels:
21140
21151
  *
21141
- * @property status:
21152
+ * @property consentStatus: Array of subscription status entries for different channels
21142
21153
  *
21143
- * @property title:
21154
+ * @property title: The localized title of the subscription for shopper displays
21144
21155
  * - **Min Length:** 1
21145
21156
  * - **Max Length:** 255
21146
21157
  *
21147
- * @property subtitle:
21158
+ * @property subtitle: The localized subtitle of the subscription for shopper displays, may contain HTML markup
21148
21159
  * - **Min Length:** 1
21149
- * - **Max Length:** 255
21160
+ * - **Max Length:** 2000
21150
21161
  *
21151
21162
  * @property tags:
21152
21163
  *
21164
+ * @property consentType: Type of consent subscription
21165
+ *
21166
+ * @property consentRequired: Whether this subscription is mandatory for the user
21167
+ *
21168
+ * @property defaultStatus: Default consent status for this subscription
21169
+ *
21153
21170
  */
21154
21171
  type ConsentSubscription = {
21155
21172
  subscriptionId: string;
21156
- consentId?: string;
21157
- contactPointValue?: string;
21158
- channel: SubscriptionChannel;
21159
- status?: ConsentStatus;
21173
+ channels: Set<ChannelType>;
21174
+ consentStatus?: Array<SubscriptionStatusEntry>;
21160
21175
  title?: string;
21161
21176
  subtitle?: string;
21162
21177
  tags?: Array<string>;
21178
+ consentType?: ConsentSubscriptionConsentTypeEnum;
21179
+ consentRequired?: boolean;
21180
+ defaultStatus?: ConsentSubscriptionDefaultStatusEnum;
21163
21181
  } & {
21164
21182
  [key: string]: any;
21165
21183
  };
21184
+ type ConsentSubscriptionConsentTypeEnum = "marketing" | "legal";
21185
+ type ConsentSubscriptionDefaultStatusEnum = "opt_in" | "opt_out";
21166
21186
  /**
21167
21187
  * @type ConsentSubscriptionRequest: Consent subscription update request
21168
21188
  *
@@ -21183,8 +21203,80 @@ type ConsentSubscription = {
21183
21203
  type ConsentSubscriptionRequest = {
21184
21204
  subscriptionId: string;
21185
21205
  contactPointValue: string;
21186
- channel: SubscriptionChannel;
21206
+ channel: ChannelType;
21207
+ status: ConsentStatus;
21208
+ } & {
21209
+ [key: string]: any;
21210
+ };
21211
+ /**
21212
+ * @type ConsentSubscriptionBulkRequest: Bulk request for updating multiple consent subscriptions
21213
+ *
21214
+ * @property subscriptions: Array of subscription consent updates to process
21215
+ *
21216
+ */
21217
+ type ConsentSubscriptionBulkRequest = {
21218
+ subscriptions: Array<ConsentSubscriptionRequest>;
21219
+ } & {
21220
+ [key: string]: any;
21221
+ };
21222
+ /**
21223
+ * @type ConsentSubscriptionError: Error details for failed subscription updates
21224
+ *
21225
+ * @property code: Error code indicating the type of failure
21226
+ * - **Max Length:** 100
21227
+ *
21228
+ * @property message: Human-readable error message
21229
+ * - **Max Length:** 500
21230
+ *
21231
+ * @property details: Additional error details
21232
+ *
21233
+ */
21234
+ type ConsentSubscriptionError = {
21235
+ code: string;
21236
+ message: string;
21237
+ details?: object;
21238
+ } & {
21239
+ [key: string]: any;
21240
+ };
21241
+ /**
21242
+ * @type ConsentSubscriptionResult: Individual subscription update result with input parameters
21243
+ *
21244
+ * @property subscriptionId: Identifier for the communication subscription
21245
+ * - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
21246
+ * - **Min Length:** 1
21247
+ * - **Max Length:** 255
21248
+ *
21249
+ * @property channel:
21250
+ *
21251
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
21252
+ * - **Min Length:** 3
21253
+ * - **Max Length:** 320
21254
+ *
21255
+ * @property status:
21256
+ *
21257
+ * @property success: Whether the subscription update was successful
21258
+ *
21259
+ * @property error:
21260
+ *
21261
+ */
21262
+ type ConsentSubscriptionResult = {
21263
+ subscriptionId: string;
21264
+ channel: ChannelType;
21265
+ contactPointValue: string;
21187
21266
  status: ConsentStatus;
21267
+ success: boolean;
21268
+ error?: ConsentSubscriptionError;
21269
+ } & {
21270
+ [key: string]: any;
21271
+ };
21272
+ /**
21273
+ * @type ConsentSubscriptionBulkResponse: Bulk response with results for each subscription update request
21274
+ *
21275
+ * @property results: Results for each subscription update request
21276
+ *
21277
+ */
21278
+ type ConsentSubscriptionBulkResponse = {
21279
+ results: Array<ConsentSubscriptionResult>;
21188
21280
  } & {
21189
21281
  [key: string]: any;
21190
21282
  };
@@ -21199,6 +21291,31 @@ type ConsentSubscriptionResponse = {
21199
21291
  } & {
21200
21292
  [key: string]: any;
21201
21293
  };
21294
+ /**
21295
+ * @type ConsentSubscriptionUpdateResponse: Single subscription update response
21296
+ *
21297
+ * @property subscriptionId: Identifier for the communication subscription
21298
+ * - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
21299
+ * - **Min Length:** 1
21300
+ * - **Max Length:** 255
21301
+ *
21302
+ * @property channel:
21303
+ *
21304
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
21305
+ * - **Min Length:** 3
21306
+ * - **Max Length:** 320
21307
+ *
21308
+ * @property status:
21309
+ *
21310
+ */
21311
+ type ConsentSubscriptionUpdateResponse = {
21312
+ subscriptionId: string;
21313
+ channel: ChannelType;
21314
+ contactPointValue: string;
21315
+ status: ConsentStatus;
21316
+ } & {
21317
+ [key: string]: any;
21318
+ };
21202
21319
  /**
21203
21320
  * A specialized value indicating the system default values for locales.
21204
21321
  */
@@ -21208,10 +21325,12 @@ type DefaultFallback$1 = "default";
21208
21325
  * A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
21209
21326
  */
21210
21327
  type LocaleCode$2 = DefaultFallback$1 | string;
21328
+ type GetSubscriptionsExpandEnum = "consentStatus";
21211
21329
  type getSubscriptionsQueryParameters = {
21212
21330
  siteId: string;
21213
21331
  locale?: LocaleCode$2;
21214
21332
  tags?: Array<string>;
21333
+ expand?: Set<"consentStatus">;
21215
21334
  };
21216
21335
  type getSubscriptionsPathParameters = {
21217
21336
  organizationId: string;
@@ -21223,14 +21342,21 @@ type updateSubscriptionQueryParameters = {
21223
21342
  type updateSubscriptionPathParameters = {
21224
21343
  organizationId: string;
21225
21344
  };
21345
+ type updateSubscriptionsQueryParameters = {
21346
+ siteId: string;
21347
+ locale?: LocaleCode$2;
21348
+ };
21349
+ type updateSubscriptionsPathParameters = {
21350
+ organizationId: string;
21351
+ };
21226
21352
  /**
21227
21353
  * All path parameters that are used by at least one ShopperConsents method.
21228
21354
  */
21229
- type ShopperConsentsPathParameters = Partial<getSubscriptionsPathParameters & updateSubscriptionPathParameters & {}>;
21355
+ type ShopperConsentsPathParameters = Partial<getSubscriptionsPathParameters & updateSubscriptionPathParameters & updateSubscriptionsPathParameters & {}>;
21230
21356
  /**
21231
21357
  * All query parameters that are used by at least one ShopperConsents method.
21232
21358
  */
21233
- type ShopperConsentsQueryParameters = Partial<getSubscriptionsQueryParameters & updateSubscriptionQueryParameters & {}>;
21359
+ type ShopperConsentsQueryParameters = Partial<getSubscriptionsQueryParameters & updateSubscriptionQueryParameters & updateSubscriptionsQueryParameters & {}>;
21234
21360
  /**
21235
21361
  * All parameters that are used by ShopperConsents.
21236
21362
  */
@@ -21239,18 +21365,21 @@ type ShopperConsentsParameters = ShopperConsentsPathParameters & BaseUriParamete
21239
21365
  * [Shopper Consents](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-consents:Summary)
21240
21366
  * ==================================
21241
21367
  *
21242
- * *# Shopper Consent
21368
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-consents/shopper-consents-oas-v1-public.yaml)
21243
21369
 
21244
- ## API Overview
21370
+ # API Overview
21245
21371
 
21246
21372
  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.
21247
21373
 
21248
21374
  ## Key Features
21249
21375
 
21250
- - Multi-Channel Support: Manage communication subscriptions across email, SMS, push notifications, in-app messages, and postal mail.
21251
- - Organization-Based Management: Isolate consent preferences by organization for multi-tenant environments.
21252
- - Real-Time Updates: Instantly create and retrieve subscription preferences.
21253
- - Compliance Ready: Built with privacy regulations and consent-management best practices in mind.
21376
+ - **Retrieve communication subscriptions**: Retrieve relevant communication subscription options with rich display information.
21377
+ - Communication subscription options can be filtered by one or more qualifying tags.
21378
+ - Use the `expand` parameter to conditionally include subscription status.
21379
+ - **Update individual subscription consent**: Update consent status for a single subscription with simple request/response pattern.
21380
+ - **Bulk subscription updates**: Efficiently manage multiple subscription preferences with a single request.
21381
+ - Update 1-50 subscriptions per bulk request.
21382
+ - Partial success handling with detailed error reporting for failed updates.
21254
21383
 
21255
21384
  ## Authentication & Authorization
21256
21385
 
@@ -21263,40 +21392,82 @@ type ShopperConsentsParameters = ShopperConsentsPathParameters & BaseUriParamete
21263
21392
  ### Required Scopes
21264
21393
 
21265
21394
  - `sfcc.shopper-consents`: Required for reading communication subscription data (GET operations).
21266
- - `sfcc.shopper-consents.rw`: Required for creating and modifying communication subscription data (POST operations).
21267
-
21268
- ## Use Cases
21269
-
21270
- ### Shopper Subscription Management
21271
- - Retrieve communication subscriptions: Retrieve relevant communication subscription options with display information.
21272
- - Guest shoppers can retrieve communication subscriptions options without pre-defined shopper credentials, for example: email address, phone number.
21273
- - Authenticated shoppers can retrieve communication subscription options available to their shopper credentials.
21274
- - Communication subscription options can be filtered by one or more qualifying tags.
21275
- - Update communication subscription consent preferences.
21395
+ - `sfcc.shopper-consents.rw`: Required for creating and modifying communication subscription consent data (POST operations).
21276
21396
 
21277
21397
  ## Data Model
21278
21398
 
21279
21399
  ### Subscriptions
21280
21400
  Subscriptions represent a shopper's consent to receive specific types of marketing communications. Each subscription includes:
21281
21401
 
21282
- - Identifier: Descriptive identifier
21283
- - Consent Status: Opt-in or opt-out
21284
- - Display Information: Title, subtitle, and description for customer-facing interfaces
21285
- - Tags: Categorical tags indicating where the subscription option can appear
21286
- - Channels: Supported communication methods, such as email, SMS, push notification
21402
+ - **Subscription Id**: Descriptive identifier
21403
+ - **Channels**: Array of communication methods - Email, SMS, or WhatsApp
21404
+ - **Consent Type**: Marketing or legal subscription classification
21405
+ - **Consent Required**: Whether the subscription is mandatory for the shopper
21406
+ - **Default Status**: Default opt-in or opt-out behavior
21407
+ - **Consent Status**: Array of status entries for each channel showing current opt-in or opt-out status (conditionally returned based on expand parameter)
21408
+ - **Rich Display Information**:
21409
+ - Title: Simple localized string for subscription name
21410
+ - Subtitle: Simple localized string with HTML markup support for descriptions
21411
+ - Localized content determined by the locale parameter
21412
+ - **Tags**: Categorical tags indicating where the subscription option can appear (defaults to empty array, max 10 tags)
21287
21413
 
21288
21414
  ### Channels
21289
21415
  Channels define the communication methods available for a subscription:
21290
21416
  - `email`: Email communications
21291
21417
  - `sms`: SMS/text messages
21292
- - `whatsapp`: WhatsApp
21418
+ - `whatsapp`: WhatsApp messaging
21293
21419
 
21294
21420
  ### Tags
21295
21421
  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:
21296
21422
  - `homepage_banner`: Main website homepage
21297
- - `registration`: Shopper registration process
21298
- - `checkout`: Checkout process
21299
- - `user_profile`: User profile management area
21423
+ - `registration`: Shopper registration form
21424
+ - `checkout`: Checkout flow
21425
+ - `user_profile`: User profile management section
21426
+
21427
+ ### Default Values
21428
+ The API provides sensible defaults for optional fields to simplify integration:
21429
+ - **Consent Type**: Defaults to "marketing" for marketing communications
21430
+ - **Consent Required**: Defaults to false, making subscriptions optional by default
21431
+ - **Default Status**: Defaults to "opt_out" to respect privacy-first principles
21432
+ - **Tags**: Defaults to an empty array when not specified
21433
+
21434
+ ## Advanced Features
21435
+
21436
+ ### Expand Parameter
21437
+ The `expand` parameter provides conditional field inclusion:
21438
+ - `expand=[]` (default): Returns basic subscription information
21439
+ - `expand=["consentStatus"]`: Include consent status information in the response
21440
+ - Future expansion may include additional fields
21441
+
21442
+ ### Single Subscription Updates
21443
+ Update consent for one subscription at a time:
21444
+ - **Endpoint**: `POST /organizations/{organizationId}/subscriptions`
21445
+ - **Request**: Requires subscriptionId, contactPointValue, channel, and status
21446
+ - **Response**: Returns the same parameters on success (HTTP 200)
21447
+ - **Use Case**: Ideal for real-time updates as shoppers interact with individual preferences
21448
+
21449
+ ### Bulk Operations
21450
+ Efficiently manage multiple subscription preferences in a single request:
21451
+ - **Endpoint**: `POST /organizations/{organizationId}/subscriptions/actions/bulk`
21452
+ - **Request Limits**: 1-50 subscriptions per bulk request
21453
+ - **Response Handling**:
21454
+ - HTTP 200: All updates successful
21455
+ - HTTP 207 Multi-Status: Partial success with detailed error reporting
21456
+ - HTTP 400: Request validation failure
21457
+ - **Error Isolation**: Failed updates don't affect successful ones
21458
+ - **Individual Results**: Each subscription update returns:
21459
+ - Original input parameters (subscriptionId, contactPointValue, channel, status)
21460
+ - Success/failure status
21461
+ - Detailed error information for failed updates
21462
+ - No full subscription objects returned for improved performance
21463
+
21464
+ ## Error Handling
21465
+
21466
+ The API uses standard HTTP status codes and returns detailed error information to help with troubleshooting:
21467
+
21468
+ - `200 OK`: Successful operation (single or bulk with all successes)
21469
+ - `207 Multi-Status`: Bulk operation with partial success
21470
+ - `400 Bad Request`: Invalid request format, missing required fields, or markup validation errors
21300
21471
 
21301
21472
  ## Best Practices
21302
21473
 
@@ -21306,25 +21477,13 @@ type ShopperConsentsParameters = ShopperConsentsPathParameters & BaseUriParamete
21306
21477
 
21307
21478
  ### Implementation Guidelines
21308
21479
  - Implement clear and prominent unsubscribe mechanisms.
21480
+ - Validate HTML markup content to prevent XSS vulnerabilities.
21481
+ - Handle partial success scenarios gracefully in bulk operations.
21309
21482
 
21310
- ### Compliance Considerations
21311
- - Ensure consent is freely given, specific, informed, and unambiguous.
21312
- - Implement proper data retention and deletion policies.
21313
- - Provide easy access to consent history and preferences.
21314
-
21315
- ## Error Handling
21316
-
21317
- The API uses standard HTTP status codes and returns detailed error information to help with troubleshooting:
21318
-
21319
- - `400 Bad Request`: Invalid request format or missing required fields
21320
- - `401 Unauthorized`: Invalid or missing authentication token
21321
- - `403 Forbidden`: Insufficient permissions for the requested operation
21322
- - `404 Not Found`: Requested organization or resource not found
21323
- - `500 Internal Server Error`: Unexpected server error
21324
-
21325
- ## Rate Limits
21326
-
21327
- To ensure fair usage and system stability, the Shopper Consent API implements rate limiting. Refer to the response headers for current rate limit status and adjust your integration accordingly.*<br />
21483
+ ### Performance Considerations
21484
+ - Use single subscription updates for real-time, interactive preference changes.
21485
+ - Use bulk operations when updating multiple subscriptions to reduce API calls and improve performance.
21486
+ - Only request status information when needed using the expand parameter to reduce latency.*<br />
21328
21487
  *
21329
21488
  * Simple example:
21330
21489
  *
@@ -21358,6 +21517,7 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21358
21517
  static readonly apiPaths: {
21359
21518
  getSubscriptions: string;
21360
21519
  updateSubscription: string;
21520
+ updateSubscriptions: string;
21361
21521
  };
21362
21522
  constructor(config: ClientConfigInit<ConfigParameters>);
21363
21523
  static readonly paramKeys: {
@@ -21365,7 +21525,8 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21365
21525
  "organizationId",
21366
21526
  "siteId",
21367
21527
  "locale",
21368
- "tags"
21528
+ "tags",
21529
+ "expand"
21369
21530
  ];
21370
21531
  readonly getSubscriptionsRequired: readonly [
21371
21532
  "organizationId",
@@ -21380,9 +21541,26 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21380
21541
  "organizationId",
21381
21542
  "siteId"
21382
21543
  ];
21544
+ readonly updateSubscriptions: readonly [
21545
+ "organizationId",
21546
+ "siteId",
21547
+ "locale"
21548
+ ];
21549
+ readonly updateSubscriptionsRequired: readonly [
21550
+ "organizationId",
21551
+ "siteId"
21552
+ ];
21383
21553
  };
21384
21554
  /**
21385
- * Retrieve all subcription preferences for the shopper (authenticated or guest)
21555
+ * Retrieve all subscription preferences for the shopper (authenticated or guest).
21556
+
21557
+ Use the 'expand' parameter to include additional fields in the response:
21558
+ - expand=["consentStatus"]: Include subscription status information
21559
+ - expand=[]: Default behavior, excludes status for privacy and performance
21560
+
21561
+ The expand parameter provides privacy benefits by not exposing sensitive status
21562
+ information unless explicitly requested.
21563
+
21386
21564
  *
21387
21565
  * If you would like to get a raw Response object use the other getSubscriptions function.
21388
21566
  *
@@ -21392,6 +21570,13 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21392
21570
  * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
21393
21571
  * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
21394
21572
  * @param options.parameters.tags - Optional parameter of 0 or more query string values which act as a filtering criteria. Multiple values are treated with `OR` logic, and absence of a value indicates no filtering by tag is desired.
21573
+ * @param options.parameters.expand - Optional parameter to expand response with additional fields.
21574
+ Accepts an array of field names to include in the response.
21575
+ Currently supports:
21576
+ - "consentStatus": Include consent status information in the response
21577
+
21578
+ Future expansions may include additional fields.
21579
+
21395
21580
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21396
21581
  *
21397
21582
  * @returns A promise of type ConsentSubscriptionResponse.
@@ -21402,13 +21587,22 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21402
21587
  siteId: string;
21403
21588
  locale?: LocaleCode$2;
21404
21589
  tags?: Array<string>;
21590
+ expand?: Set<GetSubscriptionsExpandEnum>;
21405
21591
  } & QueryParameters, ConfigParameters>;
21406
21592
  headers?: {
21407
21593
  [key: string]: string;
21408
21594
  };
21409
21595
  }>): Promise<ConsentSubscriptionResponse>;
21410
21596
  /**
21411
- * Retrieve all subcription preferences for the shopper (authenticated or guest)
21597
+ * Retrieve all subscription preferences for the shopper (authenticated or guest).
21598
+
21599
+ Use the 'expand' parameter to include additional fields in the response:
21600
+ - expand=["consentStatus"]: Include subscription status information
21601
+ - expand=[]: Default behavior, excludes status for privacy and performance
21602
+
21603
+ The expand parameter provides privacy benefits by not exposing sensitive status
21604
+ information unless explicitly requested.
21605
+
21412
21606
  *
21413
21607
  * @param options - An object containing the options for this method.
21414
21608
  * @param options.parameters - An object containing the parameters for this method.
@@ -21416,6 +21610,13 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21416
21610
  * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
21417
21611
  * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
21418
21612
  * @param options.parameters.tags - Optional parameter of 0 or more query string values which act as a filtering criteria. Multiple values are treated with `OR` logic, and absence of a value indicates no filtering by tag is desired.
21613
+ * @param options.parameters.expand - Optional parameter to expand response with additional fields.
21614
+ Accepts an array of field names to include in the response.
21615
+ Currently supports:
21616
+ - "consentStatus": Include consent status information in the response
21617
+
21618
+ Future expansions may include additional fields.
21619
+
21419
21620
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21420
21621
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
21421
21622
  *
@@ -21427,13 +21628,14 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21427
21628
  siteId: string;
21428
21629
  locale?: LocaleCode$2;
21429
21630
  tags?: Array<string>;
21631
+ expand?: Set<GetSubscriptionsExpandEnum>;
21430
21632
  } & QueryParameters, ConfigParameters>;
21431
21633
  headers?: {
21432
21634
  [key: string]: string;
21433
21635
  };
21434
21636
  }>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscriptionResponse>;
21435
21637
  /**
21436
- * Update the consent status for a given subscription.
21638
+ * Update the consent status for a single subscription.
21437
21639
  *
21438
21640
  * If you would like to get a raw Response object use the other updateSubscription function.
21439
21641
  *
@@ -21445,7 +21647,7 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21445
21647
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21446
21648
  * @param options.body - The data to send as the request body.
21447
21649
  *
21448
- * @returns A promise of type ConsentSubscription.
21650
+ * @returns A promise of type ConsentSubscriptionUpdateResponse.
21449
21651
  */
21450
21652
  updateSubscription(options: RequireParametersUnlessAllAreOptional<{
21451
21653
  parameters?: CompositeParameters<{
@@ -21457,9 +21659,9 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21457
21659
  [key: string]: string;
21458
21660
  };
21459
21661
  body: ConsentSubscriptionRequest & CustomRequestBody;
21460
- }>): Promise<ConsentSubscription>;
21662
+ }>): Promise<ConsentSubscriptionUpdateResponse>;
21461
21663
  /**
21462
- * Update the consent status for a given subscription.
21664
+ * Update the consent status for a single subscription.
21463
21665
  *
21464
21666
  * @param options - An object containing the options for this method.
21465
21667
  * @param options.parameters - An object containing the parameters for this method.
@@ -21470,7 +21672,7 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21470
21672
  * @param options.body - The data to send as the request body.
21471
21673
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
21472
21674
  *
21473
- * @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscription otherwise.
21675
+ * @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionUpdateResponse otherwise.
21474
21676
  */
21475
21677
  updateSubscription<T extends boolean>(options: RequireParametersUnlessAllAreOptional<{
21476
21678
  parameters?: CompositeParameters<{
@@ -21482,7 +21684,58 @@ declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters
21482
21684
  [key: string]: string;
21483
21685
  };
21484
21686
  body: ConsentSubscriptionRequest & CustomRequestBody;
21485
- }>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscription>;
21687
+ }>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscriptionUpdateResponse>;
21688
+ /**
21689
+ * Update the consent status for multiple subscriptions in a single bulk request. Supports 1-50 subscription updates per request with partial success handling.
21690
+ *
21691
+ * If you would like to get a raw Response object use the other updateSubscriptions function.
21692
+ *
21693
+ * @param options - An object containing the options for this method.
21694
+ * @param options.parameters - An object containing the parameters for this method.
21695
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
21696
+ * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
21697
+ * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
21698
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21699
+ * @param options.body - The data to send as the request body.
21700
+ *
21701
+ * @returns A promise of type ConsentSubscriptionBulkResponse.
21702
+ */
21703
+ updateSubscriptions(options: RequireParametersUnlessAllAreOptional<{
21704
+ parameters?: CompositeParameters<{
21705
+ organizationId: string;
21706
+ siteId: string;
21707
+ locale?: LocaleCode$2;
21708
+ } & QueryParameters, ConfigParameters>;
21709
+ headers?: {
21710
+ [key: string]: string;
21711
+ };
21712
+ body: ConsentSubscriptionBulkRequest & CustomRequestBody;
21713
+ }>): Promise<ConsentSubscriptionBulkResponse>;
21714
+ /**
21715
+ * Update the consent status for multiple subscriptions in a single bulk request. Supports 1-50 subscription updates per request with partial success handling.
21716
+ *
21717
+ * @param options - An object containing the options for this method.
21718
+ * @param options.parameters - An object containing the parameters for this method.
21719
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
21720
+ * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
21721
+ * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
21722
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21723
+ * @param options.body - The data to send as the request body.
21724
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
21725
+ *
21726
+ * @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionBulkResponse otherwise.
21727
+ */
21728
+ updateSubscriptions<T extends boolean>(options: RequireParametersUnlessAllAreOptional<{
21729
+ parameters?: CompositeParameters<{
21730
+ organizationId: string;
21731
+ siteId: string;
21732
+ locale?: LocaleCode$2;
21733
+ } & QueryParameters, ConfigParameters>;
21734
+ headers?: {
21735
+ [key: string]: string;
21736
+ };
21737
+ body: ConsentSubscriptionBulkRequest & CustomRequestBody;
21738
+ }>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscriptionBulkResponse>;
21486
21739
  }
21487
21740
  declare namespace ShopperConsentsApiTypes {
21488
21741
  /*
@@ -21593,14 +21846,33 @@ declare namespace ShopperConsentsApiTypes {
21593
21846
  constructor(config: ClientConfigInit<Params>);
21594
21847
  static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
21595
21848
  }
21849
+ /**
21850
+ *
21851
+ */
21852
+ type ChannelType = "email" | "sms" | "whatsapp";
21596
21853
  /**
21597
21854
  * The consent status of the subscription as supplied or recorded by this system
21598
21855
  */
21599
21856
  type ConsentStatus = "opt_in" | "opt_out";
21600
21857
  /**
21858
+ * @type SubscriptionStatusEntry: Individual subscription status entry for a specific channel
21859
+ *
21860
+ * @property channel:
21861
+ *
21862
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
21863
+ * - **Min Length:** 3
21864
+ * - **Max Length:** 320
21865
+ *
21866
+ * @property status:
21601
21867
  *
21602
21868
  */
21603
- type SubscriptionChannel = "email" | "sms" | "push_notification" | "in_app" | "postal_mail" | "whatsapp";
21869
+ type SubscriptionStatusEntry = {
21870
+ channel: ChannelType;
21871
+ contactPointValue: string;
21872
+ status: ConsentStatus;
21873
+ } & {
21874
+ [key: string]: any;
21875
+ };
21604
21876
  /**
21605
21877
  * @type ConsentSubscription:
21606
21878
  *
@@ -21609,41 +21881,42 @@ declare namespace ShopperConsentsApiTypes {
21609
21881
  * - **Min Length:** 1
21610
21882
  * - **Max Length:** 255
21611
21883
  *
21612
- * @property consentId: Identifier for the shopper communication subscription consent -- formatted as `<contactPointValue>#<communicationSubscriptionChannelId>`
21613
- * - **Min Length:** 19
21614
- * - **Max Length:** 339
21615
- *
21616
- * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
21617
- * - **Min Length:** 3
21618
- * - **Max Length:** 320
21619
- *
21620
- * @property channel:
21884
+ * @property channels:
21621
21885
  *
21622
- * @property status:
21886
+ * @property consentStatus: Array of subscription status entries for different channels
21623
21887
  *
21624
- * @property title:
21888
+ * @property title: The localized title of the subscription for shopper displays
21625
21889
  * - **Min Length:** 1
21626
21890
  * - **Max Length:** 255
21627
21891
  *
21628
- * @property subtitle:
21892
+ * @property subtitle: The localized subtitle of the subscription for shopper displays, may contain HTML markup
21629
21893
  * - **Min Length:** 1
21630
- * - **Max Length:** 255
21894
+ * - **Max Length:** 2000
21631
21895
  *
21632
21896
  * @property tags:
21633
21897
  *
21898
+ * @property consentType: Type of consent subscription
21899
+ *
21900
+ * @property consentRequired: Whether this subscription is mandatory for the user
21901
+ *
21902
+ * @property defaultStatus: Default consent status for this subscription
21903
+ *
21634
21904
  */
21635
21905
  type ConsentSubscription = {
21636
21906
  subscriptionId: string;
21637
- consentId?: string;
21638
- contactPointValue?: string;
21639
- channel: SubscriptionChannel;
21640
- status?: ConsentStatus;
21907
+ channels: Set<ChannelType>;
21908
+ consentStatus?: Array<SubscriptionStatusEntry>;
21641
21909
  title?: string;
21642
21910
  subtitle?: string;
21643
21911
  tags?: Array<string>;
21912
+ consentType?: ConsentSubscriptionConsentTypeEnum;
21913
+ consentRequired?: boolean;
21914
+ defaultStatus?: ConsentSubscriptionDefaultStatusEnum;
21644
21915
  } & {
21645
21916
  [key: string]: any;
21646
21917
  };
21918
+ type ConsentSubscriptionConsentTypeEnum = "marketing" | "legal";
21919
+ type ConsentSubscriptionDefaultStatusEnum = "opt_in" | "opt_out";
21647
21920
  /**
21648
21921
  * @type ConsentSubscriptionRequest: Consent subscription update request
21649
21922
  *
@@ -21664,8 +21937,80 @@ declare namespace ShopperConsentsApiTypes {
21664
21937
  type ConsentSubscriptionRequest = {
21665
21938
  subscriptionId: string;
21666
21939
  contactPointValue: string;
21667
- channel: SubscriptionChannel;
21940
+ channel: ChannelType;
21941
+ status: ConsentStatus;
21942
+ } & {
21943
+ [key: string]: any;
21944
+ };
21945
+ /**
21946
+ * @type ConsentSubscriptionBulkRequest: Bulk request for updating multiple consent subscriptions
21947
+ *
21948
+ * @property subscriptions: Array of subscription consent updates to process
21949
+ *
21950
+ */
21951
+ type ConsentSubscriptionBulkRequest = {
21952
+ subscriptions: Array<ConsentSubscriptionRequest>;
21953
+ } & {
21954
+ [key: string]: any;
21955
+ };
21956
+ /**
21957
+ * @type ConsentSubscriptionError: Error details for failed subscription updates
21958
+ *
21959
+ * @property code: Error code indicating the type of failure
21960
+ * - **Max Length:** 100
21961
+ *
21962
+ * @property message: Human-readable error message
21963
+ * - **Max Length:** 500
21964
+ *
21965
+ * @property details: Additional error details
21966
+ *
21967
+ */
21968
+ type ConsentSubscriptionError = {
21969
+ code: string;
21970
+ message: string;
21971
+ details?: object;
21972
+ } & {
21973
+ [key: string]: any;
21974
+ };
21975
+ /**
21976
+ * @type ConsentSubscriptionResult: Individual subscription update result with input parameters
21977
+ *
21978
+ * @property subscriptionId: Identifier for the communication subscription
21979
+ * - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
21980
+ * - **Min Length:** 1
21981
+ * - **Max Length:** 255
21982
+ *
21983
+ * @property channel:
21984
+ *
21985
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
21986
+ * - **Min Length:** 3
21987
+ * - **Max Length:** 320
21988
+ *
21989
+ * @property status:
21990
+ *
21991
+ * @property success: Whether the subscription update was successful
21992
+ *
21993
+ * @property error:
21994
+ *
21995
+ */
21996
+ type ConsentSubscriptionResult = {
21997
+ subscriptionId: string;
21998
+ channel: ChannelType;
21999
+ contactPointValue: string;
21668
22000
  status: ConsentStatus;
22001
+ success: boolean;
22002
+ error?: ConsentSubscriptionError;
22003
+ } & {
22004
+ [key: string]: any;
22005
+ };
22006
+ /**
22007
+ * @type ConsentSubscriptionBulkResponse: Bulk response with results for each subscription update request
22008
+ *
22009
+ * @property results: Results for each subscription update request
22010
+ *
22011
+ */
22012
+ type ConsentSubscriptionBulkResponse = {
22013
+ results: Array<ConsentSubscriptionResult>;
21669
22014
  } & {
21670
22015
  [key: string]: any;
21671
22016
  };
@@ -21680,6 +22025,31 @@ declare namespace ShopperConsentsApiTypes {
21680
22025
  } & {
21681
22026
  [key: string]: any;
21682
22027
  };
22028
+ /**
22029
+ * @type ConsentSubscriptionUpdateResponse: Single subscription update response
22030
+ *
22031
+ * @property subscriptionId: Identifier for the communication subscription
22032
+ * - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
22033
+ * - **Min Length:** 1
22034
+ * - **Max Length:** 255
22035
+ *
22036
+ * @property channel:
22037
+ *
22038
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
22039
+ * - **Min Length:** 3
22040
+ * - **Max Length:** 320
22041
+ *
22042
+ * @property status:
22043
+ *
22044
+ */
22045
+ type ConsentSubscriptionUpdateResponse = {
22046
+ subscriptionId: string;
22047
+ channel: ChannelType;
22048
+ contactPointValue: string;
22049
+ status: ConsentStatus;
22050
+ } & {
22051
+ [key: string]: any;
22052
+ };
21683
22053
  /**
21684
22054
  * A specialized value indicating the system default values for locales.
21685
22055
  */
@@ -21712,10 +22082,12 @@ declare namespace ShopperConsentsApiTypes {
21712
22082
  * A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
21713
22083
  */
21714
22084
  type LocaleCode$0 = DefaultFallback | string;
22085
+ type GetSubscriptionsExpandEnum = "consentStatus";
21715
22086
  type getSubscriptionsQueryParameters = {
21716
22087
  siteId: string;
21717
22088
  locale?: LocaleCode$0;
21718
22089
  tags?: Array<string>;
22090
+ expand?: Set<"consentStatus">;
21719
22091
  };
21720
22092
  type getSubscriptionsPathParameters = {
21721
22093
  organizationId: string;
@@ -21727,14 +22099,21 @@ declare namespace ShopperConsentsApiTypes {
21727
22099
  type updateSubscriptionPathParameters = {
21728
22100
  organizationId: string;
21729
22101
  };
22102
+ type updateSubscriptionsQueryParameters = {
22103
+ siteId: string;
22104
+ locale?: LocaleCode$0;
22105
+ };
22106
+ type updateSubscriptionsPathParameters = {
22107
+ organizationId: string;
22108
+ };
21730
22109
  /**
21731
22110
  * All path parameters that are used by at least one ShopperConsents method.
21732
22111
  */
21733
- type ShopperConsentsPathParameters = Partial<getSubscriptionsPathParameters & updateSubscriptionPathParameters & {}>;
22112
+ type ShopperConsentsPathParameters = Partial<getSubscriptionsPathParameters & updateSubscriptionPathParameters & updateSubscriptionsPathParameters & {}>;
21734
22113
  /**
21735
22114
  * All query parameters that are used by at least one ShopperConsents method.
21736
22115
  */
21737
- type ShopperConsentsQueryParameters = Partial<getSubscriptionsQueryParameters & updateSubscriptionQueryParameters & {}>;
22116
+ type ShopperConsentsQueryParameters = Partial<getSubscriptionsQueryParameters & updateSubscriptionQueryParameters & updateSubscriptionsQueryParameters & {}>;
21738
22117
  /**
21739
22118
  * All parameters that are used by ShopperConsents.
21740
22119
  */
@@ -21743,18 +22122,21 @@ declare namespace ShopperConsentsApiTypes {
21743
22122
  * [Shopper Consents](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-consents:Summary)
21744
22123
  * ==================================
21745
22124
  *
21746
- * *# Shopper Consent
22125
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-consents/shopper-consents-oas-v1-public.yaml)
21747
22126
 
21748
- ## API Overview
22127
+ # API Overview
21749
22128
 
21750
22129
  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.
21751
22130
 
21752
22131
  ## Key Features
21753
22132
 
21754
- - Multi-Channel Support: Manage communication subscriptions across email, SMS, push notifications, in-app messages, and postal mail.
21755
- - Organization-Based Management: Isolate consent preferences by organization for multi-tenant environments.
21756
- - Real-Time Updates: Instantly create and retrieve subscription preferences.
21757
- - Compliance Ready: Built with privacy regulations and consent-management best practices in mind.
22133
+ - **Retrieve communication subscriptions**: Retrieve relevant communication subscription options with rich display information.
22134
+ - Communication subscription options can be filtered by one or more qualifying tags.
22135
+ - Use the `expand` parameter to conditionally include subscription status.
22136
+ - **Update individual subscription consent**: Update consent status for a single subscription with simple request/response pattern.
22137
+ - **Bulk subscription updates**: Efficiently manage multiple subscription preferences with a single request.
22138
+ - Update 1-50 subscriptions per bulk request.
22139
+ - Partial success handling with detailed error reporting for failed updates.
21758
22140
 
21759
22141
  ## Authentication & Authorization
21760
22142
 
@@ -21767,40 +22149,82 @@ declare namespace ShopperConsentsApiTypes {
21767
22149
  ### Required Scopes
21768
22150
 
21769
22151
  - `sfcc.shopper-consents`: Required for reading communication subscription data (GET operations).
21770
- - `sfcc.shopper-consents.rw`: Required for creating and modifying communication subscription data (POST operations).
21771
-
21772
- ## Use Cases
21773
-
21774
- ### Shopper Subscription Management
21775
- - Retrieve communication subscriptions: Retrieve relevant communication subscription options with display information.
21776
- - Guest shoppers can retrieve communication subscriptions options without pre-defined shopper credentials, for example: email address, phone number.
21777
- - Authenticated shoppers can retrieve communication subscription options available to their shopper credentials.
21778
- - Communication subscription options can be filtered by one or more qualifying tags.
21779
- - Update communication subscription consent preferences.
22152
+ - `sfcc.shopper-consents.rw`: Required for creating and modifying communication subscription consent data (POST operations).
21780
22153
 
21781
22154
  ## Data Model
21782
22155
 
21783
22156
  ### Subscriptions
21784
22157
  Subscriptions represent a shopper's consent to receive specific types of marketing communications. Each subscription includes:
21785
22158
 
21786
- - Identifier: Descriptive identifier
21787
- - Consent Status: Opt-in or opt-out
21788
- - Display Information: Title, subtitle, and description for customer-facing interfaces
21789
- - Tags: Categorical tags indicating where the subscription option can appear
21790
- - Channels: Supported communication methods, such as email, SMS, push notification
22159
+ - **Subscription Id**: Descriptive identifier
22160
+ - **Channels**: Array of communication methods - Email, SMS, or WhatsApp
22161
+ - **Consent Type**: Marketing or legal subscription classification
22162
+ - **Consent Required**: Whether the subscription is mandatory for the shopper
22163
+ - **Default Status**: Default opt-in or opt-out behavior
22164
+ - **Consent Status**: Array of status entries for each channel showing current opt-in or opt-out status (conditionally returned based on expand parameter)
22165
+ - **Rich Display Information**:
22166
+ - Title: Simple localized string for subscription name
22167
+ - Subtitle: Simple localized string with HTML markup support for descriptions
22168
+ - Localized content determined by the locale parameter
22169
+ - **Tags**: Categorical tags indicating where the subscription option can appear (defaults to empty array, max 10 tags)
21791
22170
 
21792
22171
  ### Channels
21793
22172
  Channels define the communication methods available for a subscription:
21794
22173
  - `email`: Email communications
21795
22174
  - `sms`: SMS/text messages
21796
- - `whatsapp`: WhatsApp
22175
+ - `whatsapp`: WhatsApp messaging
21797
22176
 
21798
22177
  ### Tags
21799
22178
  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:
21800
22179
  - `homepage_banner`: Main website homepage
21801
- - `registration`: Shopper registration process
21802
- - `checkout`: Checkout process
21803
- - `user_profile`: User profile management area
22180
+ - `registration`: Shopper registration form
22181
+ - `checkout`: Checkout flow
22182
+ - `user_profile`: User profile management section
22183
+
22184
+ ### Default Values
22185
+ The API provides sensible defaults for optional fields to simplify integration:
22186
+ - **Consent Type**: Defaults to "marketing" for marketing communications
22187
+ - **Consent Required**: Defaults to false, making subscriptions optional by default
22188
+ - **Default Status**: Defaults to "opt_out" to respect privacy-first principles
22189
+ - **Tags**: Defaults to an empty array when not specified
22190
+
22191
+ ## Advanced Features
22192
+
22193
+ ### Expand Parameter
22194
+ The `expand` parameter provides conditional field inclusion:
22195
+ - `expand=[]` (default): Returns basic subscription information
22196
+ - `expand=["consentStatus"]`: Include consent status information in the response
22197
+ - Future expansion may include additional fields
22198
+
22199
+ ### Single Subscription Updates
22200
+ Update consent for one subscription at a time:
22201
+ - **Endpoint**: `POST /organizations/{organizationId}/subscriptions`
22202
+ - **Request**: Requires subscriptionId, contactPointValue, channel, and status
22203
+ - **Response**: Returns the same parameters on success (HTTP 200)
22204
+ - **Use Case**: Ideal for real-time updates as shoppers interact with individual preferences
22205
+
22206
+ ### Bulk Operations
22207
+ Efficiently manage multiple subscription preferences in a single request:
22208
+ - **Endpoint**: `POST /organizations/{organizationId}/subscriptions/actions/bulk`
22209
+ - **Request Limits**: 1-50 subscriptions per bulk request
22210
+ - **Response Handling**:
22211
+ - HTTP 200: All updates successful
22212
+ - HTTP 207 Multi-Status: Partial success with detailed error reporting
22213
+ - HTTP 400: Request validation failure
22214
+ - **Error Isolation**: Failed updates don't affect successful ones
22215
+ - **Individual Results**: Each subscription update returns:
22216
+ - Original input parameters (subscriptionId, contactPointValue, channel, status)
22217
+ - Success/failure status
22218
+ - Detailed error information for failed updates
22219
+ - No full subscription objects returned for improved performance
22220
+
22221
+ ## Error Handling
22222
+
22223
+ The API uses standard HTTP status codes and returns detailed error information to help with troubleshooting:
22224
+
22225
+ - `200 OK`: Successful operation (single or bulk with all successes)
22226
+ - `207 Multi-Status`: Bulk operation with partial success
22227
+ - `400 Bad Request`: Invalid request format, missing required fields, or markup validation errors
21804
22228
 
21805
22229
  ## Best Practices
21806
22230
 
@@ -21810,25 +22234,13 @@ declare namespace ShopperConsentsApiTypes {
21810
22234
 
21811
22235
  ### Implementation Guidelines
21812
22236
  - Implement clear and prominent unsubscribe mechanisms.
22237
+ - Validate HTML markup content to prevent XSS vulnerabilities.
22238
+ - Handle partial success scenarios gracefully in bulk operations.
21813
22239
 
21814
- ### Compliance Considerations
21815
- - Ensure consent is freely given, specific, informed, and unambiguous.
21816
- - Implement proper data retention and deletion policies.
21817
- - Provide easy access to consent history and preferences.
21818
-
21819
- ## Error Handling
21820
-
21821
- The API uses standard HTTP status codes and returns detailed error information to help with troubleshooting:
21822
-
21823
- - `400 Bad Request`: Invalid request format or missing required fields
21824
- - `401 Unauthorized`: Invalid or missing authentication token
21825
- - `403 Forbidden`: Insufficient permissions for the requested operation
21826
- - `404 Not Found`: Requested organization or resource not found
21827
- - `500 Internal Server Error`: Unexpected server error
21828
-
21829
- ## Rate Limits
21830
-
21831
- To ensure fair usage and system stability, the Shopper Consent API implements rate limiting. Refer to the response headers for current rate limit status and adjust your integration accordingly.*<br />
22240
+ ### Performance Considerations
22241
+ - Use single subscription updates for real-time, interactive preference changes.
22242
+ - Use bulk operations when updating multiple subscriptions to reduce API calls and improve performance.
22243
+ - Only request status information when needed using the expand parameter to reduce latency.*<br />
21832
22244
  *
21833
22245
  * Simple example:
21834
22246
  *
@@ -21862,6 +22274,7 @@ declare namespace ShopperConsentsApiTypes {
21862
22274
  static readonly apiPaths: {
21863
22275
  getSubscriptions: string;
21864
22276
  updateSubscription: string;
22277
+ updateSubscriptions: string;
21865
22278
  };
21866
22279
  constructor(config: ClientConfigInit<ConfigParameters>);
21867
22280
  static readonly paramKeys: {
@@ -21869,7 +22282,8 @@ declare namespace ShopperConsentsApiTypes {
21869
22282
  "organizationId",
21870
22283
  "siteId",
21871
22284
  "locale",
21872
- "tags"
22285
+ "tags",
22286
+ "expand"
21873
22287
  ];
21874
22288
  readonly getSubscriptionsRequired: readonly [
21875
22289
  "organizationId",
@@ -21884,9 +22298,26 @@ declare namespace ShopperConsentsApiTypes {
21884
22298
  "organizationId",
21885
22299
  "siteId"
21886
22300
  ];
22301
+ readonly updateSubscriptions: readonly [
22302
+ "organizationId",
22303
+ "siteId",
22304
+ "locale"
22305
+ ];
22306
+ readonly updateSubscriptionsRequired: readonly [
22307
+ "organizationId",
22308
+ "siteId"
22309
+ ];
21887
22310
  };
21888
22311
  /**
21889
- * Retrieve all subcription preferences for the shopper (authenticated or guest)
22312
+ * Retrieve all subscription preferences for the shopper (authenticated or guest).
22313
+
22314
+ Use the 'expand' parameter to include additional fields in the response:
22315
+ - expand=["consentStatus"]: Include subscription status information
22316
+ - expand=[]: Default behavior, excludes status for privacy and performance
22317
+
22318
+ The expand parameter provides privacy benefits by not exposing sensitive status
22319
+ information unless explicitly requested.
22320
+
21890
22321
  *
21891
22322
  * If you would like to get a raw Response object use the other getSubscriptions function.
21892
22323
  *
@@ -21896,6 +22327,13 @@ declare namespace ShopperConsentsApiTypes {
21896
22327
  * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
21897
22328
  * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
21898
22329
  * @param options.parameters.tags - Optional parameter of 0 or more query string values which act as a filtering criteria. Multiple values are treated with `OR` logic, and absence of a value indicates no filtering by tag is desired.
22330
+ * @param options.parameters.expand - Optional parameter to expand response with additional fields.
22331
+ Accepts an array of field names to include in the response.
22332
+ Currently supports:
22333
+ - "consentStatus": Include consent status information in the response
22334
+
22335
+ Future expansions may include additional fields.
22336
+
21899
22337
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21900
22338
  *
21901
22339
  * @returns A promise of type ConsentSubscriptionResponse.
@@ -21906,13 +22344,22 @@ declare namespace ShopperConsentsApiTypes {
21906
22344
  siteId: string;
21907
22345
  locale?: LocaleCode$0;
21908
22346
  tags?: Array<string>;
22347
+ expand?: Set<GetSubscriptionsExpandEnum>;
21909
22348
  } & QueryParameters, ConfigParameters>;
21910
22349
  headers?: {
21911
22350
  [key: string]: string;
21912
22351
  };
21913
22352
  }>): Promise<ConsentSubscriptionResponse>;
21914
22353
  /**
21915
- * Retrieve all subcription preferences for the shopper (authenticated or guest)
22354
+ * Retrieve all subscription preferences for the shopper (authenticated or guest).
22355
+
22356
+ Use the 'expand' parameter to include additional fields in the response:
22357
+ - expand=["consentStatus"]: Include subscription status information
22358
+ - expand=[]: Default behavior, excludes status for privacy and performance
22359
+
22360
+ The expand parameter provides privacy benefits by not exposing sensitive status
22361
+ information unless explicitly requested.
22362
+
21916
22363
  *
21917
22364
  * @param options - An object containing the options for this method.
21918
22365
  * @param options.parameters - An object containing the parameters for this method.
@@ -21920,6 +22367,13 @@ declare namespace ShopperConsentsApiTypes {
21920
22367
  * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
21921
22368
  * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
21922
22369
  * @param options.parameters.tags - Optional parameter of 0 or more query string values which act as a filtering criteria. Multiple values are treated with `OR` logic, and absence of a value indicates no filtering by tag is desired.
22370
+ * @param options.parameters.expand - Optional parameter to expand response with additional fields.
22371
+ Accepts an array of field names to include in the response.
22372
+ Currently supports:
22373
+ - "consentStatus": Include consent status information in the response
22374
+
22375
+ Future expansions may include additional fields.
22376
+
21923
22377
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21924
22378
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
21925
22379
  *
@@ -21931,13 +22385,14 @@ declare namespace ShopperConsentsApiTypes {
21931
22385
  siteId: string;
21932
22386
  locale?: LocaleCode$0;
21933
22387
  tags?: Array<string>;
22388
+ expand?: Set<GetSubscriptionsExpandEnum>;
21934
22389
  } & QueryParameters, ConfigParameters>;
21935
22390
  headers?: {
21936
22391
  [key: string]: string;
21937
22392
  };
21938
22393
  }>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscriptionResponse>;
21939
22394
  /**
21940
- * Update the consent status for a given subscription.
22395
+ * Update the consent status for a single subscription.
21941
22396
  *
21942
22397
  * If you would like to get a raw Response object use the other updateSubscription function.
21943
22398
  *
@@ -21949,7 +22404,7 @@ declare namespace ShopperConsentsApiTypes {
21949
22404
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21950
22405
  * @param options.body - The data to send as the request body.
21951
22406
  *
21952
- * @returns A promise of type ConsentSubscription.
22407
+ * @returns A promise of type ConsentSubscriptionUpdateResponse.
21953
22408
  */
21954
22409
  updateSubscription(options: RequireParametersUnlessAllAreOptional<{
21955
22410
  parameters?: CompositeParameters<{
@@ -21961,9 +22416,9 @@ declare namespace ShopperConsentsApiTypes {
21961
22416
  [key: string]: string;
21962
22417
  };
21963
22418
  body: ConsentSubscriptionRequest & CustomRequestBody;
21964
- }>): Promise<ConsentSubscription>;
22419
+ }>): Promise<ConsentSubscriptionUpdateResponse>;
21965
22420
  /**
21966
- * Update the consent status for a given subscription.
22421
+ * Update the consent status for a single subscription.
21967
22422
  *
21968
22423
  * @param options - An object containing the options for this method.
21969
22424
  * @param options.parameters - An object containing the parameters for this method.
@@ -21974,7 +22429,7 @@ declare namespace ShopperConsentsApiTypes {
21974
22429
  * @param options.body - The data to send as the request body.
21975
22430
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
21976
22431
  *
21977
- * @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscription otherwise.
22432
+ * @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionUpdateResponse otherwise.
21978
22433
  */
21979
22434
  updateSubscription<T extends boolean>(options: RequireParametersUnlessAllAreOptional<{
21980
22435
  parameters?: CompositeParameters<{
@@ -21986,18 +22441,88 @@ declare namespace ShopperConsentsApiTypes {
21986
22441
  [key: string]: string;
21987
22442
  };
21988
22443
  body: ConsentSubscriptionRequest & CustomRequestBody;
21989
- }>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscription>;
22444
+ }>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscriptionUpdateResponse>;
22445
+ /**
22446
+ * Update the consent status for multiple subscriptions in a single bulk request. Supports 1-50 subscription updates per request with partial success handling.
22447
+ *
22448
+ * If you would like to get a raw Response object use the other updateSubscriptions function.
22449
+ *
22450
+ * @param options - An object containing the options for this method.
22451
+ * @param options.parameters - An object containing the parameters for this method.
22452
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
22453
+ * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
22454
+ * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
22455
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
22456
+ * @param options.body - The data to send as the request body.
22457
+ *
22458
+ * @returns A promise of type ConsentSubscriptionBulkResponse.
22459
+ */
22460
+ updateSubscriptions(options: RequireParametersUnlessAllAreOptional<{
22461
+ parameters?: CompositeParameters<{
22462
+ organizationId: string;
22463
+ siteId: string;
22464
+ locale?: LocaleCode$0;
22465
+ } & QueryParameters, ConfigParameters>;
22466
+ headers?: {
22467
+ [key: string]: string;
22468
+ };
22469
+ body: ConsentSubscriptionBulkRequest & CustomRequestBody;
22470
+ }>): Promise<ConsentSubscriptionBulkResponse>;
22471
+ /**
22472
+ * Update the consent status for multiple subscriptions in a single bulk request. Supports 1-50 subscription updates per request with partial success handling.
22473
+ *
22474
+ * @param options - An object containing the options for this method.
22475
+ * @param options.parameters - An object containing the parameters for this method.
22476
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
22477
+ * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
22478
+ * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
22479
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
22480
+ * @param options.body - The data to send as the request body.
22481
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
22482
+ *
22483
+ * @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionBulkResponse otherwise.
22484
+ */
22485
+ updateSubscriptions<T extends boolean>(options: RequireParametersUnlessAllAreOptional<{
22486
+ parameters?: CompositeParameters<{
22487
+ organizationId: string;
22488
+ siteId: string;
22489
+ locale?: LocaleCode$0;
22490
+ } & QueryParameters, ConfigParameters>;
22491
+ headers?: {
22492
+ [key: string]: string;
22493
+ };
22494
+ body: ConsentSubscriptionBulkRequest & CustomRequestBody;
22495
+ }>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscriptionBulkResponse>;
21990
22496
  }
21991
22497
  }
21992
22498
  declare namespace ShopperConsentsModelTypes {
22499
+ /**
22500
+ *
22501
+ */
22502
+ type ChannelType = "email" | "sms" | "whatsapp";
21993
22503
  /**
21994
22504
  * The consent status of the subscription as supplied or recorded by this system
21995
22505
  */
21996
22506
  type ConsentStatus = "opt_in" | "opt_out";
21997
22507
  /**
22508
+ * @type SubscriptionStatusEntry: Individual subscription status entry for a specific channel
22509
+ *
22510
+ * @property channel:
22511
+ *
22512
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
22513
+ * - **Min Length:** 3
22514
+ * - **Max Length:** 320
22515
+ *
22516
+ * @property status:
21998
22517
  *
21999
22518
  */
22000
- type SubscriptionChannel = "email" | "sms" | "push_notification" | "in_app" | "postal_mail" | "whatsapp";
22519
+ type SubscriptionStatusEntry = {
22520
+ channel: ChannelType;
22521
+ contactPointValue: string;
22522
+ status: ConsentStatus;
22523
+ } & {
22524
+ [key: string]: any;
22525
+ };
22001
22526
  /**
22002
22527
  * @type ConsentSubscription:
22003
22528
  *
@@ -22006,41 +22531,42 @@ declare namespace ShopperConsentsModelTypes {
22006
22531
  * - **Min Length:** 1
22007
22532
  * - **Max Length:** 255
22008
22533
  *
22009
- * @property consentId: Identifier for the shopper communication subscription consent -- formatted as `<contactPointValue>#<communicationSubscriptionChannelId>`
22010
- * - **Min Length:** 19
22011
- * - **Max Length:** 339
22012
- *
22013
- * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
22014
- * - **Min Length:** 3
22015
- * - **Max Length:** 320
22016
- *
22017
- * @property channel:
22534
+ * @property channels:
22018
22535
  *
22019
- * @property status:
22536
+ * @property consentStatus: Array of subscription status entries for different channels
22020
22537
  *
22021
- * @property title:
22538
+ * @property title: The localized title of the subscription for shopper displays
22022
22539
  * - **Min Length:** 1
22023
22540
  * - **Max Length:** 255
22024
22541
  *
22025
- * @property subtitle:
22542
+ * @property subtitle: The localized subtitle of the subscription for shopper displays, may contain HTML markup
22026
22543
  * - **Min Length:** 1
22027
- * - **Max Length:** 255
22544
+ * - **Max Length:** 2000
22028
22545
  *
22029
22546
  * @property tags:
22030
22547
  *
22548
+ * @property consentType: Type of consent subscription
22549
+ *
22550
+ * @property consentRequired: Whether this subscription is mandatory for the user
22551
+ *
22552
+ * @property defaultStatus: Default consent status for this subscription
22553
+ *
22031
22554
  */
22032
22555
  type ConsentSubscription = {
22033
22556
  subscriptionId: string;
22034
- consentId?: string;
22035
- contactPointValue?: string;
22036
- channel: SubscriptionChannel;
22037
- status?: ConsentStatus;
22557
+ channels: Set<ChannelType>;
22558
+ consentStatus?: Array<SubscriptionStatusEntry>;
22038
22559
  title?: string;
22039
22560
  subtitle?: string;
22040
22561
  tags?: Array<string>;
22562
+ consentType?: ConsentSubscriptionConsentTypeEnum;
22563
+ consentRequired?: boolean;
22564
+ defaultStatus?: ConsentSubscriptionDefaultStatusEnum;
22041
22565
  } & {
22042
22566
  [key: string]: any;
22043
22567
  };
22568
+ type ConsentSubscriptionConsentTypeEnum = "marketing" | "legal";
22569
+ type ConsentSubscriptionDefaultStatusEnum = "opt_in" | "opt_out";
22044
22570
  /**
22045
22571
  * @type ConsentSubscriptionRequest: Consent subscription update request
22046
22572
  *
@@ -22061,11 +22587,83 @@ declare namespace ShopperConsentsModelTypes {
22061
22587
  type ConsentSubscriptionRequest = {
22062
22588
  subscriptionId: string;
22063
22589
  contactPointValue: string;
22064
- channel: SubscriptionChannel;
22590
+ channel: ChannelType;
22065
22591
  status: ConsentStatus;
22066
22592
  } & {
22067
22593
  [key: string]: any;
22068
22594
  };
22595
+ /**
22596
+ * @type ConsentSubscriptionBulkRequest: Bulk request for updating multiple consent subscriptions
22597
+ *
22598
+ * @property subscriptions: Array of subscription consent updates to process
22599
+ *
22600
+ */
22601
+ type ConsentSubscriptionBulkRequest = {
22602
+ subscriptions: Array<ConsentSubscriptionRequest>;
22603
+ } & {
22604
+ [key: string]: any;
22605
+ };
22606
+ /**
22607
+ * @type ConsentSubscriptionError: Error details for failed subscription updates
22608
+ *
22609
+ * @property code: Error code indicating the type of failure
22610
+ * - **Max Length:** 100
22611
+ *
22612
+ * @property message: Human-readable error message
22613
+ * - **Max Length:** 500
22614
+ *
22615
+ * @property details: Additional error details
22616
+ *
22617
+ */
22618
+ type ConsentSubscriptionError = {
22619
+ code: string;
22620
+ message: string;
22621
+ details?: object;
22622
+ } & {
22623
+ [key: string]: any;
22624
+ };
22625
+ /**
22626
+ * @type ConsentSubscriptionResult: Individual subscription update result with input parameters
22627
+ *
22628
+ * @property subscriptionId: Identifier for the communication subscription
22629
+ * - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
22630
+ * - **Min Length:** 1
22631
+ * - **Max Length:** 255
22632
+ *
22633
+ * @property channel:
22634
+ *
22635
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
22636
+ * - **Min Length:** 3
22637
+ * - **Max Length:** 320
22638
+ *
22639
+ * @property status:
22640
+ *
22641
+ * @property success: Whether the subscription update was successful
22642
+ *
22643
+ * @property error:
22644
+ *
22645
+ */
22646
+ type ConsentSubscriptionResult = {
22647
+ subscriptionId: string;
22648
+ channel: ChannelType;
22649
+ contactPointValue: string;
22650
+ status: ConsentStatus;
22651
+ success: boolean;
22652
+ error?: ConsentSubscriptionError;
22653
+ } & {
22654
+ [key: string]: any;
22655
+ };
22656
+ /**
22657
+ * @type ConsentSubscriptionBulkResponse: Bulk response with results for each subscription update request
22658
+ *
22659
+ * @property results: Results for each subscription update request
22660
+ *
22661
+ */
22662
+ type ConsentSubscriptionBulkResponse = {
22663
+ results: Array<ConsentSubscriptionResult>;
22664
+ } & {
22665
+ [key: string]: any;
22666
+ };
22069
22667
  /**
22070
22668
  * @type ConsentSubscriptionResponse: Collection wrapper of consent subscriptions
22071
22669
  *
@@ -22077,6 +22675,31 @@ declare namespace ShopperConsentsModelTypes {
22077
22675
  } & {
22078
22676
  [key: string]: any;
22079
22677
  };
22678
+ /**
22679
+ * @type ConsentSubscriptionUpdateResponse: Single subscription update response
22680
+ *
22681
+ * @property subscriptionId: Identifier for the communication subscription
22682
+ * - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
22683
+ * - **Min Length:** 1
22684
+ * - **Max Length:** 255
22685
+ *
22686
+ * @property channel:
22687
+ *
22688
+ * @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
22689
+ * - **Min Length:** 3
22690
+ * - **Max Length:** 320
22691
+ *
22692
+ * @property status:
22693
+ *
22694
+ */
22695
+ type ConsentSubscriptionUpdateResponse = {
22696
+ subscriptionId: string;
22697
+ channel: ChannelType;
22698
+ contactPointValue: string;
22699
+ status: ConsentStatus;
22700
+ } & {
22701
+ [key: string]: any;
22702
+ };
22080
22703
  /**
22081
22704
  * A specialized value indicating the system default values for locales.
22082
22705
  */
@@ -22114,19 +22737,30 @@ declare namespace ShopperConsentsTypes {
22114
22737
  // API types
22115
22738
  type ShopperConsentsPathParameters = ShopperConsentsApiTypes.ShopperConsentsPathParameters;
22116
22739
  type ShopperConsentsQueryParameters = ShopperConsentsApiTypes.ShopperConsentsQueryParameters;
22740
+ type GetSubscriptionsExpandEnum = ShopperConsentsApiTypes.GetSubscriptionsExpandEnum;
22117
22741
  type getSubscriptionsQueryParameters = ShopperConsentsApiTypes.getSubscriptionsQueryParameters;
22118
22742
  type getSubscriptionsPathParameters = ShopperConsentsApiTypes.getSubscriptionsPathParameters;
22119
22743
  type updateSubscriptionQueryParameters = ShopperConsentsApiTypes.updateSubscriptionQueryParameters;
22120
22744
  type updateSubscriptionPathParameters = ShopperConsentsApiTypes.updateSubscriptionPathParameters;
22745
+ type updateSubscriptionsQueryParameters = ShopperConsentsApiTypes.updateSubscriptionsQueryParameters;
22746
+ type updateSubscriptionsPathParameters = ShopperConsentsApiTypes.updateSubscriptionsPathParameters;
22121
22747
  // Model types
22748
+ type ChannelType = ShopperConsentsModelTypes.ChannelType;
22122
22749
  type ConsentStatus = ShopperConsentsModelTypes.ConsentStatus;
22123
22750
  type ConsentSubscription = ShopperConsentsModelTypes.ConsentSubscription;
22751
+ type ConsentSubscriptionConsentTypeEnum = ShopperConsentsModelTypes.ConsentSubscriptionConsentTypeEnum;
22752
+ type ConsentSubscriptionDefaultStatusEnum = ShopperConsentsModelTypes.ConsentSubscriptionDefaultStatusEnum;
22753
+ type ConsentSubscriptionBulkRequest = ShopperConsentsModelTypes.ConsentSubscriptionBulkRequest;
22754
+ type ConsentSubscriptionBulkResponse = ShopperConsentsModelTypes.ConsentSubscriptionBulkResponse;
22755
+ type ConsentSubscriptionError = ShopperConsentsModelTypes.ConsentSubscriptionError;
22124
22756
  type ConsentSubscriptionRequest = ShopperConsentsModelTypes.ConsentSubscriptionRequest;
22125
22757
  type ConsentSubscriptionResponse = ShopperConsentsModelTypes.ConsentSubscriptionResponse;
22758
+ type ConsentSubscriptionResult = ShopperConsentsModelTypes.ConsentSubscriptionResult;
22759
+ type ConsentSubscriptionUpdateResponse = ShopperConsentsModelTypes.ConsentSubscriptionUpdateResponse;
22126
22760
  type DefaultFallback = ShopperConsentsModelTypes.DefaultFallback;
22127
22761
  type ErrorResponse = ShopperConsentsModelTypes.ErrorResponse;
22128
22762
  type LocaleCode = ShopperConsentsModelTypes.LocaleCode;
22129
- type SubscriptionChannel = ShopperConsentsModelTypes.SubscriptionChannel;
22763
+ type SubscriptionStatusEntry = ShopperConsentsModelTypes.SubscriptionStatusEntry;
22130
22764
  }
22131
22765
  /**
22132
22766
  * @type ShopperContextGeoLocation: The geographic location of the client. When you set a geolocation, it is saved as context for subsequent requests. This overrides any geolocation context previously saved using `clientIp`. This property is available with B2C Commerce version 24.7.