B2C SCAPI Custom APIs Skill
B2C SCAPI 自定义API技能
Use the
CLI plugin to manage SCAPI Custom API endpoints and check their registration status.
Tip: If
is not installed globally, use
instead (e.g.,
npx @salesforce/b2c-cli scapi custom status
).
使用
CLI插件来管理SCAPI自定义API端点,以及检查它们的注册状态。
提示: 如果没有全局安装
,请改用
(例如
npx @salesforce/b2c-cli scapi custom status
)。
Required: Tenant 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)
参数对所有命令都是
必填的。Tenant ID用于标识你的B2C Commerce实例。
重要提示: Tenant ID与组织ID(Organization ID)并不相同:
- Tenant ID:(用于需要参数的命令)
- Organization ID:(用于SCAPI URL中,带有前缀)
Deriving Tenant ID from Hostname
从主机名推导Tenant 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.,
).
对于沙箱实例,你可以将主机名中的连字符替换为下划线,从而得到Tenant ID:
| 主机名 | Tenant ID |
|---|
zzpq-013.dx.commercecloud.salesforce.com
| |
zzxy-001.dx.commercecloud.salesforce.com
| |
abcd-dev.dx.commercecloud.salesforce.com
| |
对于生产实例,请使用你的领域和实例标识符(例如
)。
Get Custom API Endpoint Status
获取自定义API端点状态
list all Custom API endpoints for an organization
list all Custom API endpoints for an organization
b2c scapi custom status --tenant-id zzxy_prd
b2c scapi custom status --tenant-id zzxy_prd
list with JSON output
list with JSON output
b2c scapi custom status --tenant-id zzxy_prd --json
b2c scapi custom status --tenant-id zzxy_prd --json
list only active endpoints
list only active endpoints
b2c scapi custom status --tenant-id zzxy_prd --status active
b2c scapi custom status --tenant-id zzxy_prd --status active
list only endpoints that failed to register
list only endpoints that failed to register
b2c scapi custom status --tenant-id zzxy_prd --status not_registered
b2c scapi custom status --tenant-id zzxy_prd --status not_registered
Group by Type or Site
按类型或站点分组
group endpoints by API type (Admin vs Shopper)
group endpoints by API type (Admin vs Shopper)
b2c scapi custom status --tenant-id zzxy_prd --group-by type
b2c scapi custom status --tenant-id zzxy_prd --group-by type
group endpoints by site
group endpoints by site
b2c scapi custom status --tenant-id zzxy_prd --group-by site
b2c scapi custom status --tenant-id zzxy_prd --group-by site
Customize Output Columns
自定义输出列
show extended columns (includes error reasons, sites, etc.)
show extended columns (includes error reasons, sites, etc.)
b2c scapi custom status --tenant-id zzxy_prd --extended
b2c scapi custom status --tenant-id zzxy_prd --extended
select specific columns to display
select specific columns to display
b2c scapi custom status --tenant-id zzxy_prd --columns type,apiName,status,sites
b2c scapi custom status --tenant-id zzxy_prd --columns type,apiName,status,sites
available columns: type, apiName, apiVersion, cartridgeName, endpointPath, httpMethod, status, sites, securityScheme, operationId, schemaFile, implementationScript, errorReason, id
available columns: type, apiName, apiVersion, cartridgeName, endpointPath, httpMethod, status, sites, securityScheme, operationId, schemaFile, implementationScript, errorReason, id
Debug Failed Registrations
调试注册失败问题
quickly find and diagnose failed Custom API registrations
quickly find and diagnose failed Custom API registrations
b2c scapi custom status --tenant-id zzxy_prd --status not_registered --columns type,apiName,endpointPath,errorReason
b2c scapi custom status --tenant-id zzxy_prd --status not_registered --columns type,apiName,endpointPath,errorReason
The tenant ID and short code can be set via environment variables:
- : Tenant ID (e.g., , not the organization ID)
- : SCAPI short code
你可以通过环境变量设置Tenant ID和短代码:
- :Tenant ID(例如,不是组织ID)
- :SCAPI短代码
See
for a full list of available commands and options.
b2c:b2c-custom-api-development
- Creating Custom API endpoints (schema, script, mapping)
- - Deploying and activating code versions (triggers registration)
b2c:b2c-custom-api-development
- 创建自定义API端点(schema、脚本、映射)
- - 部署和激活代码版本(会触发注册流程)