Install AI Tools

B2C Commerce tools, documentation, and skills for your assistant.

Claude

Install the plugin Recommended

bash
claude plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
claude plugin install b2c-dx-mcp@b2c-developer-tooling

Start a new Claude Code session. To install for the current project only, run it from your project directory with --scope project.

Manual MCP setup
bash
claude mcp add --transport stdio --scope user b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new session. To configure the current project only, run it from your project directory with --scope project. See Claude Code MCP setup.

Claude Desktop setup

Codex

Install the plugin Recommended

bash
codex plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
codex plugin add b2c-dx-mcp@b2c-developer-tooling

Start a new Codex session in your project. This setup also works with the Codex IDE extension and the ChatGPT Work desktop app.

Manual MCP setup
bash
codex mcp add b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Or add this to ~/.codex/config.toml (or $CODEX_HOME/config.toml if customized):

toml
[mcp_servers.b2c-dx-mcp]
command = "npx"
args = ["-y", "@salesforce/b2c-dx-mcp@latest"]

Start a new session. See Codex MCP configuration.

ChatGPT online setup

VS Code

Install the plugin Recommended

  1. Open the Command Palette (Cmd/Ctrl+Shift+P) and run Chat: Install Plugin from Source.
  2. Enter SalesforceCommerceCloud/b2c-developer-tooling.
  3. Select b2c-dx-mcp and follow the installation prompts.
  4. Start a new chat in GitHub Copilot.
Manual MCP setup

Add this to .vscode/mcp.json in your workspace:

json
{
  "servers": {
    "b2c-dx-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

See VS Code MCP setup.

Copilot CLI setup

Cursor

Reload the MCP server in Cursor after installation.

Manual MCP setup

Add this to .cursor/mcp.json in your project:

json
{
  "mcpServers": {
    "b2c-dx-mcp": {
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

For all projects, use ~/.cursor/mcp.json instead.

See Cursor's MCP documentation.

OpenCode

Add this to opencode.json in your project:

json
{
  "mcp": {
    "b2c-dx-mcp": {
      "type": "local",
      "command": ["npx", "-y", "@salesforce/b2c-dx-mcp@latest"],
      "enabled": true
    }
  }
}

Restart OpenCode. For all projects, use ~/.config/opencode/opencode.json. See OpenCode MCP setup.

Gemini

Run:

bash
gemini mcp add --scope user b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new Gemini CLI session. To configure the current project only, run it from your project directory with --scope project. See Gemini CLI MCP setup.

No separate skills plugins needed.

Other clients and manual setup →
Skip to content
View as Markdown
View as Markdown

SCAPI Schemas ​

Commands for browsing and retrieving SCAPI (Salesforce Commerce API) schema specifications.

Global SCAPI Schemas Flags ​

These flags are available on all SCAPI Schemas commands.

Tenant Flags ​

FlagEnvironment VariableDescription
--tenant-idSFCC_TENANT_ID(Required) Organization/tenant ID
--short-codeSFCC_SHORTCODESCAPI short code

Authentication Flags ​

FlagEnvironment VariableDescription
--client-idSFCC_CLIENT_IDClient ID for OAuth
--client-secretSFCC_CLIENT_SECRETClient Secret for OAuth
--auth-scopeSFCC_OAUTH_SCOPESOAuth scopes to request (comma-separated, repeatable)
--auth-methodsSFCC_AUTH_METHODSAllowed auth methods in priority order (client-credentials, jwt, user, implicit, basic, api-key)
--user-authUse browser-based user authentication (Authorization Code + PKCE flow)
--account-manager-hostSFCC_ACCOUNT_MANAGER_HOSTAccount Manager hostname for OAuth (default: account.demandware.com)
--jwt-certSFCC_JWT_CERTPath to JWT certificate file (cert.pem) for JWT Bearer authentication
--jwt-keySFCC_JWT_KEYPath to JWT private key file (key.pem) for JWT Bearer authentication
--jwt-passphraseSFCC_JWT_PASSPHRASEPassphrase for encrypted JWT private key

Common Flags ​

FlagEnvironment VariableDescription
--configSFCC_CONFIGPath to config file (in dw.json format; defaults to ./dw.json; empty for none)
-i, --instanceSFCC_INSTANCEInstance name from configuration file (e.g. dw.json)
--project-directorySFCC_PROJECT_DIRECTORYProject directory
-L, --langLanguage for messages (e.g., en, de). Also respects LANGUAGE env var
--log-levelSFCC_LOG_LEVELSet logging verbosity (trace, debug, info, warn, error, silent)
-D, --debugSFCC_DEBUGEnable debug logging (shorthand for --log-level debug)
--extra-querySFCC_EXTRA_QUERYExtra query parameters as JSON (e.g., '{"debug":"true"}')
--extra-bodySFCC_EXTRA_BODYExtra body fields to merge as JSON (e.g., '{"_internal":true}')
--extra-headersSFCC_EXTRA_HEADERSExtra HTTP headers as JSON (e.g., '{"X-Custom-Header": "value"}')

Output Flags ​

FlagEnvironment VariableDescription
--jsonOutput result as JSON
--jsonlSFCC_JSON_LOGSOutput log messages as JSON lines

Authentication ​

SCAPI Schemas commands require an Account Manager API Client with OAuth credentials.

Required Scopes ​

The following scopes are automatically requested by the CLI:

ScopeDescription
sfcc.scapi-schemasAccess to SCAPI Schemas API
SALESFORCE_COMMERCE_API:<tenant_id>Tenant-specific access scope

Configuration ​

bash
# Set credentials via environment variables
export SFCC_CLIENT_ID=my-client
export SFCC_CLIENT_SECRET=my-secret
export SFCC_TENANT_ID=zzxy_prd
export SFCC_SHORTCODE=kv7kzm78

# Or provide via flags
b2c scapi schemas list --client-id xxx --client-secret xxx --tenant-id zzxy_prd

For complete setup instructions, see the Authentication Guide.


b2c scapi schemas list ​

List available SCAPI schemas with optional filtering.

B2C CLI listing checkout API schemas, with Shopper Baskets v2 current and v1 deprecated.

Usage ​

bash
b2c scapi schemas list --tenant-id <TENANT_ID>

Flags ​

FlagDescriptionDefault
--tenant-id(Required) Organization/tenant ID
--api-familyFilter by API family (e.g., product, checkout, search)
--api-nameFilter by API name (e.g., shopper-products, shopper-baskets)
--api-versionFilter by API version (e.g., v1)
--status, -sFilter by schema status (current, deprecated)
--columns, -cColumns to display (comma-separated)
--extended, -xShow all columns including extended fieldsfalse
--jsonOutput results as JSONfalse

Available Columns ​

Default columns: apiFamily, apiName, apiVersion, status

Extended columns (shown with --extended): schemaVersion, link

Examples ​

bash
# List all available SCAPI schemas
b2c scapi schemas list --tenant-id zzxy_prd

# Filter by API family
b2c scapi schemas list --tenant-id zzxy_prd --api-family product

# Filter by API name
b2c scapi schemas list --tenant-id zzxy_prd --api-name shopper-products

# Filter by status
b2c scapi schemas list --tenant-id zzxy_prd --status current
b2c scapi schemas list --tenant-id zzxy_prd --status deprecated

# Show extended columns
b2c scapi schemas list --tenant-id zzxy_prd --extended

# Output as JSON
b2c scapi schemas list --tenant-id zzxy_prd --json

Output ​

Default table output:

Found 15 schema(s):

API Family  API Name          Version  Status
───────────────────────────────────────────────
product     shopper-products  v1       current
checkout    shopper-baskets   v2       current
search      shopper-search    v1       current
customer    shopper-customers v1       current
...

b2c scapi schemas get ​

Get a specific SCAPI schema with optional selective expansion.

Usage ​

bash
b2c scapi schemas get <apiFamily> <apiName> <apiVersion> --tenant-id <TENANT_ID>

Arguments ​

ArgumentDescription
apiFamilyAPI family (e.g., product, checkout, search)
apiNameAPI name (e.g., shopper-products, shopper-baskets)
apiVersionAPI version (e.g., v1)

Flags ​

FlagDescriptionDefault
--tenant-id(Required) Organization/tenant ID
--expand-pathsPaths to fully expand (comma-separated)
--expand-schemasSchema names to fully expand (comma-separated)
--expand-examplesExample names to fully expand (comma-separated)
--expand-custom-propertiesExpand custom properties (boolean — use --no-expand-custom-properties to disable)true
--includeSections the Schemas API adds to the contract, comma-separated: all, custom_properties, descriptions, examples, external_docs, summaries, tags, titles. Overrides the automatic selection
--expand-allReturn full schema without collapsing (also requests every section from the API)false
--list-pathsList available paths and exitfalse
--list-schemasList available schema names and exitfalse
--list-examplesList available example names and exitfalse
--yamlOutput as YAML instead of JSONfalse
--jsonOutput wrapped JSON with metadatafalse

Server-side expansion ​

The Schemas API omits operation summaries and descriptions, examples, and tenant custom properties unless you ask for them with its expand parameter. The command asks for only what the output needs, so outlines stay small:

RequestSections fetched
Collapsed outline, --list-paths, --list-schemascustom_properties (none with --no-expand-custom-properties)
--expand-paths or --expand-schemassummaries, descriptions, titles
--expand-examples or --list-examplesexamples
--expand-allall (everything, including external_docs and tags)

Use --include to choose the sections yourself, for example --include summaries,descriptions or --include all. Several values are sent as one comma-separated value; ; also works as a separator.

Offline fallback ​

If the live fetch fails (missing short code, tenant, or credentials, no access to sfcc.scapi-schemas, or a network error), the command prints a warning on stderr and returns the contract bundled with the CLI instead. The bundled corpus holds the standard SCAPI contracts only: no tenant custom properties or custom APIs, and it may be older than your tenant. list falls back the same way. With --json the output has source (live or bundled) and, when bundled, a warning.

Schema Collapsing ​

By default, schemas are output in a collapsed/outline format optimized for context efficiency (ideal for agentic use cases and LLM consumption):

  • Paths: Show only HTTP methods available: {"/products": ["get"], "/products/{id}": ["get"]}
  • Schemas: Show only schema names: {"Product": {}, "ProductResult": {}}
  • Examples: Show only example names: {"product-example": {}}

Use the --expand-* flags for selective expansion or --expand-all for the full, unmodified schema.

Examples ​

bash
# Get collapsed/outline schema (default - context efficient)
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd

# Get full schema without collapsing
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-all

# Expand specific paths only
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products,/products/{productId}

# Expand specific schemas only
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-schemas Product,ProductResult

# Expand specific examples only
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-examples product-example

# Combine selective expansions
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products --expand-schemas Product

# List available paths in the schema
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-paths

# List available schema names
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-schemas

# List available examples
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-examples

# Output as YAML
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --yaml

# Output wrapped JSON with metadata
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --json

# Disable custom properties expansion
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --no-expand-custom-properties

Output Formats ​

Default (raw JSON to stdout): The schema is output directly to stdout as JSON. Use shell redirection to save to a file:

bash
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd > schema.json

YAML format (--yaml): Output as YAML for readability:

bash
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --yaml > schema.yaml

Wrapped JSON (--json): Output includes metadata wrapper:

json
{
  "apiFamily": "product",
  "apiName": "shopper-products",
  "apiVersion": "v1",
  "source": "live",
  "expand": "custom_properties",
  "schema": { ... }
}

Notes ​

  • The collapsed output significantly reduces context size while preserving structure, making it ideal for AI/LLM consumption
  • Use --list-paths to discover available paths before using --expand-paths
  • Use --list-schemas to discover available schema names before using --expand-schemas
  • Custom properties expansion is enabled by default and fetches tenant-specific custom attributes
  • Operation summaries and descriptions are only returned when requested (--expand-paths, --expand-all, or --include)