Using Mocking Services

Each Salesforce Commerce API resource has a corresponding mocking service—a service that returns a static response, regardless of what parameters you pass in.

The main benefit of a mocking service is that it shows you the structure of an actual request and response without any setup. When you call a mocking service in the Developer Center, you don’t connect to an actual B2C Commerce environment. The Developer Center cannot be used as an API client to an actual API endpoint.

  1. From the main menu, select Develop > API Reference.
  2. Select a tile (for example, Shopper Baskets).
  3. Click API Specification.
  4. Click the HTTP method for an endpoint (for example, GET, PUT, POST, and so on).
  5. In the Select API Instance dropdown, select Mocking Service.
  6. Provide values for the required fields. (The values aren’t validated. Put in any value you want!)
  7. If you are calling a resource that accepts more than one Authorization method, accept the default, BearerToken.
  8. Click Send.