b2c-custom-api-development
Develop Custom SCAPI endpoints for B2C Commerce. Use when creating REST APIs, defining api.json routes, writing schema.yaml (OAS 3.0), or building headless commerce integrations. Covers cartridge structure, endpoint implementation, and OAuth scope configuration.
npx skills add majiayu000/claude-skill-registry --skill b2c-custom-api-development-salesforcecommercecl-b2c-developer-to --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Custom API Development Skill This skill guides you through developing Custom APIs for Salesforce B2C Commerce. Custom APIs let you expose custom script code as REST endpoints under the SCAPI framework. ## Overview A Custom API URL has this structure: ``` https://{shortCode}.api.commercecloud.salesforce.com/custom/{apiName}/{apiVersion}/organizations/{organizationId}/{endpointPath} ``` Three components are required to create a Custom API: 1. **API Contract** - An OAS 3.0 schema file (YAML) 2. **API Implementation** - A script using the B2C Commerce Script API 3. **API Mapping** - An `api.json` file binding endpoints to implementations ## Cartridge Structure Custom APIs are defined within cartridges. Create a `rest-apis` folder in the cartridge directory with subdirectories for each API: ``` /my-cartridge /cartridge package.json /rest-apis /my-api-name # API name (lowercase alphanumeric and hyphens only) api.json # Mapping file schema.yaml # OAS 3.0 contract script.js # Implementation /scripts /controllers ``` **Important:** API directory names can only contain alphanumeric lowercase characters and hyphens. ## Component 1: API Contract (schema.yaml) The API contract defines endpoin
- Overview
- Cartridge Structure
- Component 1: API Contract (schema.yaml)
- Contract Requirements
- Shopper vs Admin APIs
- Component 2: Implementation (script.js)
- Implementation Best Practices
- Caching Responses
- Remote Includes
- Component 3: Mapping (api.json)
- Endpoint Registration
- Circuit Breaker Protection
- Troubleshooting
- Common Errors
Deploy cartridge and reload (re-activate) to register endpoints b2c code deploy ./my-cartridge --reload Or deploy then activate separately b2c code deploy ./my-cartridge b2c code activate my-code-version Check Custom API registration status Tenant ID: derive from hostname (e.g., zzpq-013 → zzpq_013) b2c scapi custom status --tenant-id zzpq_013 Filter to see only failed registrations b2c scapi custom status --tenant-id zzpq_013 --status not_registered
What does the b2c-custom-api-development skill do?
Develop Custom SCAPI endpoints for B2C Commerce. Use when creating REST APIs, defining api.json routes, writing schema.yaml (OAS 3.0), or building headless commerce integrations. Covers cartridge structure, endpoint implementation, and OAuth scope configuration.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill b2c-custom-api-development-salesforcecommercecl-b2c-developer-to --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
