Salesforce-B2C-Commerce-Cloud-Developer Practice Test
Salesforce Spring 25 Release 202 Questions
CORRECT TEXT
There is a business requirement to allow a third-party warehouse management system to
update the MySampte.com storefront product inventory in real time.The architect decided
that this is most easily accomplished by using the Open Commerce API (OCAPI). The
developer needs to test the OCAPI settings m their sandbox. Assume the client ID for
testing is "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'. What B the correct GCAPI setting for
this?
Explanation:
To enable a third-party warehouse management system to update the MySample.com storefront product inventory in real time using the Open Commerce API (OCAPI), the developer must configure the Data API settings in the sandbox. Using the test client ID "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", the developer should enable the /inventory_lists/{inventory_list_id}/product_inventory_records/{product_id} resource with PATCH permissions in Business Manager > Administration > Site Development > Open Commerce API Settings > Data API Settings. This allows the third-party system to modify inventory levels for the specified inventory list (e.g., ecom-inventory).
Reasoning: OCAPI Data API: The Data API supports inventory management, and the /inventory_lists/{inventory_list_id}/product_inventory_records/{product_id} endpoint with the PATCH method is designed for updating product inventory records in real time. Client ID Configuration: The demo client ID "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is used for testing in the sandbox. It must be authorized to access the inventory resource.
Correct Setting: In the Data API settings JSON, the developer should include:
{
"_v": "23.6",
"clients": [
{
"client_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"resources": [
{
"resource_id": "/inventory_lists/{inventory_list_id}/product_inventory_records/{product_id}",
"methods": ["patch"],
"read_attributes": "(**)",
"write_attributes": "(**)"
}
]
}
]
}
Replace {inventory_list_id} with the actual ID (e.g., ecom-inventory) used by MySample.com.
The (**) wildcard allows read and write access to all attributes, though specific attributes can be restricted for security. Implementation: The third-party system would send a PATCH request (e.g., https:///s/-/dw/data/v23_6/inventory_lists/ecom-inventory/product_inventory_records/12345) with updated inventory data, authenticated using the client ID.
Steps to Configure: Access OCAPI Settings:
In Business Manager, go to Administration > Site Development > Open Commerce API Settings.
Edit Data API:
Select "Data" and edit the JSON for the MySample.com site. Add Resource:
Add the inventory resource with PATCH method and save. Test the API:
Use a tool like Postman to send a test PATCH request with the client ID and verify the inventory update.
Reference:
Salesforce B2C Commerce Documentation: Data API Resources.
Trailhead Module: “B2C Commerce Developer” module on “OCAPI” covers resource configuration.
Exam Tip:
For the Salesforce B2C-Commerce-Developer exam, know that the Data API’s inventory resource with PATCH is used for real-time updates, and the client ID must be configured with appropriate permissions. Be cautious of typos in resource paths or methods.