younifyd
Menu

Update Subscriptions

Update shopper subscription preferences

POST/organizations/{organizationId}/subscriptions/actions/bulk

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Update Subscriptions action (under Shopper Consents).
  3. Fill in the fields below, then reference the result from later steps as {{updateSubscriptions.response.data}}.

Request

Path parameters

organizationIdstringrequired

An identifier for the organization the request is being made by

Query parameters

siteIdstringrequired

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.

localeoneOf

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.

Request body

Enter the body as JSON in the step's Body field.

subscriptionsarray<object>required

Array of subscription consent updates to process

subscriptionIdstringrequired

Identifier for the communication subscription

contactPointValuestringrequired

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`

channelstringrequired

One ofemailsmswhatsapp

statusstringrequired

The consent status of the subscription as supplied or recorded by this system

One ofopt_inopt_out

json
{
  "subscriptions": [
    {
      "subscriptionId": "weekly-newsletter",
      "channel": "email",
      "contactPointValue": "john.doe@example.com",
      "status": "opt_in"
    },
    {
      "subscriptionId": "sms-alerts",
      "channel": "sms",
      "contactPointValue": "+1 555 123 4567",
      "status": "opt_out"
    }
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{updateSubscriptions.response.data.<field>}}.

resultsarray<object>

Results for each subscription update request

subscriptionIdstringrequired

Identifier for the communication subscription

channelstringrequired

One ofemailsmswhatsapp

contactPointValuestringrequired

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`

statusstringrequired

The consent status of the subscription as supplied or recorded by this system

One ofopt_inopt_out

successbooleanrequired

Whether the subscription update was successful

errorobject3 fields

Error details for failed subscription updates

json
{
  "results": [
    {
      "subscriptionId": "weekly-newsletter",
      "channel": "email",
      "contactPointValue": "jack.sparrow@salesforce.com",
      "status": "opt_in",
      "success": true,
      "error": {
        "code": "INVALID_CONTACT_POINT",
        "message": "Invalid email address format",
        "details": {
          "field": "contactPointValue",
          "provided": "invalid-email"
        }
      }
    }
  ]
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.