# Class MarketingConsentSubscription

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [dw.customer.consent.MarketingConsentSubscription](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md)

Represents a marketing consent subscription for a shopper.

A marketing consent subscription defines a communication preference category (e.g., "Newsletter", "Product Updates")
with associated channels (EMAIL, SMS, WHATSAPP) through which the shopper can receive marketing communications.

Example usage:

```

var subscriptions = dw.customer.consent.ShopperConsentMgr.getSubscriptions();
for each (var sub in subscriptions) {
    trace('Subscription: ' + sub.subscriptionId + ' - ' + sub.title);
    trace('Channels: ' + sub.channels);
}
```

## Property Summary

| Property                                                                                                                                 | Description                                                |
| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [channels](#channels): [String\[\]](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`              | Returns the available channels for this subscription.      |
| [consentRequired](#consentrequired): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`  | Returns whether consent is required for this subscription. |
| [consentStatus](#consentstatus): [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md) `(read-only)` | Returns the consent status entries for this subscription.  |
| [consentType](#consenttype): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`            | Returns the consent type for this subscription.            |
| [defaultStatus](#defaultstatus): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`        | Returns the default consent status for this subscription.  |
| [subscriptionId](#subscriptionid): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`      | Returns the unique identifier for this subscription.       |
| [subtitle](#subtitle): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                  | Returns the localized subtitle of this subscription.       |
| [tags](#tags): [String\[\]](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                      | Returns the tags associated with this subscription.        |
| [title](#title): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                        | Returns the localized title of this subscription.          |

## Constructor Summary

This class does not have a constructor, so you cannot create it directly.

## Method Summary

| Method                                                                                                                                               | Description                                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [getChannels](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#getchannels)()               | Returns the available channels for this subscription.      |
| [getConsentRequired](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#getconsentrequired)() | Returns whether consent is required for this subscription. |
| [getConsentStatus](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#getconsentstatus)()     | Returns the consent status entries for this subscription.  |
| [getConsentType](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#getconsenttype)()         | Returns the consent type for this subscription.            |
| [getDefaultStatus](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#getdefaultstatus)()     | Returns the default consent status for this subscription.  |
| [getSubscriptionId](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#getsubscriptionid)()   | Returns the unique identifier for this subscription.       |
| [getSubtitle](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#getsubtitle)()               | Returns the localized subtitle of this subscription.       |
| [getTags](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#gettags)()                       | Returns the tags associated with this subscription.        |
| [getTitle](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.consent.MarketingConsentSubscription.md#gettitle)()                     | Returns the localized title of this subscription.          |

### Methods inherited from class Object

[assign](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#assignobject-object), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject-object), [defineProperties](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertiesobject-object), [defineProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertyobject-object-object), [entries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#entriesobject), [freeze](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#freezeobject), [fromEntries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#hasownpropertystring), [is](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isobject-object), [isExtensible](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isextensibleobject), [isFrozen](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isfrozenobject), [isPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isprototypeofobject), [isSealed](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#issealedobject), [keys](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#keysobject), [preventExtensions](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#propertyisenumerablestring), [seal](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#sealobject), [setPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tolocalestring), [toString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tostring), [valueOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valueof), [values](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valuesobject)

## Property Details

### channels

- channels: [String\[\]](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the available channels for this subscription.

    Channels represent the communication methods (EMAIL, SMS, WHATSAPP) available for this subscription.

***

### consentRequired

- consentRequired: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`
  - : Returns whether consent is required for this subscription.

***

### consentStatus

- consentStatus: [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md) `(read-only)`
  - : Returns the consent status entries for this subscription.

    This is only populated when the 'includeConsentStatus' parameter is true in the getSubscriptions call, and the
    customer is authenticated.

***

### consentType

- consentType: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the consent type for this subscription.

***

### defaultStatus

- defaultStatus: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the default consent status for this subscription.

***

### subscriptionId

- subscriptionId: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the unique identifier for this subscription.

***

### subtitle

- subtitle: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the localized subtitle of this subscription.

***

### tags

- tags: [String\[\]](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the tags associated with this subscription.

    Tags can be used to categorize and filter subscriptions.

***

### title

- title: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the localized title of this subscription.

***

## Method Details

### getChannels()

- getChannels(): [String\[\]](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the available channels for this subscription.

    Channels represent the communication methods (EMAIL, SMS, WHATSAPP) available for this subscription.

    **Returns:**

    - A list of channel strings (lowercase).

***

### getConsentRequired()

- getConsentRequired(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns whether consent is required for this subscription.

    **Returns:**

    - True if consent is required, false otherwise.

***

### getConsentStatus()

- getConsentStatus(): [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md)
  - : Returns the consent status entries for this subscription.

    This is only populated when the 'includeConsentStatus' parameter is true in the getSubscriptions call, and the
    customer is authenticated.

    **Returns:**

    - A collection of ConsentStatusEntry objects, or null if not requested.

***

### getConsentType()

- getConsentType(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the consent type for this subscription.

    **Returns:**

    - The consent type (e.g., "SINGLE_OPT_IN", "DOUBLE_OPT_IN").

***

### getDefaultStatus()

- getDefaultStatus(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the default consent status for this subscription.

    **Returns:**

    - The default status (e.g., "OPT_IN", "OPT_OUT").

***

### getSubscriptionId()

- getSubscriptionId(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the unique identifier for this subscription.

    **Returns:**

    - The subscription ID.

***

### getSubtitle()

- getSubtitle(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the localized subtitle of this subscription.

    **Returns:**

    - The subscription subtitle.

***

### getTags()

- getTags(): [String\[\]](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the tags associated with this subscription.

    Tags can be used to categorize and filter subscriptions.

    **Returns:**

    - A list of tag strings.

***

### getTitle()

- getTitle(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the localized title of this subscription.

    **Returns:**

    - The subscription title.

***
