Help us improve
Share bugs, ideas, or general feedback.
From salesforce-commerce
Documents OCAPI Shop and Data API endpoints, authentication, pagination, and SCAPI migration guide for maintaining legacy Salesforce B2C Commerce integrations.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin salesforce-commerceHow this skill is triggered — by the user, by Claude, or both
Slash command
/salesforce-commerce:sf-b2c-ocapiThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **MAINTENANCE-ONLY NOTICE**
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.
Provides deprecated Shopify REST Admin API reference—endpoints, auth, rate limits—and GraphQL migration mappings. Use for legacy maintenance or migration planning.
Identifies Shopify API anti-patterns like ignoring userErrors, outdated versions, REST over GraphQL, missing GDPR webhooks, and timeouts. Reviews code with real examples.
Share bugs, ideas, or general feedback.
MAINTENANCE-ONLY NOTICE
OCAPI is in maintenance-only mode. Salesforce is not adding new features and has positioned SCAPI as the successor for all new storefront development. OCAPI receives only critical security patches and bug fixes. It has NOT been formally deprecated with a sunset date.
Use this skill ONLY for: maintaining legacy integrations, planning OCAPI-to-SCAPI migration, or debugging production OCAPI issues.
Do NOT build new features against OCAPI. Use the
sf-b2c-scapiskill for all new work.
Fetch live documentation BEFORE writing any code.
site:developer.salesforce.com OCAPI reference B2C Commerce for latest reference docssite:developer.salesforce.com SCAPI migration OCAPI for migration guidesSalesforce B2C Commerce OCAPI maintenance mode 2026 for deprecation timeline updatesdeveloper.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-ocapi-overview.html| Aspect | Shop API | Data API |
|---|---|---|
| Purpose | Storefront operations (browse, cart, checkout) | Admin/integration operations (catalog, config, batch) |
| Audience | Shoppers / frontend apps | Admins / ERP / PIM integrations |
| Site scope | Site-specific (/s/{site_id}/dw/shop/) | Global (/s/-/dw/data/) |
| Auth | Client ID header or customer JWT | JWT bearer token from Account Manager |
| Typical consumers | PWA, mobile apps, kiosks | ERP connectors, OMS, back-office tools |
| Auth Type | API | Use Case |
|---|---|---|
Client ID header (x-dw-client-id) | Shop API | Anonymous browsing |
Customer JWT (via /customers/auth) | Shop API | Registered customer sessions |
| OAuth JWT (Account Manager) | Data API | Server-to-server integrations |
| BM User Grant | Data API | Operations requiring BM user context |
Access control is configured via JSON in Business Manager, granting each client specific resources and methods.
OCAPI uses offset-based pagination with count (page size) and start (offset) parameters. Responses include total, hits, next, and previous fields.
| Parameter | Default | Description |
|---|---|---|
count | 25 | Results per page (max varies, typically 200) |
start | 0 | Zero-based offset |
Use the expand parameter to include related data (images, prices, variations) in a single request, reducing round-trips. Use select to request only needed fields, reducing payload size.
OCAPI requires an explicit version in the URL path (e.g., v24.5). Each B2C Commerce release may introduce a new version. Pin your version and do not upgrade unless required for a security patch.
| Aspect | OCAPI | SCAPI |
|---|---|---|
| Auth | Client ID header + Basic auth | SLAS (OAuth 2.1 with PKCE) |
| Naming | snake_case fields | camelCase fields |
| Versioning | Frequent version bumps (v24.5) | Stable (v1) |
| SDK | No official SDK | Commerce SDK (Node.js/TypeScript) |
| CDN | Separate CDN config | eCDN built-in |
| Search | POST with JSON body | GET with query params |
| Status | Maintenance-only | Active development |
Migration should be incremental, not big-bang:
snake_case to camelCase for downstream consumersOCAPI returns faults in a standard envelope with _type: "fault" and a nested fault object containing type and message. Common fault types:
| Fault Type | HTTP Status |
|---|---|
InvalidParameterException | 400 |
AuthenticationFailedException | 401 |
AuthorizationFailedException | 403 |
NotFoundException | 404 |
RateLimitExceededException | 429 |
expand to fetch related data in one call instead of multiple requestsFetch the latest OCAPI reference docs, SCAPI migration guide, and Salesforce release notes for exact endpoint schemas, version availability, and deprecation timelines before implementing.