Skip to content

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:

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

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.

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 propertiestrue
--no-expand-custom-propertiesDo not expand custom properties
--expand-allReturn full schema without collapsingfalse
--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

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",
  "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

Released under the Apache-2.0 License.