b2c-custom-api-development
OfficialBuild Custom SCAPI endpoints for B2C.
System Documentation
What problem does it solve?
Develop Custom SCAPI endpoints for Salesforce B2C Commerce by enabling REST endpoints backed by custom script logic. This skill guides you through creating contracts, implementing endpoint logic, and mapping endpoints to scripts within a cartridge.
Core Features & Use Cases
- API Contract (schema.yaml): Define an OpenAPI 3.0 contract with security, parameters, and paths for your custom API.
- Implementation (script.js): Export public handler functions that interact with the B2C Script API and return RFC 9457 compliant responses.
- Mapping (api.json): Bind endpoints to specific implementations for deployment.
- Cartridge Structure: Organize files under rest-apis/{api-name}/ containing api.json, schema.yaml, and script.js.
- Use Case: Create a new custom API for order lookups and expose it as a REST endpoint.
Quick Start
Create cartridge structure at rest-apis/{api-name}/ with api.json, schema.yaml, and script.js. Define the contract in schema.yaml, implement logic in script.js, and bind endpoints in api.json. Deploy and activate with the b2c CLI (e.g., b2c code deploy ./my-cartridge --reload) and verify registration status with b2c scapi custom status --tenant-id <tenant-id>.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: b2c-custom-api-development Download link: https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/archive/main.zip#b2c-custom-api-development Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.