Last updated: May 2026
AP-202 — B2B Commerce for Developers Accredited Professional
Test your knowledge with official exam-style questions
Questions and options are shuffled each attempt
▶B2B Commerce for Developers Accredited Professional — Practice Set 1: All Questions & Explanations
Full question text, answer options, and explanations for this practice set — a spoiler-free alternative is the interactive quiz above for scored, shuffled practice.
1. A developer is reviewing the B2B Commerce data model. Which standard Salesforce object stores a buyer's active shopping cart in a B2B Commerce storefront?
- A. Order
- B. WebCart(correct)
- C. Opportunity
- D. OpportunityLineItem
Explanation: WebCart is the standard Salesforce object that represents a buyer's active shopping cart in B2B Commerce on Salesforce. CartItem records hold the individual line items inside a WebCart. When checkout is completed, a standard Order record is created from the WebCart — it is not used as the active cart. Opportunity and OpportunityLineItem are Sales Cloud objects unrelated to the B2B Commerce cart model.
2. In B2B Commerce, which object controls which price books a set of buyers can access when shopping on a storefront?
- A. BuyerAccount
- B. BuyerGroupPricebook(correct)
- C. PricebookEntry
- D. WebStoreNetwork
Explanation: BuyerGroupPricebook is the junction object that links a Pricebook to a BuyerGroup in B2B Commerce, controlling which price books are available to buyers in that group. BuyerAccount links an Account to a store but does not directly control price book access. PricebookEntry defines individual product prices within a price book but does not control access at the buyer group level. WebStoreNetwork is not a standard B2B Commerce object.
3. A developer is modeling the buyer experience for a B2B Commerce implementation. Which THREE objects are directly associated with the BuyerGroup object? Choose 3.
- A. BuyerGroupMember(correct)
- B. BuyerGroupPricebook(correct)
- C. WebStoreBuyerGroup(correct)
- D. AccountBuyerGroup
- E. ContactBuyerGroup
Explanation: BuyerGroupMember links individual buyer accounts to a BuyerGroup (A). BuyerGroupPricebook associates a Pricebook with a BuyerGroup to control pricing entitlements (B). WebStoreBuyerGroup links a BuyerGroup to a specific WebStore, controlling which stores the group can access (C). AccountBuyerGroup (D) and ContactBuyerGroup (E) are not standard B2B Commerce objects — the correct junction between accounts and buyer groups is managed through BuyerGroupMember.
4. Which object in B2B Commerce is the core record that controls which products and prices a set of buyer accounts can see on a storefront?
- A. Account
- B. BuyerGroup(correct)
- C. Entitlement
- D. WebStoreNetwork
Explanation: BuyerGroup is the core object that controls product visibility and pricing for a set of buyer accounts in B2B Commerce. Catalog visibility and price book access are administered through BuyerGroup associations. Accounts represent the buyer company itself but do not directly govern storefront access policies. Entitlements (from Service Cloud) are unrelated. WebStoreNetwork is not a standard B2B Commerce object.
5. A developer finds that products are not visible to buyers on the storefront despite the products existing in a Pricebook with valid PricebookEntries. What is the MOST LIKELY missing configuration?
- A. The Product2 records must be set to 'IsActive = true' on each individual record
- B. The Pricebook must be linked to the BuyerGroup via a BuyerGroupPricebook record(correct)
- C. The Product2 records must have a related ContactPoint record
- D. The WebStore must have an active Entitlement Plan assigned
Explanation: Even if a Pricebook and its PricebookEntries exist, products will not be visible to buyers unless the Pricebook is linked to the relevant BuyerGroup through a BuyerGroupPricebook record. This entitlement link is what exposes the product catalog to the buyer group's members. IsActive on Product2 is a prerequisite but is not sufficient alone. ContactPoint is a Service Cloud construct unrelated to B2B Commerce catalog visibility. Entitlement Plans belong to Service Cloud, not B2B Commerce.
6. A developer needs to update the logo displayed on a B2B Commerce storefront. Where is this branding configuration managed?
- A. Setup > Sites and Domains
- B. The Theme panel in Experience Builder(correct)
- C. The Salesforce CMS workspace
- D. A custom Lightning Web Component deployed to the org
Explanation: Storefront branding including logos and color schemes is managed through the Theme panel within Experience Builder. Developers can upload images and configure visual identity here without code changes. Setup > Sites and Domains controls domain routing and certificates. CMS manages content items (banners, articles) rather than theme assets. A custom LWC is not required just to update a logo — the Theme panel provides a no-code configuration for this.
7. Which tool is used to manage the page layout and arrangement of Lightning Web Components on a B2B Commerce storefront page?
- A. Flow Builder
- B. Lightning App Builder
- C. Experience Builder(correct)
- D. Commerce Setup Assistant
Explanation: Experience Builder is the drag-and-drop tool used to design and arrange component layouts on a B2B Commerce storefront page. It provides a visual canvas for placing and configuring LWC components. Flow Builder orchestrates automated business processes. Lightning App Builder is for Salesforce internal (non-Experience Cloud) Lightning pages. The Commerce Setup Assistant guides initial store configuration steps but does not control page-level component layout.
8. A development team has built and tested a B2B Commerce storefront in a sandbox. They need to migrate the Experience Builder page layouts and storefront configuration to production without manually recreating each page. Which deployment strategy should the team use?
- A. Export the Experience Cloud site as a ZIP archive and import it in production
- B. Use Salesforce DX sf project deploy start targeting a scratch org to push to production
- C. Use a Change Set that includes the ExperienceBundle metadata type(correct)
- D. Manually recreate each page layout in production using Experience Builder
Explanation: B2B Commerce storefront page layouts are represented as the ExperienceBundle metadata type and can be migrated using Change Sets (which support ExperienceBundle) or Salesforce DX sf project deploy start from the source sandbox. Change Sets are the standard sandbox-to-production migration path. Exporting a ZIP archive is not a supported migration path for B2B Commerce storefronts. Salesforce DX scratch org deployments are used for development cycles, not for promoting sandbox changes to production. Manual recreation is error-prone and not scalable.
9. A developer needs to allow unauthenticated guest buyers to browse the B2B Commerce storefront without logging in. What must be configured to enable guest access?
- A. Enable 'Allow Guest Buyers' on the WebStore record and configure appropriate access on the Experience Cloud site's Guest User Profile(correct)
- B. Enable the Public Access checkbox in Setup > Sites and check 'Guest Users' in Experience Builder settings
- C. Create a Permission Set with 'View All' on Product2 and assign it to the Guest user profile
- D. Disable the 'Require Login' toggle in the Commerce Setup Assistant
Explanation: Enabling guest browsing in B2B Commerce requires toggling the Allow Guest Buyers setting on the WebStore record AND ensuring the Experience Cloud site's Guest User Profile has appropriate object-level and field-level access to view products, prices, and catalog data. Simply enabling public access at the Site level (B) does not configure B2B Commerce's specific guest entitlements. A Permission Set alone (C) does not satisfy the WebStore configuration requirement. There is no 'Require Login' toggle in the Commerce Setup Assistant (D) — that is not a valid configuration step.
10. Which configuration determines what catalog categories and products are visible to a specific set of buyers in a B2B Commerce storefront?
- A. A Product Catalog linked to a BuyerGroup through an Entitlement Policy(correct)
- B. A Pricebook assigned directly to each Account record via a custom field
- C. Theme Settings in Experience Builder that define the product visibility rules
- D. A Sharing Rule on the Product2 object scoped to the buyer's profile
Explanation: In B2B Commerce, a Product Catalog is surfaced to buyers through an Entitlement Policy that links the catalog to a BuyerGroup. Members of that BuyerGroup then see the catalog's categories and products on the storefront. Assigning a Pricebook to an Account controls pricing but does not control product catalog visibility. Theme Settings in Experience Builder control visual presentation, not data access. Sharing Rules on Product2 affect record-level security in the Salesforce org but do not control storefront catalog visibility for buyers.
11. A developer needs to customize the B2B Commerce checkout flow by executing custom business logic when totals are calculated — for example, applying a custom surcharge. Which Apex approach is officially recommended by Salesforce?
- A. Create an Apex trigger on the Order object using the 'after insert' event
- B. Implement a custom Apex class that extends CartExtension.CartCalculate(correct)
- C. Build a Record-Triggered Flow on CartItem to fire after a new item is created
- D. Use Process Builder to update the Cart Total field after checkout is initiated
Explanation: CartExtension.CartCalculate is the official Salesforce-supported Apex extension point for injecting custom logic into the B2B Commerce cart and checkout calculation pipeline. It allows developers to add custom pricing, taxes, surcharges, or validation during the calculation cycle. An Apex trigger on Order (A) fires after checkout is complete — too late to modify cart totals. Record-Triggered Flows on CartItem (C) fire on item changes but do not participate in the Commerce calculation pipeline. Process Builder (D) is deprecated and does not integrate with the B2B Commerce checkout engine.
12. A developer has implemented a custom CartExtension.CartCalculate class but discovers it is never invoked during checkout. The class compiles without errors. What is the MOST LIKELY cause?
- A. The class must implement System.Schedulable to be invoked by the checkout engine
- B. The custom calculator has not been registered in the WebStore's checkout configuration(correct)
- C. The class extends the wrong abstract type — it should extend Commerce.AbstractCartCalculate instead
- D. The class must be deployed inside a managed package before registration is possible
Explanation: Custom cart calculators must be explicitly registered against the WebStore record (via the Commerce > Checkout Settings or the WebStoreCheckoutSettings configuration object) to be invoked by the checkout engine. Without registration, the Commerce engine uses its default calculator and ignores the custom class entirely. System.Schedulable (A) is for scheduled Apex jobs and is unrelated to the checkout pipeline. CartExtension.CartCalculate is the correct type (C is wrong). Managed package deployment (D) is not a prerequisite for registering a custom calculator.
13. Which Salesforce API allows a developer to programmatically add a product to a buyer's cart in B2B Commerce from an external integration system?
- A. SOAP API using DML on the CartItem object
- B. Connect REST API — POST /commerce/webstores/{webstoreId}/carts/{cartId}/cart-items(correct)
- C. Bulk API 2.0 with CartItem as the target object
- D. Streaming API with a PushTopic on the CartItem object
Explanation: The Salesforce Connect REST API provides dedicated B2B Commerce endpoints for cart management, including adding items. This is the recommended and officially supported pattern for external system integrations. The SOAP API (A) can perform generic DML on CartItem but bypasses Commerce-specific calculation hooks such as price validation and cart rules. Bulk API (C) is designed for large-scale data loads and is not suitable for real-time cart interactions. Streaming API (D) is for receiving change notifications, not for writing data to cart records.
14. A developer is building a custom LWC product tile that displays real-time inventory quantity to buyers on a B2B Commerce storefront. Which TWO approaches are valid for retrieving inventory data? Choose 2.
- A. Call the Connect REST API GET /commerce/webstores/{webstoreId}/products/{productId} and read the inventoryInfo field from the response(correct)
- B. Use @wire(getProduct) from the commerce/productApi LWC module to retrieve product data including availability(correct)
- C. Use @wire(getRecord) with a SOQL query on ProductStockStatus to retrieve inventory counts
- D. Call an Apex method that queries ProductItemQuantity and returns the available quantity
Explanation: The Connect REST API product endpoint returns an inventoryInfo object containing stock level data (A). The commerce/productApi LWC wire adapter getProduct is the standard client-side approach for retrieving product details including availability information on B2B storefronts (B). ProductStockStatus (C) is not a standard Salesforce object for B2B Commerce storefront inventory. ProductItemQuantity (D) is part of Field Service Lightning, not the B2B Commerce inventory model, and querying it from Apex would not return B2B Commerce inventory data.
15. In B2B Commerce, how is a custom checkout step surfaced in the buyer-facing checkout flow?
- A. By deploying a Flow Definition with a 'Checkout Step' process type
- B. By building a Lightning Web Component and registering it in the WebStore's checkout flow configuration(correct)
- C. By creating a WebStoreCheckoutStep record in the Salesforce org
- D. By adding a new page named 'CheckoutStep' in Experience Builder
Explanation: Custom checkout steps in B2B Commerce are implemented as Lightning Web Components that implement the required checkout interface. They are then registered in the WebStore's checkout flow configuration (via Commerce > Checkout Settings in Experience Builder or the checkout configuration metadata). Flow Definition (A) defines automation flows, not storefront checkout steps. WebStoreCheckoutStep (C) is not a standard Salesforce object. Adding an Experience Builder page (D) creates a new URL-addressable page, not a step within the managed checkout flow sequence.
16. A merchant needs to apply a 10% discount to all items in the cart for buyers in the 'Preferred' BuyerGroup. The discount must be enforced server-side and cannot be bypassed by the client. Which approach should the developer use?
- A. Use a separate Pricebook with discounted PricebookEntries linked to the Preferred BuyerGroup via BuyerGroupPricebook(correct)
- B. Write a JavaScript function in the Cart Summary LWC that reduces displayed prices by 10%
- C. Create an Apex trigger on CartItem that sets SalesPrice to SalesPrice * 0.9 after insert
- D. Configure a Promotion with a 10% cart discount in Salesforce CMS
Explanation: Server-side pricing enforcement in B2B Commerce is achieved through the Pricebook and BuyerGroup model. A separate Pricebook containing PricebookEntries with 10%-discounted unit prices, linked to the Preferred BuyerGroup via BuyerGroupPricebook, ensures buyers in that group always see and pay the discounted price — enforced by the platform. A client-side JavaScript function (B) is a display-only hack that provides no server-side enforcement and can be bypassed. An Apex trigger on CartItem (C) directly modifying SalesPrice conflicts with the Commerce calculation engine and can cause data integrity issues. Salesforce CMS (D) manages editorial content, not commerce pricing.
17. Which service powers the product search functionality on a Salesforce B2B Commerce storefront?
- A. Salesforce SOSL (Salesforce Object Search Language)
- B. Salesforce CMS Search
- C. The Commerce Search index maintained by B2B Commerce(correct)
- D. Heroku-hosted Elasticsearch connected via a Named Credential
Explanation: B2B Commerce uses a dedicated Commerce Search index (backed by Salesforce's search infrastructure) to power storefront product search. The index must be configured and rebuilt after catalog changes. SOSL (A) is the general Salesforce Object Search Language for Apex and API queries — it is not used for storefront search. CMS Search (B) searches CMS content items, not the product catalog. Heroku-hosted Elasticsearch (D) is not part of the standard B2B Commerce architecture.
18. A developer needs to make a custom product field (Material__c) filterable as a facet on the B2B Commerce search results page. What must be done first?
- A. Add Material__c to the Search Layout of the Product2 object in Salesforce Setup
- B. Configure Material__c in the Commerce Search Index settings for the WebStore and rebuild the search index(correct)
- C. Write a SOSL query in an Apex class that filters products by Material__c value
- D. Enable Einstein Search in the org settings to unlock custom field faceting
Explanation: To expose a custom field as a search facet in B2B Commerce, the field must be added to the Commerce Search Index configuration for the WebStore (via Commerce > Search Settings), and the search index must be rebuilt for the change to take effect. Standard Salesforce Search Layouts (A) control fields shown in Salesforce UI global search results, not B2B Commerce storefront facets. Writing a SOSL query (C) is not part of the storefront search architecture. Einstein Search (D) is an AI-powered Salesforce search enhancement for the internal Salesforce UI, not a prerequisite for B2B Commerce facets.
19. A B2B Commerce storefront sells clothing with variants by size and color. A developer must model this so buyers can select size and color on the product detail page and add the correct variant to their cart. Which data model approach is correct?
- A. Create a separate Product2 record for each size-color combination, linked to a parent via a custom lookup field
- B. Use Product Variations with Product Attributes (Size, Color) defined on a parent product, linking variant Product2 records via ProductRelatedComponent(correct)
- C. Create an Opportunity with line items for each variant and link it to the WebCart during checkout
- D. Use a custom object Product_Variant__c with a lookup to Product2 and a custom storefront component to render the selector
Explanation: Salesforce B2B Commerce supports product variations natively using Product Attributes (e.g., Size, Color) defined on a parent product and individual variant Product2 records linked via ProductRelatedComponent. The storefront's variation selector component reads these relationships to display attribute options and map selections to the correct variant's SKU. Creating separate unrelated Product2 records (A) without the variation structure does not provide the platform-native variation selector UI. Opportunity line items (C) are Sales Cloud constructs unrelated to the B2B Commerce cart. A custom object (D) is not the supported pattern and does not integrate with the native variation selector component.
20. A developer must configure B2B Commerce so buyers purchasing 10 or more units of a product pay a lower unit price than buyers purchasing 1-9 units. Which feature should be used?
- A. PriceAdjustmentSchedule — a tiered pricing object that defines quantity-based price breaks(correct)
- B. A custom CartExtension.CartCalculate class that applies a discount when CartItem.Quantity >= 10
- C. Multiple PricebookEntries on the same Pricebook with different UnitPrice values differentiated by a Quantity field
- D. A Promotion with a 'Buy X get Y% off' discount rule scoped to quantities of 10 or more
Explanation: PriceAdjustmentSchedule is the native B2B Commerce object designed specifically for quantity-based (tiered) pricing. It defines price adjustment tiers with quantity thresholds, enabling automatic unit price reductions for bulk purchases without custom code. A CartExtension.CartCalculate class (B) can achieve this but is unnecessarily complex for a standard tiered pricing requirement that the platform natively supports. Standard PricebookEntries (C) do not have a native Quantity field for defining price tiers. Promotions (D) are designed for discount campaigns and coupon-based offers, not systematic tiered pricing.
21. When configuring a product Catalog in B2B Commerce, which TWO steps are required to make the catalog's categories visible to buyers on the storefront? Choose 2.
- A. Assign the Catalog to the WebStore in the Commerce management settings(correct)
- B. Link the Catalog to the BuyerGroup through an Entitlement Policy(correct)
- C. Publish the Catalog in the Salesforce CMS workspace
- D. Set each Category record's IsPublished field to true
Explanation: A Catalog must be assigned to the WebStore (A) so the store knows which catalog to use for its product listings. It must also be linked to the appropriate BuyerGroup via an Entitlement Policy (B) so the correct buyers have access to that catalog's categories and products. CMS (C) manages editorial content like banners and articles — it does not control product catalog assignments. IsPublished is not a standard field on the Category object in B2B Commerce (D); catalog visibility is controlled through the WebStore and BuyerGroup configuration.
22. After a buyer completes checkout in B2B Commerce, which standard Salesforce object is created to represent the placed order?
- A. Quote
- B. Opportunity
- C. Order(correct)
- D. WebCart with status changed to 'Closed'
Explanation: B2B Commerce creates a standard Salesforce Order record when checkout is completed. The Order record (and its associated OrderItems) serves as the post-purchase record of the transaction. The WebCart record's status transitions to 'Closed' upon checkout completion but does not become the order representation — it is the pre-order cart. Quote and Opportunity are Sales Cloud objects that are not created by the B2B Commerce checkout engine by default.
23. A developer is integrating an external ERP system that must be notified in near-real-time whenever a new Order is placed via B2B Commerce checkout. Which integration approach is most appropriate?
- A. Configure a scheduled Apex batch job that queries for new Orders every 5 minutes and sends data to the ERP
- B. Set up Salesforce Change Data Capture (CDC) on the Order object and have the ERP subscribe via the Streaming API(correct)
- C. Build a custom Visualforce page that the ERP polls via HTTP to retrieve new orders
- D. Create a scheduled report that emails new order data to the ERP integration team
Explanation: Change Data Capture (CDC) with Streaming API is the recommended near-real-time event-driven integration pattern for notifying external systems of Salesforce record changes. When an Order is created, CDC publishes a change event that the ERP subscribes to and processes asynchronously — typically within seconds. A batch job (A) introduces up to 5-minute delays, violating the near-real-time requirement. A polled Visualforce page (C) is an unsupported and architecturally fragile integration pattern. Scheduled reports with email delivery (D) are not machine-to-machine integration and introduce variable delays.
24. A retailer using B2B Commerce needs to prevent checkout completion if any cart item is out of stock, verified via an external inventory API. This check must be server-side and cannot be bypassed by modifying client-side code. Where should this logic be implemented?
- A. In a JavaScript function within the Cart Summary LWC that calls the external inventory API before rendering the Checkout button
- B. In a custom CartExtension.CartCalculate Apex class that performs a callout to the inventory API via a Named Credential and adds a CartValidationOutput error if stock is insufficient(correct)
- C. In an Apex trigger on CartItem that calls the inventory API on every CartItem save and throws an exception if stock is zero
- D. In a Record-Triggered Flow on CartItem that uses an HTTP Action step to call the inventory API
Explanation: The CartExtension.CartCalculate class is the officially supported server-side extension point for B2B Commerce checkout validation. It can perform callouts via Named Credentials and return validation errors through CartValidationOutput, which surfaces user-facing messages in the checkout UI and prevents progression. This cannot be bypassed by client-side manipulation. A client-side JavaScript check (A) is display-only and completely bypassable. An Apex trigger on CartItem (C) fires on every item save — not just at checkout — and mixing callouts in triggers introduces governor limit and async complexity issues. Record-Triggered Flows with HTTP Actions (D) are not the recommended Commerce checkout extension point and do not integrate cleanly with the checkout pipeline.
25. A developer is implementing a 'Reorder' feature that allows buyers to repopulate a cart from a previous Order. Which TWO standard approaches should be used to implement this feature? Choose 2.
- A. Clone the Order object and its OrderItems using the SOAP API to create a new duplicate Order
- B. Use the Connect REST API to create a new WebCart, then add items from the previous Order's OrderItems via the cart-items endpoint(correct)
- C. Call a CartItemAdd invocable Apex action from a Flow that reads OrderItems from the previous Order
- D. Query the previous Order and OrderItem records using SOQL and create CartItem records in a custom Apex class(correct)
Explanation: Using the Connect REST API (B) is the recommended approach for external-facing or LWC-initiated cart creation and item population — it uses the official B2B Commerce endpoints (POST /commerce/webstores/{id}/carts and POST .../cart-items) which enforce commerce business rules. Alternatively, querying Order/OrderItems via SOQL and creating CartItem records through a custom Apex class (D) is a valid server-side programmatic approach that works within the B2B Commerce data model. Cloning the Order via SOAP API (A) creates another fulfilled Order record, not an active shopping cart. CartItemAdd is not a documented standard Salesforce invocable Apex action name (C).