Cert++
Close

OCAPI versus storefront controllers for headless or app access

Key Takeaway

OCAPI requests skip the web tier cache, and storefront controllers are stateful. A headless or app client must use caching well and reuse its session (the cookie for controllers, a JWT for OCAPI), or it can slow the whole instance.

An external client, such as a mobile app or a headless front end, can reach B2C Commerce through OCAPI or through custom storefront controller endpoints. The two differ in caching, session handling and resource cost. Your choice affects the performance of the whole instance, not just the app.

Ways to reach B2C Commerce

B2C Commerce has two REST API products, OCAPI and SCAPI. Storefront requests are handled by controllers or pipelines.

OCAPISCAPI
Full nameOpen Commerce APIB2C Commerce API
Introduced20142020, for headless commerce
StatusMaintenance-only mode, but not going awayRecommended by Salesforce for new customers, new projects and major refactoring work

OCAPI includes the Shop API, Data API and Meta API.

SLAS can also authenticate shoppers for OCAPI, so one shopper token works across both APIs. Using SLAS with OCAPI still requires Account Manager.

SCAPI Custom APIs expose custom script code as a REST API under SCAPI. A Custom API has a smaller back-end resource footprint than a controller-based endpoint.

B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

Given a business requirement, use OCAPI Shop and Data APIs to enable interoperability with an external system

0/10

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers. 796 members and growing.