Announcements
Why Use SCAPI
Base URL and Request Formation
Quick Start
SCAPI Specifications
B2C Commerce Release Notes
Ask the Community
The B2C Commerce API (SCAPI) is a set of RESTful APIs for building storefronts, merchant tools, and integrations on the B2C Commerce platform. It also goes by “Salesforce Commerce API” or just “Commerce API.” For B2C Commerce customers, the API is available at no extra cost.
To browse the endpoints, see the API Reference. To learn how SCAPI fits into the B2C Commerce stack, see Composable Storefront and SCAPI.
Tip
The following two curl commands are all you need to get started. They use a SLAS private client to get a guest token, then fetch a product from the demo sandbox.
Replace {client_id} and {client_secret} with your SLAS private client credentials. (To create a SLAS client, see Authorization for Shopper APIs.)
1curl "https://kv7kzm78.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/f_ecom_zzte_053/oauth2/token" \
2 -u "{client_id}:{client_secret}" \
3 -d "grant_type=client_credentials" \
4 -d "channel_id=RefArch"The response includes an access_token:
1{
2 "access_token": "eyJ0eXAiOiJKV1Q...",
3 "expires_in": 1800,
4 "token_type": "Bearer"
5}Use the access_token from Step 1 to fetch a product:
1curl "https://kv7kzm78.api.commercecloud.salesforce.com/product/shopper-products/v1/organizations/f_ecom_zzte_053/products/25695327M?siteId=RefArch" \
2 -H "Authorization: Bearer {access_token}"A successful response returns product details as JSON:
1{
2 "id": "25695327M",
3 "name": "Striped Silk Tie",
4 "currency": "USD",
5 "price": 19.19,
6 ...
7}In addition to securing access to the Shopper API, SLAS can also turn on third-party identity providers, single sign-on, and personalization in your application.
Other ways to get started:
Note
| I want to… | Start here |
|---|---|
| Build a storefront | Composable Storefront uses the Shopper APIs exclusively. |
| Build backend or admin tools | Use the SCAPI Admin APIs with an Account Manager token. |
| Extend existing API behavior | Add custom logic with Hooks. |
| Create new API endpoints | Build Custom APIs under the SCAPI framework. |
| Migrate from OCAPI | See Why Use SCAPI Instead of OCAPI. |
If you don’t have a B2C Commerce instance, try the demo sandbox used in the example above. It’s also used in the Quick Start.
To set up your own instance:
SCAPI consists of two API types, plus open-source SDKs and a developer tooling ecosystem. The API type you use depends on your application.
| Shopper APIs | Admin APIs | |
|---|---|---|
| Purpose | Customer-facing (browsing, cart, checkout) | Merchant-facing (product, order, inventory management) |
| Authentication | SLAS (OAuth 2.1) | Account Manager |
| Scale | High-scale, supports anonymous users | Moderate usage |
| Access | Read-only (exceptions: Baskets, Orders) | Read and write |
| Naming | API names start with “Shopper” | No naming convention |
| Package | Description | Docs |
|---|---|---|
commerce-sdk | Node.js (server-side or CLI) | Docs |
commerce-sdk-isomorphic | Isomorphic (server + browser) | Docs |
@salesforce/commerce-sdk-react | React hooks for SCAPI | Docs |
For other languages, use the SCAPI Postman Collection or the API specs in commerce-sdk.
To explore SCAPI from your IDE using AI assistants, use the B2C DX MCP Server (Developer Preview).
The following information is important when preparing for production use.
correlation-id header in your request and the response returns it as x-correlation-id. See View SCAPI Logs and Track Requests.Some new features are available only with specific B2C Commerce versions. This information is included in the B2C Commerce Release Notes and the API specification where applicable.
Make sure that your code can handle nonbreaking changes to the API, such as new fields, new optional parameters, or changes to error messages.
Important
SCAPI is updated regularly with new features, bug fixes, and improvements. Updates are announced in Salesforce Status and the SCAPI Release Notes. Some features require specific B2C Commerce versions.
For the full list of nonbreaking change types and the deployment schedule, see the B2C Commerce Deployment Schedule.
Subscribe to availability updates on Salesforce Status. During maintenance, SCAPI returns maintenance responses. For load management details, see Load Shedding and Rate Limiting.