b2c-scapi-schemas
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseB2C SCAPI Schemas Skill
B2C SCAPI Schemas Skill
Use the CLI plugin to browse and retrieve SCAPI OpenAPI schema specifications.
b2cTip: Ifis not installed globally, useb2cinstead (e.g.,npx @salesforce/b2c-cli).npx @salesforce/b2c-cli scapi schemas list
使用 CLI插件来浏览和获取SCAPI OpenAPI schema规范。
b2c提示: 如果没有全局安装,请改用b2c(例如npx @salesforce/b2c-cli)。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.
--tenant-idImportant: The tenant ID is NOT the same as the organization ID:
- Tenant ID: (used with commands that require
zzxy_prd)--tenant-id - Organization ID: (used in SCAPI URLs, has
f_ecom_zzxy_prdprefix)f_ecom_
所有命令都必须带参数。租户ID用于标识你的B2C Commerce实例。
--tenant-id重要提示: 租户ID和组织ID(Organization ID)并不相同:
- 租户ID:(用于需要
zzxy_prd参数的命令)--tenant-id - 组织ID:(用于SCAPI URL中,带有
f_ecom_zzxy_prd前缀)f_ecom_
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 |
|---|---|
| |
| |
| |
For production instances, use your realm and instance identifier (e.g., ).
zzxy_prd对于沙箱实例,你可以将主机名中的连字符替换为下划线,即可得到租户ID:
| 主机名 | 租户ID |
|---|---|
| |
| |
| |
对于生产实例,请使用你的领域和实例标识符(例如)。
zzxy_prdExamples
示例
List Available Schemas
列出可用的Schema
bash
undefinedbash
undefinedlist 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
undefinedb2c scapi schemas list --tenant-id zzxy_prd --json
undefinedFilter Schemas
过滤Schema
bash
undefinedbash
undefinedfilter 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
undefinedb2c scapi schemas list --tenant-id zzxy_prd --status current
undefinedGet 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.
bash
undefined默认情况下,Schema会以折叠格式输出,针对上下文效率做了优化,非常适合Agent使用场景和LLM消费。
bash
undefinedget 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
save to file
save to file
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd > schema.json
undefinedb2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd > schema.json
undefinedGet Schema with Selective Expansion
选择性展开获取Schema
Expand only the parts of the schema you need:
bash
undefined仅展开你需要的Schema部分:
bash
undefinedexpand 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
undefinedb2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products --expand-schemas Product
undefinedGet Full Schema
获取完整Schema
bash
undefinedbash
undefinedget 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
undefinedb2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-all
undefinedList Available Paths/Schemas/Examples
列出可用的路径/Schema/示例
Discover what's available in a schema before expanding:
bash
undefined在展开Schema前先查询其中可用的内容:
bash
undefinedlist 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
undefinedb2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-examples
undefinedOutput Formats
输出格式
bash
undefinedbash
undefinedoutput 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
undefinedb2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --json
undefinedCustom Properties
自定义属性
bash
undefinedbash
undefinedinclude 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
undefinedb2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --no-expand-custom-properties
undefinedConfiguration
配置
The tenant ID and short code can be set via environment variables:
- : Tenant ID (e.g.,
SFCC_TENANT_ID, not the organization ID)zzxy_prd - : SCAPI short code
SFCC_SHORTCODE
你可以通过环境变量设置租户ID和短代码:
- :租户ID(例如
SFCC_TENANT_ID,不是组织ID)zzxy_prd - :SCAPI短代码
SFCC_SHORTCODE
More Commands
更多命令
See for a full list of available commands and options.
b2c scapi schemas --help执行查看完整的可用命令和选项列表。
b2c scapi schemas --help