sfcc-ocapi-scapi

Integrate Salesforce Commerce Cloud SCAPI and OCAPI Data APIs for headless storefronts.

14|3|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/tomtoto757/ecomm-ai-skills-hub --skill sfcc-ocapi-scapi-tomtoto757
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sfcc-ocapi-scapi
Source: https://github.com/tomtoto757/ecomm-ai-skills-hub/tree/main/skills/platform-integrations-infrastructure/finsilabs/platform-salesforce-cc/sfcc-ocapi-scapi
Command: npx skills add https://github.com/tomtoto757/ecomm-ai-skills-hub --skill sfcc-ocapi-scapi-tomtoto757

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides engineers to integrate Salesforce Commerce Cloud's Shopper (SCAPI) and OCAPI Data APIs so headless storefronts, PWAs, mobile apps, and backend services can access catalog, basket, checkout, and admin order operations reliably and securely.

Core Features & Use Cases

  • Catalog & Search: Use SCAPI Shopper search and product endpoints for headless product discovery with expand/select controls to limit payloads.
  • Authentication & Session Management: Implement SLAS PKCE guest/customer flows, proactive refresh, and secure httpOnly cookie handling for session continuity and cart merge.
  • Cart, Checkout & Orders: Manage baskets and submit orders via Shopper Baskets and Shopper Orders, and use OCAPI Data API with client_credentials for server-side order retrieval and updates.
  • Admin & Data Operations: Use OCAPI Data API for product import/upsert, order status updates, and other admin tasks with environment-driven credentials and idempotent submission.
  • Resilience & Safety: Employ token lifecycle management, Idempotency-Key for order submission, and exponential backoff and caching for rate-limit resilience.
  • Use Case Example: Implement a Next.js BFF that obtains a SLAS guest token, performs product search for a mobile app, creates a basket, and later merges it into a customer session on login.

Quick Start

Use this skill to obtain a SLAS guest token, search the catalog for "running shoes" with your SFCC site ID, create a basket, and then implement a login flow that merges the guest basket into the customer's basket.

Frequently Asked Questions about sfcc-ocapi-scapi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement SLAS PKCE guest and customer token flows for a headless Salesforce Commerce Cloud storefront?

SLAS PKCE guest and customer token flows for a headless Salesforce Commerce Cloud storefront are implemented using secure httpOnly cookie handling and proactive token refresh to maintain session continuity and enable cart merging upon login.

Can I use Salesforce Commerce Cloud SCAPI and OCAPI together for cart checkout and server-side order updates?

Yes, Salesforce Commerce Cloud SCAPI and OCAPI can be used together by utilizing Shopper Baskets and Orders for checkout, while leveraging OCAPI Data API with client_credentials for server-side order retrieval and status updates.

What is the best way to handle SFCC API rate limits and ensure idempotent order submission?

The best way to handle SFCC API rate limits and ensure idempotent order submission is by employing exponential backoff for rate-limit resilience and applying an Idempotency-Key during order submission to prevent duplicate transactions.

How do I configure environment variables for SFCC short code, org ID, and site ID in a BFF?

Environment-driven configuration for SFCC short code, org ID, and site ID in a BFF involves mapping these specific environment variables to authenticate and route API requests correctly to your Salesforce Commerce Cloud instance.

Does headless SFCC API integration support product search with payload limiting for mobile apps?

Yes, headless SFCC API integration supports product search for mobile apps by using SCAPI Shopper search endpoints with expand and select controls to effectively limit payload sizes during product discovery.

When should I use OCAPI Data API client_credentials versus SLAS tokens for SFCC operations?

OCAPI Data API client_credentials should be used for server-side admin operations like product import and order updates, whereas SLAS tokens are required for shopper-facing storefront flows like cart and checkout.