The Salesforce Commerce API

The Salesforce Commerce API is a new RESTful API for Salesforce B2C Commerce. The API provides access to the B2C Commerce resources so that developers can create commerce experiences anywhere. You can see the full capabilities in the API Reference section of the Commerce Cloud Developer Center.

The Salesforce Commerce API is built on a new API-first platform that provides a path to developing new commerce services with:

  • A new API gateway with multi-tenant support.
  • Built-in monitoring, metering, and logging.
  • An eCDN layer in front of the APIs.
  • Support for headless development across multiple use cases for shopping and administration.

As we add new and improved capabilities to the platform, those capabilities will be exposed via the Salesforce Commerce API. Just as for the overall Salesforce B2C Commerce system, we build our APIs with trust first in mind. The system is designed to be available, to protect shopper data, and to be fully compliant with all relevant regulations.

The Salesforce Commerce API is broken into two groups:

  1. Shopper APIs. Shopper APIs target the persona of a storefront shopper. These APIs are accessed as either guest or anonymous users, or as authenticated users against a customer authentication system. Shopper APIs are built for high-scale and usage within a storefront. They are primarily read-only APIs with exceptions being Baskets and Orders.

  2. All Other APIs. All other APIs are protected and accessed by “high privileged” users that access the Commerce Cloud system via Account Manager. These APIs are often used for merchandisers, advertisers, site operators, support agents, developers, and so on. These APIs are often not as high-scale as Shopper APIs as they are not accessed as often.

Answers to Common Questions

How can I use the Salesforce Commerce API with my B2C Commerce instances?

Anyone can review the API reference and use the mocking service endpoints to try the Salesforce Commerce API, and Commerce Cloud customers can use the Salesforce Commerce API against their B2C Commerce instances (production, staging, and sandboxes).

How does the Salesforce Commerce API relate to OCAPI?

The Salesforce Commerce API is separate from the Open Commerce API (OCAPI). As we create new services (such as our Discovery and Inventory services), the Salesforce Commerce API platform provides the layer that exposes these new services. In addition, the new API gives us the abstraction layer we need to continue to innovate on existing APIs.

For a detailed comparison, see Comparing to OCAPI.

Do I need MuleSoft to use these new APIs?

No. MuleSoft is not required. The APIs are accessible as REST APIs or from the SDK. We use MuleSoft as the underlying API gateway structure, but that usage is internal to Commerce Cloud and has no effect on how you interact with the APIs.

Will there be a cost to use the Salesforce Commerce API?

No. There is no cost to existing Salesforce B2C Commerce customers to use the Salesforce Commerce API. When the APIs are generally available, existing customers will have access to them.

In the future, the API will have usage-based pricing models that could be adopted for headless implementations. These pricing models will allow customers to “subscribe” to the APIs. A timeline for a usage-based model is not known at this time.

Is there an SDK available?

Yes. We have created an open source TypeScript SDK, an Isomorphic SDK focused on the Shopper APIs, and a Node.js SDK that can access all the endpoints of the Salesforce Commerce API. For more information on these tools head over to the Resources section and see the Tools & Sample Apps pages on the Commerce Cloud Developer Center.

Are there examples of how to build storefronts?

Yes. We have provided a sample storefront application that demonstrates best practices for building “headless” commerce storefronts. You can read about the sample app on the getting started page of the Commerce Cloud Developer Center.