Comparing to OCAPI

Salesforce Commerce API vs. OCAPI

Salesforce has provided REST APIs for B2C Commerce services for many years through our Open Commerce API (OCAPI). Our new Salesforce Commerce API allows for an API-first approach to developing for headless architectures. We get lots of questions about how these two APIs are different and what the plans are for each API. We’ve tried to address the most frequently asked questions in this document.

We are using OCAPI. Do we need to switch to the new API?

No. If you’re using OCAPI, you don’t have to switch to the Salesforce Commerce API. OCAPI continues to be a fully supported product.

What is the difference between OCAPI and the Salesforce Commerce API?

The Salesforce Commerce API and OCAPI both expose underlying resources from the Salesforce B2C Commerce system. The Salesforce Commerce API includes these additional capabilities:

  • An embedded CDN (eCDN)
  • Policy deployment
  • Rate limiting to improve reliability
  • Additional metrics capabilities
  • Additional monitoring capabilities
  • A more API-driven architectural approach
  • No “hook” system required

The Salesforce Commerce API is the new API ecosystem foundation. We plan to develop new APIs for this new API ecosystem. We also plan to add new SDKs and sample apps to the Commerce Cloud Developer Center (CCDC) to help you use the new APIs.

You can adopt portions of the new API as you evolve your storefront.

Will the Salesforce Commerce API eventually replace OCAPI?

We have no plans to decommission OCAPI. You can continue to use OCAPI, and Salesforce will continue to support OCAPI. New APIs and services will be included in the Salesforce Commerce API but not necessarily added to OCAPI. You can choose when to adopt the new APIs.

For example, Salesforce is looking at new services for search/discovery, inventory, and customer authentication. These multi-tenant services provide new features and improved performance. The new services will be exposed only through the new Salesforce Commerce API. You can choose when to adopt these new APIs, and can adopt some or all of them as your business needs dictate. As you adopt more and more of the new APIs and functionality, you’ll have less need to use OCAPI.

Will there eventually be a new Commerce API developed for every OCAPI API?

We plan to provide OCAPI equivalent functionality in the Salesforce Commerce API and then expand the Salesforce Commerce API to access additional business objects. There won’t be a 1:1 match of endpoints in OCAPI to endpoints in the Salesforce Commerce API. Instead, we plan to provide the same functional coverage in the Salesforce Commerce API as we have in OCAPI. Before the Salesforce Commerce API achieves full parity with OCAPI, the Salesforce Commerce API won’t be able cover some use cases. For those cases, you can use OCAPI.

Is Salesforce committed to continuing to expose new features in OCAPI?

We’ll be adding APIs to the Salesforce Commerce API. We might introduce new features in OCAPI as well, but OCAPI won’t include all new feature. We’ll continue to provide security updates for OCAPI as needed.

Why a new API? Why didn’t you just make improvements to OCAPI?

We needed a new API platform to enable new multi-tenant services with central control from a single API Gateway to create policies around logging, metering, rate limits, authN/authZ, and other cross-cutting functionality. This functionality was required for independent multi-tenant services that provide common infrastructure. OCAPI didn’t allow for these improvements.

Can I use the Salesforce Commerce API and OCAPI at the same time?

Yes. You can access both APIs independently. However, you must have two different client IDs, one for the Salesforce Commerce API and one for OCAPI.