B2C SCAPI Schemas Skill
B2C SCAPI Schemas Skill
Use the
CLI plugin to browse and retrieve SCAPI OpenAPI schema specifications.
Tip: If
is not installed globally, use
instead (e.g.,
npx @salesforce/b2c-cli scapi schemas list
).
使用
CLI插件来浏览和获取SCAPI OpenAPI schema规范。
提示: 如果没有全局安装
,请改用
(例如
npx @salesforce/b2c-cli scapi schemas list
)。
Required: Tenant ID
必备项:租户ID(Tenant ID)
The
flag is
required for all commands. The tenant ID identifies your B2C Commerce instance.
Important: The tenant ID is NOT the same as the organization ID:
- Tenant ID: (used with commands that require )
- Organization ID: (used in SCAPI URLs, has prefix)
所有命令都
必须带
参数。租户ID用于标识你的B2C Commerce实例。
重要提示: 租户ID和组织ID(Organization ID)并不相同:
- 租户ID:(用于需要参数的命令)
- 组织ID:(用于SCAPI URL中,带有前缀)
Deriving Tenant ID from Hostname
从主机名推导租户ID
For sandbox instances, you can derive the tenant ID from the hostname by replacing hyphens with underscores:
| Hostname | Tenant ID |
|---|
zzpq-013.dx.commercecloud.salesforce.com
| |
zzxy-001.dx.commercecloud.salesforce.com
| |
abcd-dev.dx.commercecloud.salesforce.com
| |
For production instances, use your realm and instance identifier (e.g.,
).
对于沙箱实例,你可以将主机名中的连字符替换为下划线,即可得到租户ID:
| 主机名 | 租户ID |
|---|
zzpq-013.dx.commercecloud.salesforce.com
| |
zzxy-001.dx.commercecloud.salesforce.com
| |
abcd-dev.dx.commercecloud.salesforce.com
| |
对于生产实例,请使用你的领域和实例标识符(例如
)。
List Available Schemas
列出可用的Schema
list all available SCAPI schemas
list all available SCAPI schemas
b2c scapi schemas list --tenant-id zzxy_prd
b2c scapi schemas list --tenant-id zzxy_prd
list with JSON output
list with JSON output
b2c scapi schemas list --tenant-id zzxy_prd --json
b2c scapi schemas list --tenant-id zzxy_prd --json
filter by API family (e.g., product, checkout, search)
filter by API family (e.g., product, checkout, search)
b2c scapi schemas list --tenant-id zzxy_prd --api-family product
b2c scapi schemas list --tenant-id zzxy_prd --api-family product
filter by API name
filter by API name
b2c scapi schemas list --tenant-id zzxy_prd --api-name shopper-products
b2c scapi schemas list --tenant-id zzxy_prd --api-name shopper-products
filter by status
filter by status
b2c scapi schemas list --tenant-id zzxy_prd --status current
b2c scapi schemas list --tenant-id zzxy_prd --status current
Get Schema (Collapsed/Outline - Default)
获取Schema(默认折叠/大纲模式)
By default, schemas are output in a collapsed format optimized for context efficiency. This is ideal for agentic use cases and LLM consumption.
默认情况下,Schema会以折叠格式输出,针对上下文效率做了优化,非常适合Agent使用场景和LLM消费。
get collapsed schema (paths show methods, schemas show names only)
get collapsed schema (paths show methods, schemas show names only)
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd > schema.json
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd > schema.json
Get Schema with Selective Expansion
选择性展开获取Schema
Expand only the parts of the schema you need:
expand specific paths
expand specific paths
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products,/products/{productId}
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products,/products/{productId}
expand specific schemas
expand specific schemas
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-schemas Product,ProductResult
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-schemas Product,ProductResult
combine expansions
combine expansions
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products --expand-schemas Product
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products --expand-schemas Product
Get Full Schema
获取完整Schema
get full schema without any collapsing
get full schema without any collapsing
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-all
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-all
List Available Paths/Schemas/Examples
列出可用的路径/Schema/示例
Discover what's available in a schema before expanding:
list all paths in the schema
list all paths in the schema
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-paths
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-paths
list all schema names
list all schema names
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-schemas
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-schemas
list all examples
list all examples
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-examples
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-examples
output as YAML
output as YAML
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --yaml
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --yaml
output wrapped JSON with metadata (apiFamily, apiName, apiVersion, schema)
output wrapped JSON with metadata (apiFamily, apiName, apiVersion, schema)
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --json
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --json
include custom properties (default behavior)
include custom properties (default behavior)
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd
exclude custom properties
exclude custom properties
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --no-expand-custom-properties
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --no-expand-custom-properties
The tenant ID and short code can be set via environment variables:
- : Tenant ID (e.g., , not the organization ID)
- : SCAPI short code
你可以通过环境变量设置租户ID和短代码:
- :租户ID(例如,不是组织ID)
- :SCAPI短代码
See
for a full list of available commands and options.