Salesforce-B2C-Commerce-Cloud-Developer Practice Test

Salesforce Spring 25 Release
202 Questions

A Digital Developer wants to selectively retrieve products and process them from an iPhone. Which action should the Developer take, given that JavaScript controllers CANNOT be used?

A. Use import/export in Business Manager.

B. Create a webservice to retrieve products.

C. Use OCAPI and invoke it in native language.

D. Use WebDAV Client to retrieve products.

C.   Use OCAPI and invoke it in native language.

Explanation:

Since the question states that JavaScript controllers CANNOT be used, the developer must rely on other APIs provided by Salesforce B2C Commerce Cloud for retrieving product data from a mobile device like an iPhone.

Let’s examine the options:

πŸ”Ή Option A: Use import/export in Business Manager
This is not suitable for real-time or selective product retrieval.
Import/export is meant for bulk operations, usually done offline or during deployment cycles.
It doesn't provide a dynamic interface for a mobile app to fetch specific product data.
πŸ”΄ Incorrect

πŸ”Ή Option B: Create a webservice to retrieve products
While this sounds like a viable approach, Salesforce B2C Commerce Cloud does not allow arbitrary custom webservices outside of JavaScript controllers, and the question specifically restricts their use.
Additionally, B2C Commerce is a hosted platform, so deploying a custom web service server-side is not natively supported unless you use the platform's exposed APIs.
πŸ”΄ Incorrect

πŸ”Ή Option C: Use OCAPI and invoke it in native language
Open Commerce API (OCAPI) is the correct solution here.
OCAPI has two major components:
Shop API (for storefront interactions)
Data API (for backend data manipulation)
From an iPhone app, the developer can use OCAPI Shop API endpoints to retrieve product details over HTTPS.
The API can be called using the iOS native language (like Swift), and responses are in JSON.
βœ… Correct Answer

πŸ“š Reference:
Salesforce B2C Commerce - OCAPI Shop API
Example: GET /s/-/dw/data/v21_3/products/{product_id}

πŸ”Ή Option D: Use WebDAV Client to retrieve products
WebDAV is used primarily for uploading/downloading code and static assets, such as cartridges or content assets.
It is not used to retrieve product data and is not suitable for real-time access from a mobile application.
πŸ”΄ Incorrect

🧠 Summary:
When a mobile client like an iPhone app needs to selectively retrieve product data and JavaScript controllers are not an option, the best solution is to use OCAPI, specifically the Shop API, and invoke it using the native language of the mobile platform.

Salesforce-B2C-Commerce-Cloud-Developer Practice-Test - Home Previous
Page 9 out of 202 Pages