| name | b2c-slas |
| description | Manage SLAS (Shopper Login and API Access Service) clients. Use when configuring shopper authentication, creating API clients for PWA/headless, managing OAuth scopes (including custom scopes like c_loyalty), or debugging token issues. |
B2C SLAS Skill
Use the b2c CLI plugin to manage SLAS (Shopper Login and API Access Service) API clients and credentials.
When to Use
Common scenarios requiring SLAS client management:
- Testing Custom APIs: Create a client with custom scopes (e.g.,
c_loyalty) to test your Custom API endpoints
- PWA/Headless Development: Configure clients for composable storefronts
- Integration Testing: Create dedicated test clients with specific scope sets
Examples
List SLAS Clients
b2c slas client list --tenant-id abcd_123
b2c slas client list --tenant-id abcd_123 --json
Get SLAS Client Details
b2c slas client get --tenant-id abcd_123 --client-id my-client-id
Create SLAS Client
b2c slas client create --tenant-id abcd_123 --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback
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
b2c slas client create --tenant-id abcd_123 --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --public
b2c slas client create --tenant-id abcd_123 --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --no-create-tenant
b2c slas client create --tenant-id abcd_123 --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --json
Note: By default, the tenant is automatically created if it doesn't exist.
Warning: Use --scopes (plural) for client scopes, NOT --scope (singular). The --scope flag is a global authentication option and will cause errors if used here.
Create Client for Custom API Testing
When testing a Custom API that requires custom scopes:
b2c slas client create \
--tenant-id zzpq_013 \
--channels RefArch \
--default-scopes \
--scopes "c_my_scope" \
--redirect-uri http://localhost:3000/callback \
--json
Important: The custom scope in your SLAS client must match the scope defined in your Custom API's schema.yaml security section.
Get a Token for Testing
After creating a SLAS client, obtain a token for API testing:
SHORTCODE="kv7kzm78"
ORG="f_ecom_zzpq_013"
CLIENT_ID="your-client-id"
CLIENT_SECRET="your-client-secret"
SITE="RefArch"
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 SLAS Client
b2c slas client update --tenant-id abcd_123 --client-id my-client-id
Delete SLAS Client
b2c slas client delete --tenant-id abcd_123 --client-id my-client-id
Configuration
The tenant ID can be set via environment variable:
SFCC_TENANT_ID: SLAS tenant ID (organization ID)
More Commands
See b2c slas --help for a full list of available commands and options in the slas topic.
Related Skills
b2c:b2c-custom-api-development - Creating Custom APIs that require SLAS authentication
b2c-cli:b2c-scapi-custom - Checking Custom API registration status