Consents

GET Get all subscriptions

GET /organizations/{organizationId}/subscriptions

Operation ID: getSubscriptions. Security: AmOAuth2 (sfcc.consents).

Retrieve all current subscriptions for the specified organization and site.

Parameters

  • organizationId (path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.

    Example

    f_ecom_zzxy_prd
  • siteId (query, SiteId, required) 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.

    Example: SiteId

    RefArch

Responses

  • 200 Successfully retrieved subscriptions.

    Media type: application/json. Schema: SubscriptionsResponse.

    Example: GetSubscriptionsResponse Example response for getting all subscriptions for a specific site (RefArch)

    {
      "data": [
        {
          "subscriptionId": "weekly-newsletter",
          "siteId": "RefArch",
          "title": {
            "default": {
              "markup": "Weekly <strong>Newsletter</strong>",
              "source": "Weekly <strong>Newsletter</strong>"
            },
            "fr-FR": {
              "markup": "Bulletin <strong>Hebdomadaire</strong>",
              "source": "Bulletin <strong>Hebdomadaire</strong>"
            }
          },
          "subtitle": {
            "default": {
              "markup": "Get our weekly newsletter with the latest updates - <a href=\"https://example.com\">Subscribe</a>",
              "source": "Get our weekly newsletter with the latest updates - <a href=\"https://example.com\">Subscribe</a>"
            },
            "fr-FR": {
              "markup": "Recevez notre bulletin hebdomadaire avec les dernières mises à jour - <a href=\"https://example.com\">S&rsquo;abonner</a>",
              "source": "Recevez notre bulletin hebdomadaire avec les dernières mises à jour - <a href=\"https://example.com\">S&rsquo;abonner</a>"
            }
          },
          "tags": [
            "homepage_banner",
            "user_profile"
          ],
          "channels": [
            "email",
            "whatsapp"
          ],
          "umaSubscriptionId": "0Xl000000000000000",
          "consentType": "marketing",
          "consentRequired": false,
          "defaultStatus": "opt_out",
          "enabled": true
        },
        {
          "subscriptionId": "promotional-offers",
          "siteId": "RefArch",
          "title": {
            "default": {
              "markup": "Promotional <em>Offers</em>",
              "source": "Promotional <em>Offers</em>"
            },
            "fr-FR": {
              "markup": "Offres <em>Promotionnelles</em>",
              "source": "Offres <em>Promotionnelles</em>"
            }
          },
          "subtitle": {
            "default": {
              "markup": "Receive special promotional offers - <a href=\"https://example.com/offers\">View Offers</a>",
              "source": "Receive special promotional offers - <a href=\"https://example.com/offers\">View Offers</a>"
            },
            "fr-FR": {
              "markup": "Recevez des offres promotionnelles spéciales - <a href=\"https://example.com/offers\">Voir les offres</a>",
              "source": "Recevez des offres promotionnelles spéciales - <a href=\"https://example.com/offers\">Voir les offres</a>"
            }
          },
          "tags": [
            "checkout"
          ],
          "channels": [
            "sms",
            "email"
          ],
          "umaSubscriptionId": "0Xl000000000000001",
          "consentType": "legal",
          "consentRequired": true,
          "defaultStatus": "opt_in",
          "enabled": true
        }
      ]
    }
  • 400

    Possible reasons:

    • The Marketing Consent feature is not enabled for this organization.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: ConsentsFeatureNotEnabled

    {
      "title": "Consents Feature Not Enabled",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/consents-feature-not-enabled",
      "detail": "The Marketing Consents feature is not enabled for this organization."
    }