/salesforce-commerce:sf-b2c-scapifrom salesforce-commerce
Builds headless commerce experiences using Salesforce Commerce API (SCAPI) — Shopper APIs, SLAS authentication, rate limiting, pagination, and Node.js Commerce SDK patterns.
Ships in salesforce-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Build headless commerce experiences and API integrations with Salesforce Commerce API (SCAPI).
Fetch live documentation FIRST:
developer.salesforce.com/docs/commerce/commerce-api/references (SCAPI API reference)developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html (SLAS auth guide)github.com/SalesforceCommerceCloud/commerce-sdk (Commerce SDK repo)Why: SCAPI is the modern API replacing OCAPI. Endpoints, authentication flows, rate limits, and SDK versions change frequently. Always verify current specs before implementing.
| Family | Scope | Examples |
|---|---|---|
| Shopper Products | Product data for storefront | Product details, images, prices, variations |
| Shopper Search | Product discovery | Keyword search, refinements, facets, suggestions |
| Shopper Baskets | Cart operations | Create basket, add/remove items, shipping, payment |
| Shopper Orders | Order lifecycle | Create order from basket, order history, status |
| Shopper Customers | Customer identity | Registration, profile, addresses, payment methods |
| Shopper Promotions | Pricing incentives | Active promotions, promotion details |
| Shopper Gift Certificates | Gift cards | Balance check, redemption |
| Einstein | AI recommendations | Product and search recommendations |
| Pricing / Inventory | Admin data | Price books, multi-location inventory |
SCAPI uses SLAS (Shopper Login and API Access Service) for OAuth 2.0 authentication. Two primary flows exist:
| Flow | Client Type | Use Case |
|---|---|---|
| Authorization Code + PKCE | Public (browser/mobile) | Guest and registered shoppers in frontend apps |
| Client Credentials | Private/confidential (server) | Server-to-server integrations, back-office tools |
hint=guest -- this is NOT client_credentialsWhen transitioning a guest user to a registered session (login during checkout), SCAPI supports session bridging to preserve the guest basket. The guest token is exchanged for a registered token via the SLAS token endpoint, and the basket is merged server-side. Fetch live docs for the exact merge behavior and conflict resolution rules.
| Aspect | Detail |
|---|---|
| Scope | Per client ID, per endpoint |
| Typical range | 1,000 -- 10,000 requests/min (varies by API) |
| Burst | Short burst allowances above sustained rate |
| Headers | X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset |
| On 429 | Exponential backoff; respect Retry-After header |
SCAPI uses offset-based pagination with limit and offset parameters. Responses include total count and a next link. Avoid deep pagination on large result sets -- use refinements to narrow results instead.
Two SDK packages exist:
| Package | Environment | Notes |
|---|---|---|
commerce-sdk | Node.js only | Server-side integrations |
commerce-sdk-isomorphic | Browser + Node.js | PWA Kit and universal apps |
// Pattern: SDK initialization
// Fetch live docs for current config shape
import { ShopperProducts } from 'commerce-sdk-isomorphic';
const client = new ShopperProducts(config);
// Pattern: Search with refinements
// Fetch live docs for refinement syntax
const results = await searchClient.productSearch({
parameters: { q, limit, offset, refine, sort }
});
| Syntax | Meaning |
|---|---|
attribute=value | Exact match |
attribute=(min..max) | Range filter |
attribute=val1|val2 | OR condition |
cgid=category-id | Category refinement |
If-None-Match)Fetch the SCAPI API reference, Commerce SDK README, and SLAS guide for exact endpoint paths, request/response shapes, and SDK configuration before implementing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin salesforce-commerce24 skills in this plugin
/js-modernWrite modern JavaScript and TypeScript — ES6+ features, async/await, modules, destructuring, optional chaining, TypeScript types. Covers SFCC server-side JS (CommonJS, limited ES6), PWA Kit (full modern JS/TS), and LWC JavaScript (Lightning Locker constraints). Use when writing JavaScript for Salesforce Commerce./node-backendBuild Node.js backends for Salesforce Commerce — SFCC server-side JavaScript (not actual Node.js runtime), PWA Kit backend (Express-like SSR server), Commerce SDK for server-side SCAPI access, and async patterns for external service integration. Use when building server-side commerce logic./react-patternsOther plugins' skills for the same job