Salesforce Commerce Buyer Messaging Consent API

GET getConsentSubscription

GET /commerce/webstores/${webstoreId}/consents/subscriptions?experience=${experience}&userContext=${userContext}

Operation ID: getConsentSubscription.

Retrieves communication subscriptions with consent values for a specific webstore. When userContext is true, consent values are retrieved for the contact's email address.

Retrieves communication subscriptions with consent values for a specific webstore. When userContext is true, consent values are retrieved for the contact's email address.

Parameters

  • webstoreId (path, string, required) Id of the webstore.
    Example: 0ZExx000000004DGAQ.
  • experience (query, string) UI experience used to capture the buyer's consent (EmailCaptureComponent or ProfileAndRegistration).
    Example: Checkout.
  • userContext (query, boolean) Indicates if the contact point value should be obtained from the user context.
    Example: false.

Responses

  • 200 Successfully captured consent for the webstore or contact point value.

    Media type: application/json. Schema: ConsentSubscriptionRepresentation.

    Example: Success

    {
      "contactPointValue": "josh@gmail.com",
      "webStoreId": "0ZExx00000001k5GAA",
      "experience": "EmailCaptureComponent",
      "isSuccess": true,
      "error": {},
      "communicationSubscriptions": [
        {
          "name": "PromotionSubscription",
          "title": "Promotion subscription",
          "description": "Consent for receiving promotional emails.",
          "commSubscriptionId": "0XlSB000000Fc9p0AC",
          "commSubscriptionChannelTypeId": "0XlSB000000Fc9p0AC",
          "consentExperience": "Checkout",
          "consentType": "Email",
          "consentStatus": "opt-in"
        },
        {
          "name": "TravelRelatedContent",
          "title": "Travel subscription",
          "description": "Consent for receiving travel-related emails.",
          "commSubscriptionId": "0XlSB000000Fc9p0AC",
          "commSubscriptionChannelTypeId": "0XlSB000000Fc9p0AC",
          "consentExperience": "Marketing",
          "consentType": "Email",
          "consentStatus": "opt-in"
        }
      ]
    }
  • 400 Bad request with invalid webstoreId.

    Media type: application/json. Schema: ConsentSubscriptionRepresentation.

    Example: Success

    {
      "isSuccess": false,
      "error": {
        "errorCode": "INVALID_INPUT",
        "errorMsg": "Invalid webstoreId."
      },
      "communicationSubscriptions": {}
    }
  • 404 Communication subscriptions not found for WebstoreId.

    Media type: application/json. Schema: ConsentSubscriptionRepresentation.

    Example: Success

    {
      "isSuccess": false,
      "error": {
        "errorCode": "NOT_FOUND",
        "errorMsg": "Communication Subscriptions not found."
      },
      "communicationSubscriptions": {}
    }
  • 500 Bad request.

    Media type: application/json. Schema: ConsentSubscriptionRepresentation.

    Example: Success

    {
      "isSuccess": false,
      "error": {
        "errorCode": "INTERNAL_SERVER_ERROR",
        "errorMsg": "Couldn't process request."
      },
      "communicationSubscriptions": {}
    }