From salesforce-commerce
Build headless commerce storefronts and API integrations with Salesforce SCAPI Shopper APIs (products, search, baskets, orders, customers), SLAS auth, Node.js SDK, rate limiting, pagination.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin salesforce-commerceThis skill is limited to using the following tools:
Build headless commerce experiences and API integrations with Salesforce Commerce API (SCAPI).
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
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.