Last Updated On : 7-Apr-2026


Salesforce Accredited B2B Commerce Developer - AP-202 Practice Test

Prepare with our free Salesforce Accredited B2B Commerce Developer - AP-202 sample questions and pass with confidence. Our B2B-Commerce-Developer practice test is designed to help you succeed on exam day.

211 Questions
Salesforce 2026

How can a developer bring in a checkout flow step to another sequence order?

A. drag and drop checkout Screens in main checkout flow

B. drag and drop subflows in main checkout flow

C. Adjust next-state in previous subflow configuration

D. Reorder step in checkoutSteps.xml

C.   Adjust next-state in previous subflow configuration

Explanation:

In Salesforce B2B Commerce (particularly in the Aura/Visualforce-based template and older checkout implementations tested in the B2B-Commerce-Developer exam), the checkout process is built using a main checkout Flow that orchestrates a sequence of subflows (for example, Shipping Address subflow → Shipping Method → Payment → Review/Order).

To change the sequence order of a checkout step (for example, move Payment before Shipping or insert a custom step earlier), you adjust the next-state attribute/property in the configuration of the previous subflow.

Each subflow has a configuration (often in Flow Builder or metadata) that defines its next-state — this points to the API name or identifier of the following subflow/step.

By updating next-state on the subflow immediately before the one you want to reposition, you effectively reroute the flow sequence (for example, change the Shipping subflow’s next-state from "Payment" to "CustomStep", then set CustomStep’s next-state to "Payment").

This provides dynamic, pointer-based control over the order without restructuring the entire main flow or editing XML files directly.

This method is flexible, upgrade-safe, and aligns with how Salesforce recommends customizing checkout sequences in subflow-based architectures.

Why the Other Options Are Incorrect

A. Drag and drop checkout Screens in main checkout flow
Incorrect. In Aura-based B2B Commerce, checkout does not use drag-and-drop screens in the main flow like LWR sites do in Experience Builder. Screens are more relevant to Screen Flows, but B2B checkout relies on subflows and state transitions.

B. Drag and drop subflows in main checkout flow
Incorrect. The main checkout flow does not support direct drag-and-drop reordering of subflows in Flow Builder or Experience Builder for the classic/Aura template. Sequence is controlled via configuration (next-state), not visual reordering.

D. Reorder step in checkoutSteps.xml
Incorrect and a distractor. There is no standard checkoutSteps.xml file in B2B Commerce for reordering steps. In LWR templates, checkout is component-based and reordered in Experience Builder, but this exam question aligns with the subflow/next-state pattern for the tested version.

References
B2B Commerce Developer Guide — Sections on Checkout Subflows, Customizing Checkout, and Flow Configuration (describes subflow chaining via state/next-state transitions).

Salesforce Help — Customize Checkout in B2B Commerce and checkout flow architecture notes (emphasize subflow orchestration and configuration adjustments over XML or drag-and-drop in Aura contexts).

Salesforce B2B Commerce natively provides a robots.txt file, however, a customer can also create its own version.Which three scenarios are valid reasons for customer to create their own robots.txt file? (3 answers)

A. The customer wants to reference multiple storefront sitemap indexes in a single robots.txt file

B. The customer wants to reference a custom sitemap index.

C. The customer wants to have multiple robot.txt files in a single Salesforce Community.

D. The customer's store is not located at the rootof their domain.

E. robot.txt only works if there is one storefront in the org

A.   The customer wants to reference multiple storefront sitemap indexes in a single robots.txt file
B.   The customer wants to reference a custom sitemap index.
D.   The customer's store is not located at the rootof their domain.

Explanation:

Salesforce B2B Commerce (Visualforce-based) provides a default robots.txt file (via the cc_RobotsTxT page) that includes a basic Sitemap: entry pointing to the generated sitemap index (for example, /apex/ccrz__CCSiteIndex).

However, customers often need to create a custom robots.txt file (uploaded as a static resource or configured via Experience Builder / site settings) to override or extend this default behavior. The main documented and exam-tested scenarios for doing so are:

A. The customer wants to reference multiple storefront sitemap indexes in a single robots.txt file
Valid. In multi-storefront setups (multiple B2B storefronts under one org/domain), the default robots.txt only references one sitemap index. A custom file allows listing multiple Sitemap: lines (supported by the robots.txt specification) for different storefronts or sub-paths.

B. The customer wants to reference a custom sitemap index
Valid. If the customer generates a custom sitemap (for example, via code, external tool, or modified category/product sitemaps), they must create a custom robots.txt to include the Sitemap: [https://.../custom-sitemap-index.xml](https://.../custom-sitemap-index.xml) directive — the default will not point to it.

D. The customer's store is not located at the root of their domain
Valid. If the storefront uses a subfolder (for example, [https://www.mydomain.com/shop/](https://www.mydomain.com/shop/) instead of root /), the default robots.txt assumes root-level access and may not route correctly or may cause crawl issues. A custom robots.txt ensures proper Disallow: and Sitemap: paths relative to the subfolder.

Why the Other Options Are Incorrect

C. The customer wants to have multiple robot.txt files in a single Salesforce Community
Invalid. robots.txt follows the standard web rule: only one robots.txt per domain/host/port. Salesforce Experience Cloud (Communities) sites enforce this — you cannot have multiple active robots.txt files for the same site/domain. Attempting this would cause conflicts or be ignored by crawlers.

E. robot.txt only works if there is one storefront in the org
Invalid and false statement. The default robots.txt works with multiple storefronts, but it is limited (for example, a single sitemap reference). Custom robots.txt is precisely for handling multi-storefront or complex scenarios better — not because it only works with one.

References
Salesforce Help: Control Traffic from Search Engines with robots.txt (B2B Commerce SEO section) — Notes the default file and the ability to create a custom robots.txt for advanced control, including sitemap references.

Salesforce Help: Generate Dynamic Sitemaps for Storefront Categories — Explicitly states that when you create a custom sitemap, also create a custom robots.txt file to point search engine bots to your custom sitemap.

Exam Tip
This question tests understanding of SEO limitations in B2B Commerce Visualforce storefronts versus custom overrides. Focus on when the default falls short: multi-sitemaps, custom sitemaps, and non-root paths. Options about multiple robots.txt files are distractors, since that is not supported per web standards.

In what way can a developer's code subscribe to platform events?

A. Flows and Apex Triggers

B. Flows

C. Apex Triggers

D. Process Builder, Apex Triggers and Flows

A.   Flows and Apex Triggers

Explanation:

In Salesforce, developer code can subscribe to platform events through two primary programmatic methods:

Apex Triggers:
Developers can write Apex triggers on platform event objects. These triggers execute synchronously when the platform event is published, allowing for real-time processing of event data.

Flows:
Developers can create flow processes that start when a platform event is received. Flows provide a declarative way to subscribe to and process platform events.

Why the Other Options Are Incomplete or Incorrect:

B:
While Flows can subscribe to platform events, this option is incomplete because it omits Apex Triggers, which are also a valid way for developer code to subscribe.

C:
While Apex Triggers can subscribe to platform events, this option is incomplete because it omits Flows.

D:
This option is incorrect because Process Builder cannot directly subscribe to platform events. While Process Builder can be triggered by platform events indirectly through Flows, it is not itself a subscriber technology for platform events.

Reference:
Salesforce Developer Guide: Platform Event Trigger Considerations and Process Builder and Platform Events

An administrator has just provided a developer with a completely new org and a username. Assuming the username is me@my-new-org.org, what is the correct set of steps to authorize the org for Command Line Interface (CLI) access so the developer can deploy Lightning web components?

A. Run the command: 'sfdx force:login -r "https://login.salesforce.com'' and supply the credentials in the browser when it opens.

B. Run the command 'sfdx force:auth:web:login -a "https://login.salesforce.com'"' and then supply the credentials in the browser when it opens.

C. Run the command: 'sfdx force:auth:web:login -r "https://login.salesforce.com" and then supply the credentials in the ^ browser when it opens ^

D. Run the command 'sfdx force:auth:web:login -r "https://login.salesforce.com" - username^'mefaJmy-new-org.org"'

C.   Run the command: 'sfdx force:auth:web:login -r "https://login.salesforce.com" and then supply the credentials in the ^ browser when it opens ^

Explanation:

To authorize a new Salesforce org for development using the Salesforce CLI, the Web Server Authentication Flow is the standard approach.

sfdx force:auth:web:login:
This is the specific command used to initiate the OAuth 2.0 web-based authorization flow.

-r (or --instance-url):
This flag specifies the login URL. Since it is a new production or developer org (as indicated by the standard username format), [https://login.salesforce.com](https://login.salesforce.com) is the correct endpoint.

The Browser Step:
After running the command, the CLI opens your default web browser. Once you enter the credentials for [me@my-new-org.org](mailto:me@my-new-org.org) and click Allow, a local token is stored, granting the CLI access to deploy code.

Why Other Options Are Incorrect

A:
force:login is not a valid Salesforce CLI command for authorization.

B:
The -a flag stands for alias (for example, -a MyNewOrg). It is used to give the org a nickname, not to specify the login URL.

D:
While specifying the username via a flag is possible in some advanced flows (such as JWT), the standard web:login flow identifies the user via the browser session, and the syntax provided in this option is malformed.

Pro-tip for the Exam:
While Salesforce is transitioning to the new sf command (for example, sf org login web), the AP-202 exam currently focuses on the established sfdx syntax.

Which two technologies can subscribe to the Commerce Diagnostic Events event?

A. Aura Components

B. Processes

C. Streaming API

D. Lightning web components

B.   Processes
C.   Streaming API

Explanation:

The CommerceDiagnosticEvent in Salesforce B2B Commerce is a platform event that tracks checkout, pricing, search, and other activity to help monitor and diagnose issues.

Processes (Flows/Process Builder):
Platform events can be subscribed to by declarative tools like Processes (Process Builder or Flow). This allows admins to automate responses to diagnostic events without writing code.

Streaming API (CometD):
Developers can subscribe to platform events using the Streaming API. This enables external systems or custom apps to listen in real time for diagnostic events and act on them.

Aura Components / Lightning Web Components:
These do not directly subscribe to platform events. They can consume data indirectly (for example, via Apex controllers or Pub/Sub API), but they are not supported subscribers for CommerceDiagnosticEvent out of the box.

Why the Other Options Are Incorrect

A. Aura Components
Not supported directly as subscribers.

D. Lightning Web Components
Same as Aura; they cannot directly subscribe to CommerceDiagnosticEvent.

Reference

Salesforce Developer Guide: CommerceDiagnosticEvent
Supported subscribers include Apex Triggers, Flows, Processes, Pub/Sub API, and Streaming API (CometD). Aura and Lightning Web Components are not listed as supported subscribers.

B2B-Commerce-Developer Exam Questions - Home Previous
Page 5 out of 43 Pages