b2c-scapi-custom

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

B2C SCAPI Custom APIs Skill

B2C SCAPI 自定义API技能

Use the
b2c
CLI plugin to manage SCAPI Custom API endpoints and check their registration status.
Tip: If
b2c
is not installed globally, use
npx @salesforce/b2c-cli
instead (e.g.,
npx @salesforce/b2c-cli scapi custom status
).
使用
b2c
CLI插件来管理SCAPI自定义API端点,以及检查它们的注册状态。
提示: 如果没有全局安装
b2c
,请改用
npx @salesforce/b2c-cli
(例如
npx @salesforce/b2c-cli scapi custom status
)。

Required: Tenant ID

必填项:Tenant ID

The
--tenant-id
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:
    zzxy_prd
    (used with commands that require
    --tenant-id
    )
  • Organization ID:
    f_ecom_zzxy_prd
    (used in SCAPI URLs, has
    f_ecom_
    prefix)
--tenant-id
参数对所有命令都是必填的。Tenant ID用于标识你的B2C Commerce实例。
重要提示: Tenant ID与组织ID(Organization ID)并不相同:
  • Tenant ID
    zzxy_prd
    (用于需要
    --tenant-id
    参数的命令)
  • Organization ID
    f_ecom_zzxy_prd
    (用于SCAPI URL中,带有
    f_ecom_
    前缀)

Deriving Tenant ID from Hostname

从主机名推导Tenant ID

For sandbox instances, you can derive the tenant ID from the hostname by replacing hyphens with underscores:
HostnameTenant ID
zzpq-013.dx.commercecloud.salesforce.com
zzpq_013
zzxy-001.dx.commercecloud.salesforce.com
zzxy_001
abcd-dev.dx.commercecloud.salesforce.com
abcd_dev
For production instances, use your realm and instance identifier (e.g.,
zzxy_prd
).
对于沙箱实例,你可以将主机名中的连字符替换为下划线,从而得到Tenant ID:
主机名Tenant ID
zzpq-013.dx.commercecloud.salesforce.com
zzpq_013
zzxy-001.dx.commercecloud.salesforce.com
zzxy_001
abcd-dev.dx.commercecloud.salesforce.com
abcd_dev
对于生产实例,请使用你的领域和实例标识符(例如
zzxy_prd
)。

Examples

示例

Get Custom API Endpoint Status

获取自定义API端点状态

bash
undefined
bash
undefined

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
undefined
b2c scapi custom status --tenant-id zzxy_prd --json
undefined

Filter by Status

按状态过滤

bash
undefined
bash
undefined

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
undefined
b2c scapi custom status --tenant-id zzxy_prd --status not_registered
undefined

Group by Type or Site

按类型或站点分组

bash
undefined
bash
undefined

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
undefined
b2c scapi custom status --tenant-id zzxy_prd --group-by site
undefined

Customize Output Columns

自定义输出列

bash
undefined
bash
undefined

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

undefined
undefined

Debug Failed Registrations

调试注册失败问题

bash
undefined
bash
undefined

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
undefined
b2c scapi custom status --tenant-id zzxy_prd --status not_registered --columns type,apiName,endpointPath,errorReason
undefined

Configuration

配置

The tenant ID and short code can be set via environment variables:
  • SFCC_TENANT_ID
    : Tenant ID (e.g.,
    zzxy_prd
    , not the organization ID)
  • SFCC_SHORTCODE
    : SCAPI short code
你可以通过环境变量设置Tenant ID和短代码:
  • SFCC_TENANT_ID
    :Tenant ID(例如
    zzxy_prd
    ,不是组织ID)
  • SFCC_SHORTCODE
    :SCAPI短代码

More Commands

更多命令

See
b2c scapi custom --help
for a full list of available commands and options.
执行
b2c scapi custom --help
查看完整的可用命令和选项列表。

Related Skills

相关技能

  • b2c:b2c-custom-api-development
    - Creating Custom API endpoints (schema, script, mapping)
  • b2c-cli:b2c-code
    - Deploying and activating code versions (triggers registration)
  • b2c:b2c-custom-api-development
    - 创建自定义API端点(schema、脚本、映射)
  • b2c-cli:b2c-code
    - 部署和激活代码版本(会触发注册流程)