Loading...
Loading...
Manage SLAS (Shopper Login and API Access Service) clients for B2C Commerce (SFCC/Demandware) with the b2c cli. Use when configuring shopper authentication, creating API clients for PWA/headless, managing OAuth scopes (including custom scopes like c_loyalty), or debugging token issues. SLAS is for shopper (customer) authentication, not admin APIs.
npx skill4agent add salesforcecommercecloud/b2c-developer-tooling b2c-slasb2cImportant: SLAS is for shopper (customer) authentication used by storefronts and headless commerce. For admin tokens (OCAPI, Admin APIs), use- see b2c-config skill.b2c auth token
Tip: Ifis not installed globally, useb2cinstead (e.g.,npx @salesforce/b2c-cli).npx @salesforce/b2c-cli slas client list
c_loyalty# list all SLAS clients for a tenant
b2c slas client list --tenant-id abcd_123
# list with JSON output
b2c slas client list --tenant-id abcd_123 --json# get details for a specific SLAS client
b2c slas client get --tenant-id abcd_123 --client-id my-client-id# create a new SLAS client with default scopes (auto-generates UUID client ID)
b2c slas client create --tenant-id abcd_123 --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback
# create with a specific client ID and custom scopes
b2c slas client create my-client-id --tenant-id abcd_123 --channels RefArch --scopes sfcc.shopper-products,sfcc.shopper-search --redirect-uri http://localhost:3000/callback
# create a public client
b2c slas client create --tenant-id abcd_123 --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --public
# create client without auto-creating tenant (if you manage tenants separately)
b2c slas client create --tenant-id abcd_123 --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --no-create-tenant
# output as JSON (useful for capturing the generated secret)
b2c slas client create --tenant-id abcd_123 --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --json--scopes--auth-scope--auth-scope# Create a private client with custom scope for testing
# Replace c_my_scope with your API's custom scope from schema.yaml
b2c slas client create \
--tenant-id zzpq_013 \
--channels RefArch \
--default-scopes \
--scopes "c_my_scope" \
--redirect-uri http://localhost:3000/callback \
--json
# Output includes client_id and client_secret - save these for token requestsschema.yaml# Set credentials from client creation output
# Find your shortcode in Business Manager: Administration > Site Development > Salesforce Commerce API Settings
SHORTCODE="kv7kzm78" # Example shortcode - yours will be different
ORG="f_ecom_zzpq_013"
CLIENT_ID="your-client-id"
CLIENT_SECRET="your-client-secret"
SITE="RefArch"
# Get access token
curl -s "https://$SHORTCODE.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/$ORG/oauth2/token" \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d "grant_type=client_credentials&channel_id=$SITE"# update an existing SLAS client
b2c slas client update --tenant-id abcd_123 --client-id my-client-id# delete a SLAS client
b2c slas client delete --tenant-id abcd_123 --client-id my-client-idSFCC_TENANT_IDb2c slas --helpslasb2c:b2c-custom-api-developmentb2c-cli:b2c-scapi-custom