CCD-102 practice question 11 of 30
A developer wants to use an external application to manage their stores information (such as opening hours, and so on), and see their changes in their B2C Commerce Staging instance aas son as they are saved. What is the appropriate technique the developer should perform to allow the merchant to create a new store in this scenario?
Full set: 206 questionsIn the Salesforce B2C Commerce Open Commerce API (OCAPI), the standard method for creating a new resource, such as a store, is by using an HTTP PUT request. The client application must specify the unique identifier for the new store in the request URI (e.g., PUT /stores/{storeid}). This design choice makes the creation operation idempotent, meaning that making the same PUT request multiple times will result in the same state without creating duplicate resources. The API uses this single PUT method to handle both the creation of a new store and the complete replacement (update) of an existing one.
1. Salesforce B2C Commerce Cloud OCAPI Documentation: The official documentation for the Stores Data API resource explicitly defines the HTTP methods.
Resource: stores
Endpoint: /stores/{storeid}
Method: PUT
Description: "Creates or updates a store. The store is created if it does not exist. The store is updated if it already exists."
Source: Salesforce Developer Center
B2C Commerce Cloud OCAPI 23.10 Documentation
Data API
Resources: stores.
2. Roy T. Fielding
"Architectural Styles and the Design of Network-based Software Architectures" (Ph.D. dissertation
University of California
Irvine): This foundational text on REST architecture distinguishes between PUT and POST.
Section 5.2.1.2
"PUT": "The PUT method requests that the enclosed entity be stored under the supplied Request-URI... If the Request-URI refers to an already existing resource
the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URI does not point to an existing resource... the origin server can create the resource with that URI." This supports the use of PUT for creation when the client defines the resource URI.
DOI: https://www.ics.uci.edu/~fielding/pubs/dissertation/restarchstyle.htm#sec5212
Keep practicing
Take the free CCD-102 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CCD-102 practice questions
- Question 1A developer has a sandbox with code to log a message during execution, and the following …
- Question 3Server.get(‘Show’, consentTracking.consent, cache.applyDefaultCache, function (req,res,ne…
- Question 4A developer needs to update the package.json file so that it points to the hock file for …
- Question 5A developer wants to create in Business Manager extension with the cartridge named plugin…
- Question 6A client uses tax tables in Business Manager to calculate tax. They recently started ship…
- Question 7A Digital Developer has a site export file on their computer that needs to be imported in…
