CCD-102 practice question 28 of 30
Universal Containers is preparing their storefront to use Open Commerce APIs (OCAPI). To which hook should the Digital Developer move taxation logic to ensure consistent order totals within B2C Commerce?
Full set: 206 questionsThe dw.ocapi.shop.basket.calculate hook is the designated extension point for customizing the basket calculation process. To ensure consistent and accurate order totals, all logic related to pricing, shipping, promotions, and taxation must be consolidated and executed within this hook. It is triggered whenever a basket's totals need to be computed, ensuring that the final amounts are correct before the customer proceeds to the order creation step. Placing taxation logic here guarantees it is applied consistently across all OCAPI interactions that affect the basket total.
1. Salesforce B2C Commerce Infocenter
Open Commerce API (OCAPI) Hooks: The official documentation lists the dw.ocapi.shop.basket.calculate hook with the description: "Called during the basket calculation. Can be used to implement custom basket calculation logic." This explicitly identifies it as the correct location for customizing calculations
including taxes. The descriptions for the other hooks confirm their different purposes (validation or post-processing). (Reference: B2C Commerce Developer > Development for B2C Commerce > Open Commerce API > OCAPI Hooks)
2. Salesforce B2C Commerce Infocenter
OCAPI Hook Circuit: The documentation on the hook execution flow shows that calculate is part of the basket modification and retrieval process
which precedes the createorder resource call. The validateOrder and afterPOST hooks are part of the createorder resource itself
confirming the timing difference. (Reference: B2C Commerce Developer > Development for B2C Commerce > Open Commerce API > OCAPI Settings and Configurations)
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…
