Passwordless Login with SMS

Learn how to use Marketing Cloud’s SMS capabilities to send verification codes for authenticating shoppers with the passwordless login feature of the Shopper Login and API Access Service (SLAS).

To complete the instructions in this guide, you must have:

  • An active Commerce Cloud license.
  • An active Marketing Cloud license with an SMS subscription.
  • Admin access for your Marketing Cloud instance with permission to install apps.
  • An SMS country code and short code for your Marketing Cloud instance.
  • An installation link for the B2C Commerce-Marketing Cloud SMS Integration package.

👉 To provision an SMS short code, contact your Marketing Cloud account representative.

👉 To get the installation link for the integration package, reach out to your Salesforce contact.

  • A shopper must log in via SLAS at least once before requesting a passwordless login.
  • The shopper’s phone number must be registered with B2C Commerce.
  • Sending SMS message for passwordless login counts towards your overall volume.

The B2C Commerce-Marketing Cloud SMS Integration package enables SLAS to integrate with Marketing Cloud’s SMS messaging functionality.

To install the package:

  1. Log in to your Marketing Cloud instance with your admin credentials.
  2. Click the installation link provided by your Salesforce contact.
  3. Click Install and agree to the terms and conditions.

Upon successful installation, you are taken to the package details page and a confirmation message is displayed.

To return to the package details page at any time:

  1. From Setup, in the Quick Find box, enter Installed Packages, and then select Installed Packages.
  2. Click B2C Commerce-Marketing Cloud SMS Integration.

After installing the package in your Marketing Cloud instance, you can use SLAS Admin UI to link a SLAS tenant with your Marketing Cloud account.

If you’re not already familiar with how to access SLAS Admin UI and create tenants, see Authorization for Shopper APIs.

To link a SLAS tenant with Marketing Cloud:

  1. Log in to SLAS Admin UI.
  2. Go to Integrations > Marketing Cloud Integrations.
  3. Click Add MC Integration.
  4. Choose a SLAS tenant that is set up for passwordless login.
  5. Click Link to MC.
  6. Enter your Marketing Cloud credentials.

Your SLAS tenant is now linked to your Marketing Cloud account!

In SLAS Admin UI, you can add an SMS definition from Integrations > Marketing Cloud Integrations. (You are already there if you’re continuing the instructions from the previous section.)

To add an SMS definition to your integration:

  1. Click Add SMS Definition.

  2. Enter the short code and country code provisioned in your Marketing Cloud instance.

    • Short code example: 123456
    • Country code example: US
  3. Click Submit.

Now you’re ready to start sending some verification codes via SMS!

Don’t delete the SMS keyword that is used for passwordless SMS notification in your Marketing Cloud Instance. The SMS keyword uses the following format: cc_<shortcode>_<countrycode>_<memberId>. Example SMS keyword: cc_12345_us_8976845.

To form requests to the SLAS Admin and SLAS APIs correctly, it helps to set some environment variables first:

VariableExample ValueDescription
$SFCC_SCAPI_SHORTCODEkv7kzm78Short code for your B2C Commerce instance, not the short code that is provisioned for Marketing Cloud SMS
$SFCC_SCAPI_TENANTIDzzte_053Tenant ID for your B2C Commerce instance
$ORGANIZATION_IDabcd_s01Organization ID for your B2C Commerce instance
$CHANNEL_IDSiteGenesisSite name (also known as channel name) in Business Manager
$CALLBACK_URIhttps://webhook.site/9f44093b-d129-42be-84d3-2f17254df04bURI for redirection after authorization
$CLIENT_ID872daaa2-412e-40c8-a48a-5a56daaef868The SLAS client ID
$USER_IDpia.larsonThe user ID for logging in the shopper
$SFCC_ACCESS_TOKEN(not provided for security reasons)Access token from SLAS Admin UI
$ACCESS_TOKEN(not provided for security reasons)Access token from SLAS

If you’re not using a Unix-based operating system, you can manually replace the variables later in the curl command provided.

The following sample request uses the environment variables set earlier and the passwordless-templates endpoint of the SLAS Admin API (not the same as the SLAS API) to create an SMS template for sending verification codes:

For more details on making API requests for shopper authorization, see the Passwordless Login guide and the SLAS Admin API reference.

The following sample request uses the environment variables set earlier and the authorizePasswordlessCustomer endpoint of the SLAS API (not the same as the SLAS Admin API) to authorize a customer via SMS:

For more details on making API requests for shopper authorization, see the Passwordless Login guide and the SLAS API reference.

Here are some common issues with passwordless login via SMS and how to resolve them.

When installing the B2C Commerce-Marketing Cloud SMS Integration package, you get the following error message: “You do not have the required permissions to access Package Manager.”

Ensure that the account you are using has admin access for your Marketing Cloud instance with permission to install apps.

When you try to add the Marketing Cloud integration in SLAS Admin UI, you get the following error message: “Unauthorized - Unable to complete request because the app is not installed into this account or the user is not licensed for this package.”

An admin user must install the integration package in the Marketing Cloud instance before adding the integration in SLAS Admin UI.

When using the authorizePasswordlessCustomer endpoint, you get an error response like this:

Ensure that the SMS definition is set up in SLAS Admin UI for the right tenant with the correct short code and country code.

The SMS message isn’t delivered.

Delivery can fail for a number of reasons, including: invalid number, unreachable number, blocked number, incorrect short code, and incorrect country code.

If you can’t determine the reason, contact Salesforce Customer Support.