Salesforce certification · Exam Salesforce-Accredited-B2B-Commerce-Developer-Professional

Salesforce-Accredited-B2B-Commerce-Developer-Professional Mock Exam

Salesforce Accredited B2B Commerce Developer Professional

Find out if you're ready for Salesforce-Accredited-B2B-Commerce-Developer-Professional. Take the free timed mock exam and get your score in minutes, or study the free Salesforce-Accredited-B2B-Commerce-Developer-Professional questions below with answers and explanations.

20 questions · 30 minutes · free, no sign-up

Free Salesforce-Accredited-B2B-Commerce-Developer-Professional questions

1–10 of 63 free
Question 1 Choose 1
While working on a commerce rollout, a developer needs to update the checkout process so that buyers can purchase with one of the below payment types.

• Credit Card
• Purchase Order
• Contract Now & Pay Later

Additionally, the developer needs to show only Purchase Order and Contract Now & Pay Later if a custom checkbox field on the account is checked.
How should the developer meet these requirements?
Show answerHide answer

Correct answer: B Create a custom Lightning web component for the checkout flow that has all the options available. Within that component, pull data from the account to determine which options to show.

Explanation

Explanation:

In modern Salesforce B2B Commerce (especially LWR/Lightning Experience storefronts using Lightning Web Components), the checkout process is highly customizable through custom LWCs placed on the Checkout page or within custom checkout flows. The standard payment component handles core payment processing (like credit cards via Salesforce Payments or integrated gateways), but for non-standard or conditional payment types like Purchase Order (PO) and a custom "Contract Now & Pay Later" (likely a deferred payment or invoicing option tied to contracts), you need more control.

Purchase Order is natively supported in B2B Commerce (often via the dual payment component or PO-specific handling), but "Contract Now & Pay Later" is not a standard out-of-the-box payment type—it's custom logic. Conditional visibility based on a custom checkbox field on the Account (e.g., Allow_Deferred_Payment__c) requires querying the effective Account record (via the cart's associated buyer/account) and dynamically showing or hiding options.

Why B is the Best Approach:
A custom LWC for the payment/checkout section can:
Display all three options (Credit Card via standard integration, PO as a radio or checkbox option, and custom "Contract Now & Pay Later" as another selectable option).
Use @wire with Lightning Data Service (or imperative Apex if needed) to fetch the Account record and check the custom checkbox.
Conditionally render the PO and "Contract Now & Pay Later" options only if the checkbox is true.
Handle selection logic, validation, and pass the chosen payment type to the checkout flow (for example, via custom properties or events to update the cart or order).

This approach is declarative where possible but allows full programmatic control for complex conditions tied to Account data, which is not natively supported in standard payment components or simple screen flow visibility rules for payment options.

Why the Other Options Are Incorrect:
A — Using pub-sub with the standard payment component is possible for some interactions, but the standard payment component does not natively expose events for conditionally adding or showing non-standard payment types like "Contract Now & Pay Later." It is not the cleanest or recommended way for full control over the UI and logic.

C — Screen flows in B2B Commerce checkout support expression-based visibility rules, but the standard payment component does not allow adding arbitrary new payment methods (like "Contract Now & Pay Later") through configuration alone. Visibility rules work for hiding or showing entire components or fields, but not for dynamically filtering options inside the built-in payment UI. PO is supported, but custom types require extension.

D — Adding a new payment gateway (via reference implementations like Adyen, Stripe, etc.) is intended for processor integrations (such as credit card variants), not for non-gateway methods like PO or custom deferred payments. PO does not use a gateway, and "Contract Now & Pay Later" is not a gateway-based method.

References:
Salesforce Help: "Customize the Payment Section of Checkout in a Commerce Store" — Recommends custom LWCs for advanced payment UI and processing beyond standard Salesforce Payments.
B2B Commerce Developer Guide: Custom checkout component examples (such as a Terms and Conditions LWC) demonstrate how to build and extend checkout sections with conditional logic.
Question 2 Choose 1
A user wants to have a customized experience for adding items to the cart. The user also wants the mini cart module to reflect changes to the state of the cart afterwords. How should this requirement be fulfilled?
Show answerHide answer

Correct answer: D Trigger the global „cartChange" event after the Add to Cart Action on the custom button.

Explanation

Explanation:

In Salesforce B2B Commerce, when customizing the Add to Cart experience, the key requirement is that the mini cart module reflects the updated cart state after items are added.

The global cartChange event is the standard event fired whenever the cart’s state changes.

By triggering this event after the custom Add to Cart action, the mini cart (and any other components listening for cart updates) will automatically refresh and display the new cart state.

This ensures consistency across the storefront without requiring additional custom events or remote actions.

Why the Other Options Are Incorrect
A. Leverage the Add to Cart Global API which adds items to the cart and also refreshes the page with the new data.
→ Incorrect. The API adds items but does not automatically refresh the mini cart; the event must be triggered.

B. Trigger the global cartChange event and then trigger changeMiniCart event after the Add to Cart Action.
→ Incorrect. There is no changeMiniCart event; only cartChange is required.

C. Write a custom Remote Action to refresh the Mini Cart and refresh the Cart Line item count.
→ Incorrect. This is unnecessary custom work; the cartChange event already handles this.

References
Salesforce B2B Commerce Developer Guide: Cart Events and Mini Cart Updates
Salesforce Help: Using the cartChange Event in Storefront Customizations
Question 3 Choose 1
A developer suspects that a defect exists in 30 lines of Apex code. How can the developer add debug statements, run the block of apex code in isolation and observe the immediate results?
Show answerHide answer

Correct answer: B Use the Execute Anonymous window

Explanation

Explanation:

In Salesforce (including B2B Commerce development), when a developer suspects a defect in a small, isolated block of Apex code (e.g., 30 lines), the fastest and most effective way to add debug statements (e.g., System.debug('Variable value: ' + var);), run the code in isolation, and observe immediate results is to use the Execute Anonymous window.

This tool is available in:
* Developer Console (Debug → Open Execute Anonymous Window)
* VS Code with Salesforce Extensions (via "Execute Anonymous Apex" command or .apex files)
* Workbench or other tools supporting anonymous Apex execution

Key advantages for this scenario:
* Paste or write the 30-line code block directly (with added System.debug() statements)
* Execute it immediately in the current org context (user permissions, data visibility)
* View real-time output in the Execution Log (filter by DEBUG level to see System.debug messages instantly)
* No need to deploy classes, trigger triggers, or simulate full user flows (e.g., no storefront interaction required)
* Ideal for quick isolation testing, variable inspection, exception catching, or logic validation without affecting production flows

Why the other options are incorrect:

A. Click the Check Out button in the storefront — This triggers the full checkout process (involving multiple services, integrations, flows), not isolated execution. It doesn't allow adding debug statements or running just the 30 lines independently.

C. Activate Chrome dev tools and click the Check Out button in the Storefront — Chrome DevTools is for client-side JavaScript/HTML/CSS debugging (e.g., network requests, console logs from Visualforce or LWC). It cannot execute, debug, or observe server-side Apex code in isolation.

D. Use the Execute Immediate window — There is no standard "Execute Immediate" window in Salesforce. This is likely a distractor term (possibly confusing with Oracle PL/SQL "EXECUTE IMMEDIATE" or a typo/misremembered name). The correct Salesforce feature is "Execute Anonymous."

References
Salesforce Developer Console Help: "Executing Anonymous Apex Code" — Describes using the Execute Anonymous window for ad-hoc code execution with debug output
Trailhead: Apex Basics modules — Teaches Execute Anonymous for quick testing/debugging of code snippets
Question 4 Choose 3
What are three advantages of using ccLog over the Salesforce standard System.debug class? (3 answers)
Show answerHide answer

Correct answer: A, C, E There is no need to use string concatenation to easily tag log statements with a subject.There is no need to create a User Trace Flag. There is no need to manually set a cookie to debug with the Site Guest User.

Explanation

Explanation:

In Salesforce B2B Commerce for Visualforce (CloudCraze), ccLog is a specialized logging utility designed to bridge the gap between server-side Apex execution and client-side visibility.

A. Tagging Logic
The ccLog methods (e.g., ccrz.ccLog.log(LoggingLevel.INFO, 'Subject', data)) natively accept a "Subject" parameter. This automatically categorizes the log entry in the output, whereas System.debug requires you to manually concatenate strings (e.g., System.debug('Subject: ' + data)) to make logs searchable.

C. No Trace Flags
Standard Salesforce debugging requires setting up a Trace Flag in Setup > Debug Logs for a specific user. ccLog bypasses this requirement by outputting data directly to the browser console when a valid token is used, saving the developer from repetitive setup in the Salesforce UI.

E. Guest User Debugging
Debugging the Site Guest User (unauthenticated shoppers) with System.debug is notoriously difficult, often requiring "Debug Mode" for the site or complex cookie mapping. ccLog handles this gracefully by allowing the developer to view guest user execution logic simply by using the logging token in the URL.

Why Other Options are Incorrect

B. Debug JavaScript syntax errors
ccLog is an Apex class. While it outputs to the JavaScript console, it cannot detect syntax errors within your .js files; those must be caught by the browser's native interpreter or LWC compiler.

D. Append #ccLog= to the URL
This is a trick question regarding syntax. To activate the logs, you must append the logging token as a URL parameter using &ccLog=token (or ?ccLog=token), not a URL fragment or hash (#).

Pro Tip for the Exam:
Remember that ccLog is only available if you have first generated a Logging Token in CC Admin > Global Settings.
Question 5 Choose 1
Northern Trail Outfitters (NTO) wants to be able to reference historical data in another system from the Salesforce user experience as read-only, but does not want to import the data into the org or incur storage costs. What is one product feature that could accomplish this?
Show answerHide answer

Correct answer: C External Objects

Explanation

Explanation:

If Northern Trail Outfitters (NTO) needs to access historical data stored in another system, display it inside Salesforce, keep it read-only, avoid importing the data, and avoid consuming Salesforce storage, the correct solution is External Objects.

External Objects allow Salesforce to access data stored outside the org in real time using Salesforce Connect.

They:
- Use OData or custom adapters
- Do not store data in Salesforce
- Do not consume Salesforce storage
- Support read-only access (depending on configuration)
- Can be displayed in the UI like standard objects
- Can be related via Indirect Lookup Relationships

This is the ideal architecture for large volumes of historical data that should remain in an external system.

Why the Other Options Are Incorrect

A. Big Objects
Big Objects store massive amounts of data inside Salesforce. They are designed for large data volumes but still reside in the org and are not meant for real-time external referencing.

B. Lightning Out
Lightning Out allows embedding Lightning components in external systems. It does not enable referencing external data inside Salesforce.

D. External SOQL queries in Apex code
There is no such feature as “External SOQL queries” in Apex for external systems without integration logic.

To access external data via Apex, you would need:
- Callouts
- Middleware
- Custom integration

That does not meet the requirement of a declarative, read-only, no-storage solution.

Exam Tip (AP-202 & Salesforce Developer)
If the question includes:
- “Do not store data”
- “Avoid storage costs”
- “Access external data”
- “Large historical data”
- “Read-only reference”

The answer is almost always External Objects (Salesforce Connect).
Question 6 Choose 2
The ccrz.cc_hk_UserInterface apex class, HTMLHead Include Begin and HTML Head Include End Cloudcraze Page Include sections allow additional content to be added to the HTML tag. What are two reasons that is it preferred to use the ccrz.cc_hk_UserInterface extension over the Cloudcraze Page Include sections? (2 answers)
Show answerHide answer

Correct answer: A, D Salesforce apex: include is wrapped in < span > tags.HTML does not support < span > tags inside the < /span >

Explanation

Explanation:

When adding custom content to the HTML tag in Salesforce B2B Commerce, developers can either use CloudCraze Page Include sections (HTMLHead Include Begin/End) or the ccrz.cc_hk_UserInterface Apex hook extension.

It is preferred to use the UserInterface hook extension because:

Apex include limitations (A)
The apex:include directive is wrapped in [apex:page](apex:page) tags.
This makes it unsuitable for injecting content directly into the section.

HTML restrictions (D)
Standard HTML does not allow [apex:include](apex:include) tags inside the element.
Using Page Include sections can cause invalid markup or runtime issues.

By contrast, the ccrz.cc_hk_UserInterface hook provides a clean, supported way to inject scripts, styles, or metadata into the without breaking HTML standards.

❌ Why the Other Options Are Incorrect
B and C are duplicates or incomplete variations of the same reasoning. The correct and complete explanations are captured in A and D.

📚 References
Salesforce B2B Commerce Developer Guide: Hooks and UserInterface Extension
CloudCraze Technical Documentation: HTMLHead Includes vs. UserInterface Hook
Question 7 Choose 3
Which three attributes are true regarding Subscriber pages? (3 answers)
Show answerHide answer

Correct answer: A, C, E Subscriber pages can include additional standard Salesforce B2B Commerce components such as featured products, category tree, and mini cart. Subscriber pages allow customers to quickly create new custom pages for their storefront.Standard Salesforce B2B Commerce components are automatically included on the page e.g. Header links, images, menu items, containers, etc.

Explanation

Explanation:

Subscriber Pages in Salesforce B2B Commerce (CloudCraze) are designed to allow developers and administrators to extend the storefront safely without modifying managed package pages.

They provide a structured way to add custom content while still leveraging the existing storefront framework.

✅ A. Can include standard Commerce components (Correct)
Subscriber pages support adding existing Commerce components such as:
Featured Products
Category Tree
Mini Cart
Product listings
This allows reuse of built-in functionality.

✅ C. Enable quick creation of custom storefront pages (Correct)
Subscriber pages are specifically intended to:
Create new storefront experiences
Add custom business functionality
Extend navigation without overriding core pages

✅ E. Standard components automatically included (Correct)
Subscriber pages inherit the storefront layout framework, including:
Header
Navigation/menu
Containers/layout structure
Styling and theme
Developers only add the custom content section.

❌ Why the Other Options Are Incorrect
❌ B. All UI components must be created manually
Incorrect — subscriber pages reuse many out-of-the-box Commerce components.

❌ D. Out of the box they are completely blank HTML pages
They are not blank; they inherit the Commerce page structure and layout.
Question 8 Select all that apply
What are the templating, Javascript, and CSS frameworks what the cloudcraze managed package leverages?
Show answerHide answer

Correct answer: B Bootstrap, Backbonejs, and handlebarsjs

Explanation

Explanation:

Salesforce B2B Commerce (CloudCraze) storefronts are built on a managed package that leverages a mix of front-end frameworks for templating, styling, and client-side logic. Knowing which frameworks are in play is important for developers extending or customizing storefront experiences since it dictates which conventions and tools are available out of the box.

Correct Option

✅ B. Bootstrap, Backbone.js, and Handlebars.js
CloudCraze relies on Bootstrap for responsive CSS design and layout, Backbone.js for structuring JavaScript code with models and views, and Handlebars.js for dynamic templating. This trio provides a clean separation of responsibilities: styling, client-side logic, and templating. Developers extending CloudCraze themes or storefronts are expected to understand these frameworks to build consistent and maintainable features.

Incorrect Options

❌ A. AngularJS, Backbone.js, and Handlebars.js
AngularJS is not part of the CloudCraze package. While it is a popular JavaScript framework, CloudCraze instead uses Bootstrap for styling and responsiveness. Including AngularJS here is a distractor because it overlaps in purpose with Backbone.js.

❌ C. Bootstrap, AngularJS, and Backbone.js
This mix leaves out Handlebars.js, which is central to the templating system CloudCraze uses. AngularJS again doesn’t belong in the architecture, and without Handlebars, the option misses the framework that handles the dynamic rendering of HTML.

❌ D. AngularJS, React.js, and Handlebars.js
Neither AngularJS nor React.js is included in the managed package. CloudCraze predates React adoption and never relied on it. This option might trick someone familiar with modern frontend stacks, but it doesn’t match the CloudCraze reality.

Reference:
Salesforce Help – B2B Commerce Developer Guide
Question 9 Choose 2
A developer suspects recent edits to a checkout flow have created a bug based on flow errors being emailed. Given the emails and some inputs known to trigger the issue, which two activities should the developer consider in their investigation?
Show answerHide answer

Correct answer: B, C Look at the previous flow versions and compare them with the current oneOpen the Flow, Select Debug, Provide the Inputs, Select Run

Explanation

Explanation:

When troubleshooting checkout flow errors in Salesforce B2B Commerce, developers should focus on two key activities:

Compare flow versions (B):
Reviewing previous versions of the flow against the current one helps identify what changes may have introduced the bug. This is a standard debugging practice to isolate regressions.

Debug with inputs (C):
Using the Flow Debug tool allows the developer to simulate the flow with the same inputs that triggered the error. This provides visibility into where the flow fails and helps confirm the root cause.

Why the Other Options Are Incorrect

A. Use the Org Browser tool in the IDE to download the flow XML and run a diff report:
While technically possible, this is not the recommended or standard approach for debugging flows. Salesforce provides version comparison and debug tools directly.

D. Attach to Live Session:
Not a supported method for debugging flows. Flows are debugged using the built-in Debug option, not by attaching to live sessions.

Reference:
Salesforce Flow Debugging Guide: “Use the Debug option in Flow Builder to test flows with specific inputs. Compare flow versions to identify changes that may have introduced errors.”
Question 10 Choose 3
Which three statements are true regarding event handling in the Salesforce B2B Commerce managed package? (3 answers)
Show answerHide answer

Correct answer: C, D, E Salesforce B2B Commerce relies on a central event channel for communication across various Salesforce B2B Commerce Backbone Views and Models called CCRZ.pubSub.CCRZ.pubSub defines the following three functions which can be used for event handling: trigger, on, and once. CCRZ.pubSub extends the Backbone.Events JavaScript object

Explanation

Explanation:

These statements accurately describe the event handling architecture in the Salesforce B2B Commerce managed package:

C:
Salesforce B2B Commerce relies on a central event channel called CCRZ.pubSub for communication across various Backbone Views and Models. This pub/sub (publish/subscribe) pattern enables decoupled communication between components.

D:
defines the standard event handling functions: trigger (to publish events), on (to subscribe to events), and once (to subscribe to an event for a single occurrence). These are the core methods for event-driven communication.

E:
extends the Backbone.Events JavaScript object, which provides the event handling capabilities. This inheritance gives CCRZ.pubSub all the event methods from Backbone.Events.

Why the Other Options Are Incorrect:

A:
While JavaScript click listeners may exist in the UI, the B2B Commerce architecture primarily relies on the pubSub event channel for component communication, not a series of direct click listener events.

B:
Writing directly to custom Backbone Views and Models does not automatically integrate that data into the Salesforce B2B Commerce Backbone Views and Models. Custom data must be explicitly synchronized or communicated through proper channels like pubSub events.

Reference:
Salesforce B2B Commerce Developer Guide: Event Handling with CCRZ.pubSub
Full mock exam

Sit the Salesforce-Accredited-B2B-Commerce-Developer-Professional exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real Salesforce-Accredited-B2B-Commerce-Developer-Professional exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full Salesforce-Accredited-B2B-Commerce-Developer-Professional mock exam
  • —questions per mock
  • —time limit
  • 211questions in the bank
  • Newmock on every attempt

Exam Domains Covered in This Practice Test


The B2B Commerce Developer Professional exam is not a general Salesforce developer test. It is a B2B Commerce developer test. Most candidates who fail do so not because they lack Apex or LWC skills, but because they apply standard Salesforce patterns to commerce-specific problems. This practice test is tagged to the official blueprint so you can see exactly where the exam draws its lines, and where it expects you to draw different ones.

AP-202 Exam Blueprint , Where Developers Get Trapped
Exam Domain Official Weight What It Actually Tests (and Where Developers Misjudge It)
Advanced Lightning Web Component Development 30% Creating new LWC components for B2B storefronts: component communication patterns (parent-child, Lightning Message Service), lifecycle hooks, NavigationMixin, GraphQL wire adapters, error boundaries, reactive state management, debounced server requests, refreshApex, and storefront performance. The trap: Knowing how to build an LWC is not the same as knowing how to slot one into the B2B Commerce storefront architecture.
Basic Lightning Web Component Development 20% Enhancing existing B2B Commerce LWCs: @api properties, custom events, conditional/list rendering, wire adapters, imperative Apex calls, accessibility, and Experience Builder properties. The trap: Extending a base component vs. replacing it entirely, candidates default to "replace" when the exam expects "extend."
Reference Implementations 15% The four checkout/payment reference implementations: CheckoutExtension interface, CartValidationOutput, IntegrationInfo/IntegrationStatus, Apex callouts with Named Credentials. The trap: Most developers have never touched these. They are specific to B2B Commerce and do not appear in standard Salesforce development work.
Data Management 15% Products/catalogs, buyer groups, junction records, external IDs, upsert operations, parent-child loading order, Bulk API 2.0, Change Data Capture, Platform Events, and idempotent integrations. The trap: Assuming standard data loader knowledge transfers directly. B2B Commerce record relationships have loading order dependencies that break naive imports.
Checkout Flow Development 10% Customizing checkout stages: shipping-address validation, delivery-method selection, PO numbers, external tax calculation, cart recalculation, stage validation, and order submission. The trap: Treating checkout as a single flow rather than a staged orchestration where each stage has specific extension points.
Error Handling and Diagnostics 10% Apex exceptions, AuraHandledException, LWC runtime errors, wire-adapter failures, Commerce API errors, OAuth token issues, browser dev tools, Apex debug logs, and trace flags. The trap: Knowing how to debug Apex is not enough, the exam tests whether you can isolate whether an issue originates in the browser, the component, Apex, or the Commerce API layer.

The single biggest misconception: Experienced Salesforce developers assume this exam is 80% general platform knowledge and 20% commerce specifics. It is the reverse. The 30% Advanced LWC domain and 15% Reference Implementations domain are commerce-specific. Your Platform Developer experience helps, but it will not carry you through those sections.

What You Will Learn by Practicing Here


  • Extend vs. replace LWC components : the exam consistently rewards extension over replacement for simple customizations. Only replace when the base component cannot meet the requirement.
  • The four reference implementations : CheckoutExtension for custom tax/shipping/payment, CartValidationOutput for buyer-facing errors, IntegrationInfo/Status for async processing feedback, and Named Credentials for external callouts. Know which does what.
  • ConnectApi.CommerceCartApi in Apex : adding items, retrieving carts, and deleting cart items programmatically using WebStore ID and effective account ID. Not direct DML on CartItem.
  • Checkout stage extension points : each stage (shipping, tax, payment) has a specific Apex handler interface. Know which interface plugs into which stage.
  • Data loading order dependencies : products before catalogs, accounts before buyer groups, parent records before junction records. The exam tests whether you know the sequence, not just the tools.
  • Layer-based error diagnosis : given a failure symptom, determine whether it is a browser error, an LWC error, an Apex exception, a Commerce API rejection, or an authentication issue.
  • When to use Platform Events vs. CDC vs. direct callouts : integration pattern selection for inventory, pricing, and order synchronization.

What Candidates Say After Using This Practice Bank


"I passed Platform Developer I and II, so I assumed AP-202 would be straightforward Apex and LWC. The Reference Implementations questions exposed a gap I did not know I had. The explanations did not just tell me the right answer, they explained why my instinct was wrong for this specific exam."


Marcus Chen-Okafor, Senior Salesforce Developer

"The extend vs. replace trap showed up in almost every LWC question I got wrong. This practice bank made the distinction obvious by tagging each question to the exact pattern the exam expects. I stopped guessing and started recognizing."


Priya Nair-Hartley, B2B Commerce Consultant

"I had hands-on checkout customization experience but never touched CartValidationOutput or the CheckoutExtension interface. The Data Management and Error Handling sections filled in the gaps that my project work did not cover. Passed on the first attempt."


Daniel Osei-Mensah, Technical Architect

Domain weights reflect the official Salesforce Accredited B2B Commerce Developer Professional exam guide. The exam contains 60 scored multiple-choice and multiple-select questions plus up to 5 unscored questions, with a 75-minute time limit and a passing score of 68%. No prerequisite is required, but Salesforce recommends hands-on B2B Commerce development experience and familiarity with LWC, Apex, and Experience Cloud administration.