Top 125 Salesforce Commerce Cloud Interview Questions & Answers 2026 — B2C, B2B, SFRA, PWA Kit

Top 125 Salesforce Commerce Cloud Interview Questions 2026 — B2C, B2B, SFRA, PWA Kit | SF Interview Pro
☁️ Salesforce Commerce Cloud 2026

Top 125 Salesforce Commerce Cloud Interview Questions 2026

Complete Commerce Cloud interview prep — B2C Architecture, SFRA, Cartridge Development, OCAPI/SCAPI, PWA Kit, B2B Commerce, Integration Patterns and real-world scenarios. Free. No paywall.

125Questions
7Sections
B2C+B2BCoverage
100%Free
← All Topics Architecture Q&As
🏗️

B2C Architecture & SFRA

Q1–Q20 · Foundation of every Commerce Cloud interview

Q1
What is Salesforce B2C Commerce vs B2B Commerce?
⚡ Direct Answer
B2C Commerce (formerly Demandware) is a standalone cloud ecommerce platform for consumer storefronts — high-volume anonymous shopping, promotions, checkout. B2B Commerce (formerly CloudCraze) is native on Salesforce platform using Apex, LWC, Flows — designed for business-to-business buying with account-based pricing.
AspectB2C CommerceB2B Commerce
PlatformStandalone (Demandware)Native Salesforce
DevelopmentServer-side JS, ISML, CartridgesApex, LWC, Flows
APIOCAPI / SCAPIConnectApi / REST
AuthOCAPI JWTSalesforce Session
🎯 Key Points
B2C: own infrastructure, Business Manager, OCAPI ecosystem | B2B: Salesforce orgs, standard DevOps | Most enterprises use BOTH integrated via MuleSoft
🏢 XYZ Company
At XYZ Company, B2C served retail distributors. B2B handled industrial customers with contract pricing and approval workflows. Two platforms integrated via MuleSoft — each serving different buyer personas.
🎤 "B2C Commerce is a standalone ecommerce platform; B2B Commerce is natively Salesforce — fundamentally different architectures for different buyer personas."
Q2
What is SFRA and how does it differ from SiteGenesis?
⚡ Direct Answer
SFRA (Storefront Reference Architecture) is Salesforce's modern B2C Commerce architecture using MVC with Express.js-inspired routing. SiteGenesis was the legacy pipeline-based monolithic approach requiring core code modification for customization.
AspectSiteGenesisSFRA
PatternPipeline-basedMVC (Express-inspired)
CustomizationModify core filesExtend via middleware
StatusLegacy (maintenance)Current standard
NextDeprecatedPWA Kit (future)
🎯 Key Points
SFRA: all new implementations | SiteGenesis: maintenance mode only | PWA Kit: next evolution | server.append is the primary extension mechanism
🏢 XYZ Company
At XYZ Company, SiteGenesis upgrades took 3 months. SFRA migration: 8 months but upgrades now take 2 weeks. All customizations isolated in custom cartridges — zero core modifications.
🎤 "SFRA replaced SiteGenesis's monolithic pipelines with MVC middleware routing — enabling clean cartridge-based customization without modifying core code."
Q3
What is a cartridge and how does the cartridge system work?
⚡ Direct Answer
A cartridge is a self-contained B2C Commerce module (controllers, models, templates, scripts, static assets). Stacked in a cartridge path — platform resolves resources left (highest priority) to right (lowest/core). Enables customization without modifying base code.
TypePurpose
Custom cartridgeBusiness-specific customizations
Plugin cartridgeFeature add-ons (payment, tax)
Base cartridgeSFRA core functionality
Link cartridgeThird-party integrations
🎯 Key Points
Cartridge path: Business Manager → Administration → Sites → Settings | Left = highest priority | Never modify base cartridge files | Structure: controllers/, models/, templates/, scripts/, static/
🏢 XYZ Company
At XYZ Company, path: app_xyz_core:plugin_giftcard:int_stripe:app_storefront_base. Custom polymer logic in app_xyz_core. Zero core files modified. Upgrades: just update app_storefront_base version.
🎤 "Cartridges are self-contained modules in a priority-ordered path — the platform resolves resources left-to-right enabling override without modifying core code."
Q4
What is the MVC pattern in SFRA?
⚡ Direct Answer
SFRA implements MVC: Controllers (cartridge/controllers/) handle HTTP routes via server.get/post middleware. Models (cartridge/models/) wrap dw.* APIs with presentation logic. Templates (cartridge/templates/default/) are ISML files rendering HTML using viewData.
🎯 Key Points
Controller: receives request → calls model → res.render() with viewData | Model: wraps dw.catalog.Product with formatted price, availability | Template: ISML accesses viewData — zero business logic in templates | next() must always be called — omitting breaks the middleware chain
🏢 XYZ Company
At XYZ Company, Product controller extended via server.append adding polymerGrade to viewData. Model wrapped dw.catalog.Product adding polymer-specific fields. ISML rendered polymer grade selector. Clean MVC — zero business logic in templates.
🎤 "SFRA's MVC uses controllers for routing, models wrapping dw.* APIs, and ISML templates for rendering — server.append enabling clean extension without replacing core logic."
Q5
What is the difference between server.get, server.append, server.prepend, and server.replace?
⚡ Direct Answer
server.get/post: define new route. server.append: adds middleware AFTER existing — runs after core. server.prepend: adds BEFORE — runs before core. server.replace: completely replaces ALL existing middleware — breaks inheritance.
MethodTimingUse CaseRisk
server.appendAfter coreAdd data to viewDataLow — recommended
server.prependBefore coreAuth checks, redirectsMedium
server.replaceReplaces allComplete rewriteHigh — breaks upgrades
🎯 Key Points
server.append is safest — use 90% of time | server.replace breaks upgrade compatibility | next() must be called — omitting breaks chain | res.getViewData()/setViewData() for extending
🏢 XYZ Company
At XYZ Company, server.append added polymer data to PDP. server.prepend validated minimum quantities before cart. server.replace used once — completely custom checkout.
🎤 "server.append adds after core (safest), server.prepend before (for guards), server.replace overwrites — use append by default."
Q6
What is Business Manager in B2C Commerce?
⚡ Direct Answer
Business Manager is B2C Commerce's web-based admin UI: Merchant Tools (catalog, products, pricing, promotions, content), Marketing (SEO, A/B tests, Einstein), Ordering (orders, inventory), Site Preferences, Administration (cartridge path, OCAPI config, code deployment).
🎯 Key Points
Roles: Merchant, Developer, Admin | Code deployment: Administration → Code Deployment | Each sandbox/staging/production has own Business Manager | OCAPI config: Administration → Sites → OCAPI Settings | Custom Objects: Merchant Tools → Custom Objects
🏢 XYZ Company
At XYZ Company, merchandising used Business Manager daily for promotions and catalog. Developer team used it for cartridge deployment and OCAPI config. Clean separation — merchants independent of developers.
🎤 "Business Manager is B2C Commerce's merchant and administrator control panel — catalog, promotions, ordering, content, and technical configuration in one web interface."
Q7
What is multi-site architecture in B2C Commerce?
⚡ Direct Answer
A Site is an independently configured storefront. Each has its own catalog assignment, price books, promotions, locale/currency, and cartridge path. Multiple sites share one codebase — multi-brand or multi-region storefronts from one deployment.
ConfigurationScope
Master catalogOrganization (shared)
Site catalogPer site (isolated)
Price booksPer site
Cartridge codeOne deployment, all sites
🎯 Key Points
Organization → Realm → Sites hierarchy | New market = only BM config, zero code deployment | OCAPI: ?siteId= parameter scopes per site | Customer lists: can be shared (cross-site login)
🏢 XYZ Company
At XYZ Company, 3 sites: xyz-india (INR), xyz-europe (EUR, 3 languages), xyz-wholesale (USD). One cartridge deployment served all. New German site: only Business Manager config.
🎤 "B2C multi-site allows one codebase to power multiple storefronts — each independently configured with catalog, price books, promotions, and locale."
Q8
What is the difference between Master Product and Variation Product?
⚡ Direct Answer
Master Product: parent containing shared attributes and defining variation attributes (color, size). Variation Products: purchasable children — specific combinations. Only variations have inventory, prices, and can be added to cart. Master is never purchasable.
AspectMasterVariation
PurchasableNoYes
InventoryNoYes
PriceDefault onlySpecific
SKUGenericSpecific (SHIRT-RED-M)
🎯 Key Points
Only variants are orderable — critical interview point | OCAPI: fetch master for variation data, variant for purchasable | Variants generated from combinations of variation attributes
🏢 XYZ Company
At XYZ Company, silicone tube master defined diameter (10/15/20mm) and hardness (Shore 40/60/80). Each combination = purchasable variant with own inventory and price.
🎤 "Master defines variation attributes but is never purchasable — Variation Products are the specific purchasable combinations with their own inventory, pricing, and SKU."
Q9
What are Price Books in B2C Commerce?
⚡ Direct Answer
Price Books are containers of product prices with currency, site assignments, and product-to-price mappings. Multiple price books can be active simultaneously — resolved by priority. Customer groups assigned specific price books for personalized pricing.
TypeUse Case
List Price BookStandard MSRP — always active
Sale Price BookPromotional — time-bounded
Volume Price BookQuantity-based tiers
Customer Group BookVIP or wholesale pricing
🎯 Key Points
Priority order: highest priority book wins | Date ranges: price books can be date-bounded | One currency per price book | Multi-currency: separate books per currency
🏢 XYZ Company
At XYZ Company, 4 price books: Standard (list), Summer_Sale_2026 (20% off, June-Aug), Distributor_VIP (15% off VIP group), EUR_Standard. VIP customer in summer received lowest price automatically.
🎤 "Price books are product price containers — multiple active books resolve by priority, enabling simultaneous list, promotional, and customer-group-specific pricing."
Q10
How do Campaigns and Promotions relate?
⚡ Direct Answer
Campaigns are scheduling containers (when, who, trigger). Promotions are discount rules. Campaign can contain multiple Promotions. A Promotion ONLY activates through a Campaign — cannot activate without one.
ComponentControls
CampaignWhen, who, trigger (coupon/source code)
PromotionWhat discount, which products, conditions
CouponCustomer-entered code trigger
Source CodeURL-based campaign trigger
🎯 Key Points
One Campaign → many Promotions | Promotion stacking: configurable | Exclusivity: Product, Order, or Global level | Custom promotion scripts for complex declarative limitations
🏢 XYZ Company
At XYZ Company, Summer Campaign (June-Aug, all customers): 3 promotions — 20% off polymer tubing, free shipping over £100, £20 voucher over £500. VIP Campaign (permanent, VIP group): 15% off. Scheduling separated from discount logic.
🎤 "Campaigns are scheduling containers that activate Promotions — a Promotion can only be active through a Campaign, separating schedule management from discount rule definition."
Q11
What are Custom Objects in B2C Commerce?
⚡ Direct Answer
Custom Objects are developer-defined data structures in B2C Commerce's database for application-specific data. Use for: user configurations, wishlists, application state, subscription data. Accessed via CustomObjectMgr and OCAPI Data API.
🎯 Key Points
CustomObjectMgr.createCustomObject(), getCustomObject(), queryCustomObjects() | Key attribute required per type | Transaction.wrap() required for all writes | Business Manager: Merchant Tools → Custom Objects | OCAPI Data API: /data/v23_1/custom_objects/{type}/{key}
🏢 XYZ Company
At XYZ Company, ProductConfiguration custom object stored user-saved polymer configurations linked to customer ID. Customers saved and reloaded configurations across sessions — no separate database needed.
🎤 "Custom Objects are developer-defined B2C Commerce data structures — requiring Transaction.wrap() for writes and accessible via both scripts and OCAPI Data API."
Q12
What is ISML?
⚡ Direct Answer
ISML (Internet Store Markup Language) is B2C Commerce's server-side templating language extending HTML with conditional rendering, loops, and includes. Templates access viewData (SFRA) or pdict (SiteGenesis) and compile to cached Java bytecode.
TagPurpose
Conditional rendering
Iteration
Include partial
Layout decoration
🎯 Key Points
pdict: SiteGenesis data | viewData: SFRA equivalent | ${variable} syntax for output | Template resolution follows cartridge path | No business logic in templates — presentation only
🏢 XYZ Company
At XYZ Company, product detail ISML: for add-to-cart, for variation selectors, for image gallery. Zero business logic in ISML.
🎤 "ISML is B2C Commerce's server-side templating extending HTML with , , — compiled to Java bytecode, accessing controller data via viewData/pdict."
Q13
What are Hooks in B2C Commerce?
⚡ Direct Answer
Hooks are B2C Commerce extension points — predefined platform events where custom code is injected via hooks.json. Enable: payment gateway integration (app.payment.processor.*), tax calculation (app.tax.calculate), shipping calculation, order submission.
🎯 Key Points
hooks.json maps hook name to script path | Built-in: app.payment.processor.Authorize, app.tax.calculate, app.shipping.calculate | HookMgr.callHook() to invoke | Multiple cartridges can register for same hook | New payment method = new cartridge with hooks.json, zero core changes
🏢 XYZ Company
At XYZ Company, Stripe integration: hooks.json registered app.payment.processor.Authorize → StripeAuthorize.js. New payment method added with zero checkout controller changes.
🎤 "B2C Commerce hooks inject custom code at predefined platform events via hooks.json — enabling payment, tax, and shipping integrations without modifying core checkout logic."
Q14
What is the dw.* API?
⚡ Direct Answer
The dw.* API is B2C Commerce's synchronous server-side JavaScript API for all platform operations — catalog, customers, orders, custom objects, system utilities, HTTP callouts.
NamespaceKey Use
dw.catalogProductMgr — product retrieval
dw.customerCustomerMgr, BasketMgr
dw.orderOrderMgr — order lifecycle
dw.objectCustomObjectMgr — custom data
dw.systemTransaction, Site, Logger
dw.netHTTPClient — external callouts
🎯 Key Points
All dw.* is synchronous — no promises | Transaction required for ALL writes | ProductMgr.getProduct(pid) most common | BasketMgr.getCurrentOrNewBasket() for cart | Logger.error/debug for logging
🏢 XYZ Company
At XYZ Company, polymer pricing script used ProductMgr, priceModel.getPrice(), HTTPClient for ERP stock, Transaction.wrap() for Custom Object update. Standard dw.* throughout.
🎤 "The dw.* API is B2C Commerce's synchronous server-side JavaScript API — Transaction.wrap() required for all writes, HTTPClient for external integrations."
Q15
What are B2C Commerce performance best practices?
⚡ Direct Answer
Key practices: minimal cartridge path, template caching with , selective attribute loading, no HTTPClient in render path, Platform Cache for expensive data, no business logic in ISML.
Anti-PatternFix
HTTPClient in render pathCache or async
Loading all attributesSelect 8-10 needed only
No template caching with TTL
Long cartridge pathMinimize cartridge count
🎯 Key Points
for caching | ProductSearchModel with explicit attribute selection | Cache external API data in Custom Object refreshed by Job | Logger.error only in production
🏢 XYZ Company
At XYZ Company, PDP: 4.2s → 1.1s. Three fixes: HTTPClient ERP call cached in Custom Object (800ms saved), attributes reduced 80→12 (1.4s saved), template caching added (0.9s saved).
🎤 "B2C Commerce performance requires selective attribute loading, template caching, Platform Cache for expensive data, and no synchronous external callouts in the render path."
Q16
What is the B2C Commerce Order Lifecycle?
⚡ Direct Answer
Basket (active cart) → Order placed via OrderMgr.placeOrder() (status: NEW) → Order Confirmed → Order Exported (EXPORT_STATUS_READY for ERP) → Order Completed or Cancelled.
🎯 Key Points
Basket vs Order: Basket temporary, Order permanent | Status: NEW → OPEN → COMPLETED | Export status: READY = ERP should pick up | OrderMgr.failOrder() for failed payment — returns inventory | app.order.created hook for post-placement processing
🏢 XYZ Company
At XYZ Company: placed (NEW) → payment authorized (OPEN) → nightly job exports EXPORT_STATUS_READY to SAP → SAP confirms (EXPORTED) → shipped (COMPLETED). Failed payments: OrderMgr.failOrder() restores inventory.
🎤 "B2C orders flow Basket → NEW → OPEN → COMPLETED — with export status managing ERP integration and hooks enabling custom post-placement processing."
Q17
What are Jobs in B2C Commerce?
⚡ Direct Answer
Jobs are scheduled batch processes configured in Business Manager — running server-side JavaScript steps in sequence. Uses: product imports, price book imports, order exports to ERP, inventory updates.
🎯 Key Points
Built-in: ImportProducts, ImportPricebooks, ExportOrders | Custom: implement dw.job.AbstractStep | Job logs: Administration → Operations → Jobs | SFTP: standard data exchange mechanism | Scheduling: cron-based via Business Manager
🏢 XYZ Company
At XYZ Company, 3 nightly jobs: ImportProducts (11PM, 50K products via SFTP XML), ExportOrders (midnight, to SAP), ImportInventory (2AM, from WMS). Built-in steps with custom transformation scripts.
🎤 "B2C Commerce Jobs are scheduled batch processes — the standard mechanism for catalog imports, order exports, inventory updates, and high-volume data processing."
Q18
What are Custom Preferences in B2C Commerce?
⚡ Direct Answer
Custom Preferences are developer-defined configuration values added to Site Preference — stored per site, accessible via Site.getCurrent().getCustomPreferenceValue(). Types: boolean, integer, string, set-of-string. No code deployment to change values.
🎯 Key Points
Never hardcode configuration in scripts | Feature flags: boolean preference per site | Environment-specific endpoints: string preference for API URLs | Define: Administration → Sites → [site] → Preferences → Custom | Access: Site.getCurrent().getCustomPreferenceValue('prefName')
🏢 XYZ Company
At XYZ Company, EnablePolymerConfigurator (boolean) toggled configurator per site. ERP_Endpoint (string) stored API URL per environment. Zero code deployments to change configuration.
🎤 "Custom Preferences extend Site Preferences with developer-defined configuration — enabling feature flags and environment-specific settings without code deployments."
Q19
What is Einstein Recommendations in B2C Commerce?
⚡ Direct Answer
Einstein Recommendations is B2C Commerce's AI recommendation engine analyzing behavioral data (views, purchases, basket adds) to generate recommendation zones (You May Also Like, Recently Viewed, Trending). Configured in Business Manager, rendered via JavaScript widgets or OCAPI.
🎯 Key Points
Zone IDs: each placement has a zone ID | Types: Product-to-Product, User-to-Product, Recently Viewed | Einstein Activity Tag: JS beacon collects behavior | 14+ days data needed for training | OCAPI: /shop/v23_1/einstein/recommendations
🏢 XYZ Company
At XYZ Company, 4 Einstein zones: pdp-recs, cart-recs, home-trending, recently-viewed. Async JavaScript widget per zone. PDP conversion rate improved 18% after Einstein implementation.
🎤 "Einstein Recommendations analyzes behavioral data to generate personalized zones — configured via Business Manager zone IDs and rendered asynchronously via JavaScript widgets."
Q20
What is B2C Commerce environment architecture?
⚡ Direct Answer
Three environments: Sandbox (developer environment — isolated, resettable), Staging (production-like for QA and performance testing), Production (live commerce). Code flows: Sandbox → Staging → Production via Business Manager code promotion.
EnvironmentPurposeData
SandboxDevelopmentSynthetic
StagingPre-production QAProduction copy
ProductionLive commerceReal customers
🎯 Key Points
WebDAV for sandbox development | sfcc-ci CLI for CI/CD pipelines | BM → Code Deployment for promotion | Staging refreshed from production for realistic testing | Multiple sandboxes: dev, QA, integration
🏢 XYZ Company
At XYZ Company: commit → sfcc-ci to dev sandbox → tests → promote to staging → 2-hour test suite → change control → production in maintenance window.
🎤 "B2C Commerce environments progress Sandbox → Staging → Production — WebDAV for developer iteration, sfcc-ci CLI for automated CI/CD pipeline promotion."
🛒

Cartridge Development

Q21–Q40 · Controllers, models, templates, OCAPI extension

Q21
What is the superModule pattern in SFRA?
⚡ Direct Answer
superModule loads the same-named module from the next cartridge in the path — enabling extension of parent functionality without code duplication. var base = module.superModule; then extend base with custom logic.
🎯 Key Points
var base = module.superModule; module.exports = Object.assign({}, base, { myMethod: function(){} }); | If no parent, superModule is null — always check | Difference from require: superModule is inheritance from next cartridge, require is any path
🏢 XYZ Company
At XYZ Company, product model extended via superModule: added polymerGrade and temperatureRating to base SFRA model. Zero duplication — all base logic inherited.
🎤 "superModule enables SFRA cartridge inheritance — loading the same-named script from the next cartridge for extension without code duplication."
Q22
How do you extend a controller without modifying the base cartridge?
⚡ Direct Answer
Create a same-named controller file in your custom cartridge (higher priority in path). Use server.extend(module.superModule) to inherit base routes. Then server.append/prepend to extend specific routes.
🎯 Key Points
First line: server.extend(module.superModule) | Then: server.append('Product-Show', function(req, res, next) { var viewData = res.getViewData(); viewData.myData = 'value'; res.setViewData(viewData); next(); }); | Custom cartridge MUST be left of base in cartridge path | Zero core modifications
🏢 XYZ Company
At XYZ Company, custom Product.js: server.extend(module.superModule); server.append('Product-Show',...) added polymerGrade to viewData. All base product routes still worked. Clean extension.
🎤 "Extend SFRA controllers by creating same-named files in higher-priority cartridges using server.extend(module.superModule) and server.append — zero core modifications."
Q23
What is the static folder and how are CSS/JS built in SFRA?
⚡ Direct Answer
cartridge/static/ contains client-side assets: SCSS/CSS, JavaScript, images, fonts. SFRA uses Gulp as build tool — compiling SCSS to CSS, bundling JS modules, copying assets. Static asset resolution follows cartridge path.
🎯 Key Points
Gulp tasks: compileSass, compileJs, copyFiles | npm run build: full build | npm run watch: auto-rebuild | CSS output: cartridge/static/default/css/ | JS output: cartridge/static/default/js/ | CI/CD: always run npm run build before code upload
🏢 XYZ Company
At XYZ Company, custom polymer configurator SCSS compiled via Gulp. Custom JS in static/default/js/. Gulp watch auto-compiled on save during development. CI/CD: npm run build before sfcc-ci upload.
🎤 "SFRA's static folder contains client-side assets compiled by Gulp — SCSS to CSS, JS bundled — with cartridge path resolution enabling CSS/JS override from custom cartridges."
Q24
What is WebDAV in B2C Commerce?
⚡ Direct Answer
WebDAV is B2C Commerce's file system protocol for sandbox code access. Developers upload/download cartridge code using WebDAV clients (VS Code extension, Cyberduck). Path: /on/demandware.servlet/webdav/Sites/Cartridges/
🎯 Key Points
Authentication: Business Manager credentials with WebDAV role | VS Code: B2C Commerce cartridge uploader extension — auto-upload on save | Production: WebDAV disabled — use Business Manager code promotion | CI/CD: sfcc-ci CLI for automated pipelines | dw.json: config file with instance URL
🏢 XYZ Company
At XYZ Company, developers used VS Code B2C uploader — files auto-uploaded to sandbox on save. CI/CD: GitHub Actions → sfcc-ci push code → tests → promote. WebDAV for iteration; sfcc-ci for pipeline.
🎤 "WebDAV is B2C Commerce's file transfer protocol for sandbox development — replaced by sfcc-ci CLI for CI/CD pipeline automation and environment promotion."
Q25
What is the Transaction API in B2C Commerce?
⚡ Direct Answer
Transaction (dw.system.Transaction) is REQUIRED for ALL write operations. Transaction.wrap(function(){...}) auto-commits on success, auto-rollbacks on exception. Without a transaction, write operations throw a runtime exception.
🎯 Key Points
Transaction.wrap(): Transaction.wrap(function() { var co = CustomObjectMgr.createCustomObject('Type','key'); co.custom.value='data'; }); | Read operations: NO transaction needed | Manual: Transaction.begin(); try{...Transaction.commit();} catch(e){Transaction.rollback();} | #1 new developer error: forgetting Transaction.wrap()
🏢 XYZ Company
At XYZ Company, every script modifying Custom Objects used Transaction.wrap(). Auto-rollback on exception — data consistency guaranteed. Forgetting Transaction.wrap() was the most common new developer runtime error.
🎤 "All B2C Commerce write operations require Transaction.wrap() — auto-committing on success and rolling back on exception, preventing data corruption from partial writes."
Q26
What is OCAPI?
⚡ Direct Answer
OCAPI (Open Commerce API) is B2C Commerce's RESTful API layer. Shop API (/dw/shop/v23_1/): consumer operations — product search, basket, checkout, orders. Data API (/dw/data/v23_1/): merchant operations — product CRUD, price books, inventory. Both use OAuth2 authentication.
🎯 Key Points
Base URL: https://[instance].commercecloud.salesforce.com/s/[siteId]/dw | Shop API: consumer-facing | Data API: merchant data management | Auth: JWT for Shop, client credentials for Data | OCAPI config: Administration → Sites → OCAPI Settings | Rate limited per client ID
🏢 XYZ Company
At XYZ Company, mobile app used Shop API for search and checkout. ERP integration used Data API for product and inventory sync. Clean separation between consumer and merchant API operations.
🎤 "OCAPI is B2C Commerce's RESTful API — Shop API for consumer storefront operations and Data API for merchant data management, both authenticated via OAuth2."
Q27
What is SCAPI and how does it differ from OCAPI?
⚡ Direct Answer
SCAPI (Salesforce Commerce API) is the next-generation B2C Commerce API with OAuth2 PKCE security, improved performance, and modern design. For PWA Kit and headless implementations, SCAPI is the recommended API.
AspectOCAPISCAPI
AuthJWT, client credentialsOAuth2 PKCE
Path/dw/shop/v23_1//api/shop/v1/
Recommended forLegacy, SFRAHeadless, PWA Kit
🎯 Key Points
SCAPI: Salesforce's investment direction — new features here first | PWA Kit built on SCAPI by default | OCAPI fully supported for existing implementations | React SDK available for SCAPI
🏢 XYZ Company
At XYZ Company, SFRA used OCAPI. New PWA Kit headless storefront built on SCAPI. Both coexisted during migration — SCAPI implementation cleaner with OAuth2 PKCE.
🎤 "SCAPI is the next-generation B2C Commerce API with OAuth2 PKCE — recommended for all new headless and PWA Kit implementations."
Q28
What is the Shop API and its key endpoints?
⚡ Direct Answer
Shop API enables consumer-facing operations: product search, retrieval, basket management, checkout, order placement, customer account — all site-scoped with JWT authentication.
🎯 Key Points
Key endpoints: GET /products/{id} (product detail), GET /product_search (search + facets), POST /baskets (create cart), POST /baskets/{id}/items (add), POST /orders (place order) | Guest: POST /customers/auth?type=guest → temporary JWT | Authorization: Bearer {jwt} header on every call
🏢 XYZ Company
At XYZ Company mobile: /product_search?q=polymer+tube (search), POST /baskets (cart), POST /baskets/{id}/items (add), POST /orders (checkout). Each call with Authorization: Bearer {jwt}.
🎤 "Shop API enables consumer storefront operations — product search, basket management, and order placement via JWT-authenticated RESTful endpoints scoped to a specific site."
Q29
What are OCAPI Hooks?
⚡ Direct Answer
OCAPI Hooks intercept OCAPI requests and responses — injecting server-side custom logic without modifying core OCAPI behavior. Registered in hooks.json, they fire on specific OCAPI events: before/after GET/POST/PATCH for specific resources.
🎯 Key Points
Hook naming: dw.ocapi.shop.product.afterGET, dw.ocapi.shop.basket.afterPATCH | Use: response enrichment, custom validation, price personalization, ERP data injection | Multiple cartridges can register | OCAPI hooks ≠ SFRA hooks — different systems
🏢 XYZ Company
At XYZ Company, OCAPI hook intercepted GET /products to add real-time ERP availability: dw.ocapi.shop.product.afterGET called ERP → added customAvailability field. Mobile received enriched product data in one API call.
🎤 "OCAPI Hooks intercept API requests/responses — enabling server-side logic injection for validation, personalization, and response enrichment without modifying core OCAPI."
Q30
How does the Basket API work in OCAPI?
⚡ Direct Answer
Basket API manages shopping cart state. Create via POST /baskets, add items via POST /baskets/{id}/items, apply coupons via POST /baskets/{id}/coupons, place order via POST /orders. Baskets expire after inactivity.
🎯 Key Points
Basket lifecycle: create → add items → set shipping → set payment → POST /orders | Promotion auto-evaluation on every modification | Basket merge: guest basket merged with customer basket on login | UUID-based basket ID | GET /baskets/{id} for current state including totals
🏢 XYZ Company
At XYZ Company mobile checkout: POST /baskets creates basket → add polymer products → set shipping → add payment → POST /orders. Clean RESTful checkout lifecycle.
🎤 "Basket API manages temporary cart state through RESTful lifecycle — with automatic promotion evaluation on every modification and basket merge on customer login."
Q31
What is the Data API in OCAPI?
⚡ Direct Answer
Data API provides merchant-facing access: product CRUD, catalog management, price books, inventory, promotions, custom objects. Requires client credentials (client_id + client_secret) — not customer JWT.
🎯 Key Points
Path: /dw/data/v23_1/ | Auth: client credentials | Key endpoints: /products (CRUD), /price_books, /inventory_lists, /promotions | Rate limited per client | SFTP alternative for batch operations | Use for ERP integration, PIM sync
🏢 XYZ Company
At XYZ Company, nightly ERP sync: PUT /products/{id} updated specs, PUT /inventory_lists/{id}/product_inventory_records updated stock, POST /price_books/{id}/price_book_entries updated prices. 3 API calls replaced 3 manual BM imports.
🎤 "Data API provides merchant data management via client credentials — product CRUD, price books, inventory for ERP and PIM integrations."
Q32
How do you handle OCAPI rate limiting?
⚡ Direct Answer
OCAPI enforces rate limits: requests per minute per client ID and daily quotas. HTTP 429 when exceeded. Architecture: CDN caching for read-heavy APIs, exponential backoff (1s, 2s, 4s, 8s), request batching, distributing load across multiple client IDs.
🎯 Key Points
HTTP 429: check Retry-After header | Exponential backoff: 1s, 2s, 4s, 8s | CDN: cache GET /products/{id} at edge — 99% hit rate eliminates OCAPI load | Batch: POST multiple basket items in one request | Client ID limits: each ID has own quota
🏢 XYZ Company
At XYZ Company, 10,000 concurrent users during flash sale hit product rate limits. Fix: Akamai CDN cached GET /products/{id} for 5 minutes. OCAPI received ~200 requests/minute instead of 10,000. Rate limit eliminated.
🎤 "OCAPI rate limiting requires CDN caching for product APIs, exponential backoff retry, and request batching — preventing one traffic spike from exhausting daily API quotas."
Q33
What is Page Designer?
⚡ Direct Answer
Page Designer is B2C Commerce's visual content management system — merchants drag-and-drop developer-built components to create pages (homepage, landing pages) without developer involvement. Components have JSON schemas defining merchant-editable attributes.
🎯 Key Points
Component types: layout (containers, grids) and content (hero banner, product tile, text block) | JSON schema: defines editable attributes per component | Scheduling: date-based component configurations | A/B testing: via customer group targeting | Page Designer = modern standard; Content Assets = older approach
🏢 XYZ Company
At XYZ Company, developers built 8 Page Designer components. Marketing built all seasonal landing pages independently — zero developer involvement. Campaign page time-to-launch: 2 days → 2 hours.
🎤 "Page Designer enables merchant-driven page building from developer-built components — reducing time-to-market for content changes from days to hours."
Q34
What is PWA Kit?
⚡ Direct Answer
PWA Kit is Salesforce's React-based framework for headless B2C Commerce storefronts — SSR for SEO, Managed Runtime hosting, React Storefront template, SCAPI integration. Next evolution beyond SFRA.
AspectSFRAPWA Kit
RenderingServer ISMLReact + SSR
APIOCAPISCAPI
HostingB2C serversManaged Runtime
TechB2C-specific JSStandard React
🎯 Key Points
Managed Runtime: Salesforce-hosted Node.js with CDN | SCAPI React SDK built-in | Performance: sub-second LCP with SSR + CDN | PWA: installable, service worker
🏢 XYZ Company
At XYZ Company, PWA Kit migration: LCP from 4.2s to 1.8s. Core Web Vitals passed. Mobile conversion +22%. Managed Runtime auto-scaled Black Friday — zero ops intervention.
🎤 "PWA Kit is Salesforce's React headless commerce framework — SSR for SEO, SCAPI for APIs, Managed Runtime for hosting."
Q35
What is SSR in PWA Kit?
⚡ Direct Answer
SSR (Server-Side Rendering) renders React on the server before sending HTML to the browser — ensuring search engines receive full page content and users see content immediately. After HTML loads, React hydrates for interactivity.
🎯 Key Points
SSR vs CSR: SSR = server generates HTML; CSR = browser | SEO critical: CSR gives Google blank pages | LCP improvement: content visible without JavaScript execution | Hydration: React takes over from SSR HTML | Without SSR: headless commerce destroys SEO rankings
🏢 XYZ Company
At XYZ Company, initial headless attempt without SSR: Google crawled blank pages — organic rankings dropped 60%. Added SSR via PWA Kit: Google crawled full product content. 3 months: organic traffic recovered and exceeded pre-migration levels.
🎤 "SSR renders React server-side before browser delivery — ensuring SEO crawlability and fast initial content visibility, with client-side React hydration enabling interactivity."
Q36
What is B2B Commerce and how does it differ from B2C?
⚡ Direct Answer
B2B Commerce is native Salesforce — built on standard objects (Product2, Order, Pricebook2) with LWC storefront components. Unlike B2C's standalone platform, B2B IS Salesforce — sharing CRM data and using standard Salesforce DevOps.
AspectB2C CommerceB2B Commerce
PlatformStandaloneNative Salesforce
ProductsB2C CatalogProduct2 / Pricebook2
OrdersB2C OrdersSalesforce Orders
AuthOCAPI JWTSalesforce Session
🎯 Key Points
B2B buyers: authenticated account contacts (not anonymous) | Contract pricing: account-specific via Price Books and Buyer Groups | Same Account data as CRM sales team | Reorder and Quick Order: built-in
🏢 XYZ Company
At XYZ Company, B2B served industrial polymer buyers — logged in with account credentials, saw contract pricing negotiated in CRM, reordered from history, submitted for approval.
🎤 "B2B Commerce is natively Salesforce — using Account-based auth, CRM-connected pricing, and standard Salesforce objects enabling seamless CRM and Service Cloud integration."
Q37
What are Entitlements in B2B Commerce?
⚡ Direct Answer
Entitlements control what products an account can purchase — defining product access policies per account or buyer group. Account without entitlement cannot add product to cart even if visible. Configured via ProductEntitlementPolicy assigned to Buyer Groups.
🎯 Key Points
Buyer Group → Entitlement Policy → Products/Categories | Account → Buyer Group → inherits entitlement | Entitlement checked at add-to-cart — not just display | Use: regulatory compliance, partner-exclusive products | CRUD via Apex or ConnectApi
🏢 XYZ Company
At XYZ Company, pharmaceutical-grade polymer products restricted to pharma-certified accounts. EntitlementPolicy PharmaBuyerPolicy assigned to PharmaGroup. Only pharma-certified accounts could add to cart — regulatory compliance enforced automatically.
🎤 "Entitlements define per-account product purchase access via buyer group membership — enabling regulatory compliance and partner-exclusive product access control."
Q38
What is ConnectApi in B2B Commerce?
⚡ Direct Answer
ConnectApi (Connect in Apex) is Salesforce's server-side API for B2B Commerce operations. Enforces business rules (entitlement, pricing, approvals) for cart management, order creation, catalog access. Never bypass with direct DML — it skips business rules.
🎯 Key Points
Key: ConnectApi.CartController.addItemToCart() — validates entitlement + applies pricing | ConnectApi.CommerceOrders.createCartFromOrder() — reorder | ConnectApi.CommerceOrders.createOrder() — places order | Direct DML bypasses business rules — never do it
🏢 XYZ Company
At XYZ Company, reorder: ConnectApi.CommerceOrders.createCartFromOrder(webStoreId, userId, orderId) — one call pre-populated cart from previous order with current pricing and entitlement check. Direct DML equivalent: 20+ lines missing all business rule enforcement.
🎤 "ConnectApi is the B2B Commerce Apex API enforcing all business rules — never replaced with direct DML which bypasses entitlement, pricing, and approval logic."
Q39
What is headless commerce architecture?
⚡ Direct Answer
Headless commerce separates the commerce backend (catalog, pricing, cart, orders via APIs) from any presentation frontend (custom React/Vue/Angular app). APIs (OCAPI/SCAPI for B2C, ConnectApi for B2B) consumed by any frontend — web, mobile, IoT.
🎯 Key Points
When to go headless: non-standard UX, mobile app + web from one backend, extreme performance requirements | When NOT to: tight timeline, small team, standard features sufficient | PWA Kit: Salesforce's opinionated headless framework | Trade-off: full UX control vs higher complexity
🏢 XYZ Company
At XYZ Company, standard SFRA for desktop. Mobile required native iOS/Android — headless B2C Commerce (SCAPI) served web PWA Kit, iOS app, and Android app. Three frontends, one commerce backend.
🎤 "Headless commerce decouples the API backend from presentation frontend — enabling any frontend technology at the cost of increased frontend complexity."
Q40
What are B2C Commerce ERP integration patterns?
⚡ Direct Answer
Four ERP integration patterns: SFTP file exchange (scheduled Jobs for batch data), real-time API callout (HTTPClient for live inventory), middleware hub (MuleSoft for transformation), event-driven sync (order status).
PatternLatencyBest For
SFTP file exchangeBatch (hours)Catalog, bulk orders
Real-time API calloutSecondsLive inventory, pricing
MuleSoft middlewareNear real-timeComplex transformation
Event-drivenNear real-timeOrder fulfillment sync
🎯 Key Points
SFTP: B2C Commerce built-in import/export Job steps | Real-time callout: cache result — don't call ERP on every page load | Order export: EXPORT_STATUS_READY flag for ERP pickup | MuleSoft: decouples B2C and ERP
🏢 XYZ Company
At XYZ Company: SFTP nightly (catalog, 50K SKUs), cached real-time HTTPClient (inventory — 15-min Custom Object cache), MuleSoft event-driven (order confirmation → SAP). Multi-pattern for different freshness requirements.
🎤 "B2C Commerce ERP integration combines SFTP batch for high-volume catalog, cached real-time API for inventory, and event-driven middleware for order fulfillment."
🔌

OCAPI, APIs & Data Management

Q41–Q60 · Shop API, Data API, SCAPI, integration patterns

Q41
What is the difference between Product Set and Product Bundle?
⚡ Direct Answer
Product Set: standalone products grouped for display — each independently purchasable. Product Bundle: fixed collection sold as ONE unit at a bundle price — all items added as one cart line item.
🎯 Key Points
Set: customer buys any items from set | Bundle: all-or-nothing at bundle price | OCAPI product type response distinguishes set vs bundle | Inventory: set tracks individual items, bundle tracks bundle level
🏢 XYZ Company
At XYZ Company, polymer starter kit (tubing+fittings+adhesive) sold as Bundle at £29.99. Shop the look (tube+clamps+connectors) displayed as Set — customer chose which items.
🎤 "Product Sets display independently purchasable items; Product Bundles sell as one fixed-price unit — choose based on whether customers need flexible or fixed purchasing."
Q42
What is the role of Catalogs in B2C Commerce?
⚡ Direct Answer
Two-catalog system: Master Catalog (organization-level, all products with full attributes) and Site Catalog (site-level, organizes products into visible categories). A product must exist in Master AND be assigned to a Site Catalog category to appear on the storefront.
🎯 Key Points
One master catalog per organization | Each site has own site catalog | Search: product must be site catalog assigned to appear | Category-product assignment links to storefront | Shared master: consistent product data across all sites
🏢 XYZ Company
At XYZ Company, master catalog had 50K polymer products. UK site catalog: categories Tubing, Fittings, Adhesives. Only UK-assigned products appeared on UK storefront. International site had different category assignments.
🎤 "Master Catalog contains all product definitions; Site Catalog organizes them into storefront categories — both required for a product to appear on the storefront."
Q43
How does inventory management work in B2C Commerce?
⚡ Direct Answer
Inventory managed via Inventory Lists — containers of product inventory records with onHand quantity, preorderable, and backorderable settings. ATS (Available to Sell) = onHand minus allocation. Sites assigned to inventory lists.
🎯 Key Points
Inventory List → Product Inventory Records | ATS = onHand - allocation | Preorder/Backorder modes for out-of-stock behavior | Jobs: ImportInventory for bulk updates | Real-time: HTTPClient to WMS for live stock (cache results!)
🏢 XYZ Company
At XYZ Company, inventory updated every 15 minutes via Job calling WMS API. Out-of-stock polymers showed preorder if leadTime < 14 days. Stock accuracy critical for polymer products.
🎤 "B2C Commerce inventory uses Inventory Lists with per-product ATS calculation — configurable backorder/preorder behavior with real-time WMS integration for accuracy."
Q44
What are Content Assets and Slots?
⚡ Direct Answer
Content Assets are HTML/text/image blocks in Business Manager — rendered via ISML tag. Slots are configurable storefront areas displaying Content Assets or Products based on schedule, customer group, or A/B test.
🎯 Key Points
Content Asset: single HTML content block, older approach | Slot: dynamic container assigned per schedule/customer group | Slot types: global, category, folder, product | Page Designer: the modern replacement for Content Assets | Zero developer involvement for merchant content updates
🏢 XYZ Company
At XYZ Company, homepage hero was a Slot. Marketing scheduled: Summer Sale Content Asset (June-Aug), Christmas (Dec), default (rest of year). VIP customers saw exclusive offer. Zero developer involvement for seasonal updates.
🎤 "Slots are configurable dynamic areas mapping Content Assets to storefront locations — merchant-controlled scheduling and customer group targeting without code changes."
Q45
How does ProductSearchModel work?
⚡ Direct Answer
ProductSearchModel is the server-side API for B2C Commerce's Solr-based search. Set parameters, call search(), iterate results with automatic facets and sorting. Use for listing and search pages.
🎯 Key Points
var apiSearch = new ProductSearchModel(); apiSearch.setSearchPhrase(q); apiSearch.setCategoryID(catId); apiSearch.setPageSize(12); apiSearch.search(); | Facets auto-generated from searchable attributes | Attribute selection: specify only needed fields | ProductMgr for PDP, SearchModel for listing — never mix
🏢 XYZ Company
At XYZ Company, PLP used ProductSearchModel with 10 attributes. Facets auto-generated: Diameter (12 values), Hardness (5 values), Temperature (8 values). Never used ProductMgr on listing — 48 products × 80 attributes = catastrophic performance.
🎤 "ProductSearchModel executes indexed search with automatic facets — use for listing pages; ProductMgr.getProduct() only for single product detail pages."
Q46
How does SEO work in B2C Commerce?
⚡ Direct Answer
B2C Commerce SEO: URL rules (clean SEO-friendly URLs), dynamic meta tags in ISML, automatic XML sitemap, canonical URLs, hreflang for multi-locale, redirect rules. For PWA Kit headless: SSR is mandatory.
🎯 Key Points
URL rules: Business Manager → SEO → URL Rules | Clean URLs: /silicone-tube-10mm.html | Meta: in ISML | Sitemap: Business Manager → SEO → Sitemap | Canonical: SFRA sets automatically
🏢 XYZ Company
At XYZ Company, URL rules generated clean URLs for all 50K products. ISML dynamically generated meta titles using product name + key attributes. 301 redirects for SiteGenesis URLs after SFRA migration — zero organic traffic loss.
🎤 "B2C Commerce SEO uses URL rules, dynamic meta tags, XML sitemap, and canonical URLs — with SSR being critical for headless implementations."
Q47
What is the role of taxes in B2C Commerce?
⚡ Direct Answer
B2C Commerce supports table-based taxes (configured in Business Manager) and external tax service integration via app.tax.calculate hook. Tax classes assigned to products determine rates. Prices display inclusive or exclusive of tax.
🎯 Key Points
Tax class: product attribute for tax category | Tax table: BM → Merchant Tools → Tax → Tax Rates | app.tax.calculate hook: call Avalara or Vertex | Price display: gross (inclusive) or net (exclusive) per site | Multi-jurisdiction: external service required
🏢 XYZ Company
At XYZ Company, UK: built-in tax tables (20% standard, 5% for specific polymers). EU expansion: Avalara integration via app.tax.calculate hook. 47 European jurisdictions handled automatically.
🎤 "B2C Commerce supports built-in tax tables for simple jurisdictions and external tax service integration via hooks — Avalara and Vertex for multi-jurisdiction compliance."
Q48
How does shipping work in B2C Commerce?
⚡ Direct Answer
Shipping Methods configured in Business Manager: name, price (flat rate, tiered, or hook-based external rates), applicable countries. Shipping Promotions via standard Promotions engine. External rate shopping via app.shipping.calculate hook.
🎯 Key Points
Shipping methods: BM → Merchant Tools → Shipping | Flat rate: fixed price | Tiered: by order total | External: hook calls carrier API (FedEx/UPS live rates) | Shipping promotions: free shipping via Campaigns | Multiple methods per site
🏢 XYZ Company
At XYZ Company, 4 methods: Standard (£5.99), Express (£12.99), Freight (external FedEx hook for >50kg polymer orders), Click and Collect (£0). Orders over £100: free standard shipping promotion.
🎤 "B2C Commerce shipping supports flat, tiered, and hook-based external rate calculation — integrated with the promotions engine for free shipping offers."
Q49
How does localization work in B2C Commerce?
⚡ Direct Answer
Localization: site locale configuration (language, currency, date format), resource bundles (properties files per locale), and ISML Resource.msg() for locale-appropriate text. Currency and date formatting automatic based on locale.
🎯 Key Points
Locale config: BM → Administration → Sites → Locales | Resource bundles: {namespace}_{locale}.properties | Resource.msg('key','namespace','default') in ISML | URL patterns: /fr/product.html for French | hreflang tags for multi-locale SEO
🏢 XYZ Company
At XYZ Company, en_GB, de_DE, fr_FR. Resource bundle: product.add_to_cart = Add to Basket / Zum Warenkorb hinzufügen / Ajouter au panier. One codebase, 3 languages. Currency and date formatting automatic.
🎤 "B2C Commerce localization uses resource bundle properties files per locale — ISML accesses locale-appropriate strings via Resource.msg(), automatic currency/date formatting from locale config."
Q50
What is the B2C Commerce to Marketing Cloud integration?
⚡ Direct Answer
Integration enables abandoned cart emails, order confirmation emails, and personalized campaigns. Commerce Cloud Connector (managed cartridge) automates data flows: basket data to MC, order events to Journey Builder triggers, customer profiles to MC Subscribers.
🎯 Key Points
Commerce Cloud Connector: pre-built integration cartridge | Abandoned basket: Job exports to MC SFTP → Journey sends reminder | Order confirmation: order event → MC Journey | Product recommendations: Einstein data in MC email templates | Customer sync: B2C customer → MC Subscriber
🏢 XYZ Company
At XYZ Company: abandoned cart → 2-hour export to MC → personalized email with actual cart items → 24-hour follow-up with 10% discount. Cart recovery rate: 12%. Justified integration cost.
🎤 "B2C Commerce to Marketing Cloud integration powers abandoned cart recovery and order transactional emails via the Commerce Cloud Connector and Journey Builder automation."
Q51
What are security best practices for B2C Commerce?
⚡ Direct Answer
Key practices: JWT token management, HTTPS enforcement, Content Security Policy (CSP) for XSS prevention, input encoding in ISML (encode()), PCI compliance via payment tokenization, least-privilege Business Manager roles.
🎯 Key Points
JWT: short expiry, refresh tokens | encode() in ISML prevents XSS | CSP: BM → Administration → Sites → CSP — whitelist external scripts | OCAPI Data API IP allowlisting: restrict to known server IPs | Payment: Stripe/Adyen tokenization — no card data on B2C
🏢 XYZ Company
At XYZ Company, audit: Data API accessible from any IP → restricted to ERP server IP; ISML rendering raw URL params → added encode(); 15 BM admin accounts → reduced to 3. Stripe tokenization confirmed — zero card data on B2C servers.
🎤 "B2C Commerce security requires OCAPI IP restriction, input encoding in ISML, CSP whitelisting, least-privilege Business Manager access, and payment tokenization for PCI compliance."
Q52
What is Order Management (OMS) in Commerce Cloud?
⚡ Direct Answer
Salesforce Order Management manages post-purchase orchestration: fulfillment routing, inventory sourcing, returns, exchanges, shipping updates. Integrates with B2C Commerce (order source), warehouse/3PL systems, and Service Cloud.
🎯 Key Points
OMS scope: post-purchase (after B2C places order) | B2C Commerce: order capture at checkout | OMS: routes to warehouse, manages returns, refund orchestration | Service Cloud: agents see real-time OMS order status | Integration: B2C order event → OMS API → warehouse → tracking update
🏢 XYZ Company
At XYZ Company, B2C captured polymer orders. OMS routed to nearest warehouse (London/Manchester/Glasgow) based on inventory and location. Complex returns handled by OMS. Service agents saw real-time status in Service Console.
🎤 "Salesforce Order Management handles post-purchase orchestration — fulfillment routing, returns, and inventory sourcing — integrating B2C Commerce capture with warehouse systems and Service Cloud."
Q53
How do you implement a custom payment gateway in B2C Commerce?
⚡ Direct Answer
Custom payment gateway: (1) Create payment processor in Business Manager; (2) Register hooks in hooks.json: app.payment.processor.Handle (collect payment data) and app.payment.processor.Authorize (call gateway API); (3) Client-side tokenization keeps card data off B2C servers.
🎯 Key Points
Payment hooks: Handle → collect info/token; Authorize → call gateway API | Transaction.wrap() around order updates | HTTPClient calls gateway with timeout and error handling | PCI: client-side tokenization (Stripe Elements) keeps cards off B2C servers
🏢 XYZ Company
At XYZ Company, Stripe: client-side Stripe Elements → Stripe token → Handle hook receives token → Authorize hook calls Stripe API → Success: order placed; Failure: checkout error. Card data never touched B2C servers.
🎤 "Custom payment gateways use hooks.json registering Handle and Authorize hooks — client-side tokenization for PCI compliance, server-side hooks call gateway API."
Q54
What is PWA Kit Managed Runtime?
⚡ Direct Answer
Managed Runtime is Salesforce's CDN-backed Node.js hosting for PWA Kit — handling SSR, static assets, HTTPS without merchant infrastructure management. Deploy via sfcc-ci CLI. Auto-scaling, global CDN, zero server management.
🎯 Key Points
Bundle deployment: npm run build → sfcc-ci push-bundle | Environments: production, staging, preview | Custom domains via Commerce Cloud Account Manager | Auto-scaling: traffic spikes handled automatically | Zero infrastructure: no EC2, load balancers, SSL cert management
🏢 XYZ Company
At XYZ Company, zero infrastructure cost. Deployment: GitHub Actions → npm run build → sfcc-ci push-bundle → auto-deployed. Auto-scaled Black Friday — zero ops intervention. Infrastructure savings vs self-hosting: ~£8,000/year.
🎤 "Managed Runtime is Salesforce's CDN-backed Node.js hosting for PWA Kit — eliminating infrastructure management with auto-scaling, deployed via sfcc-ci bundle pushes."
Q55
How does B2C Commerce integrate with Salesforce CRM?
⚡ Direct Answer
Integration syncs: customers (B2C registration → CRM Contact), orders (B2C orders → CRM Order objects), service data (B2C issues → Service Cloud Cases). B2C CRM Connector provides pre-built architecture. Agents get 360-degree ecommerce view.
🎯 Key Points
B2C CRM Connector: managed package for bi-directional sync | Customer: registration → CRM Contact via OCAPI hook | Order: placed → CRM via MuleSoft or Heroku | Service: Contact Us → Case with B2C order context | 360 view: agent sees full B2C purchase history
🏢 XYZ Company
At XYZ Company, CRM integration: customer registered → CRM Contact created → order history synced → sales rep saw purchase context for outbound calls → service agent saw all B2C orders when customer called.
🎤 "B2C Commerce to CRM integration syncs customers, orders, and service data — giving sales and service agents a 360-degree view of ecommerce behavior alongside CRM records."
Q56
What is Platform Cache in B2C Commerce?
⚡ Direct Answer
Platform Cache (dw.system.CacheMgr) provides application-level in-memory caching for expensive computations: pricing matrices, external API responses, configuration data. Separate from page-level .
🎯 Key Points
CacheMgr.getCache('MyCache', SCOPE_GLOBAL, SCOPE_GLOBAL) | put(key, value, ttl_seconds) | get(key) — returns null if expired | Max TTL: 24 hours | Explicit invalidation: CacheMgr.getCache().invalidate() | Complement to page caching
🏢 XYZ Company
At XYZ Company, polymer pricing matrix (5,000 entries) cached 30 minutes in Platform Cache. First request: 2.1 seconds. Subsequent: 8ms. PDP price display near-instant for 99.7% of requests.
🎤 "Platform Cache provides application-level in-memory caching — ideal for expensive pricing calculations and external API responses with TTL-based invalidation."
Q57
How does multi-warehouse inventory work in B2C Commerce?
⚡ Direct Answer
Multiple Inventory Lists (each a warehouse) assigned to site. Stock aggregated across lists. For fulfillment routing, Salesforce Order Management handles warehouse selection. Custom real-time WMS integration via HTTPClient for accurate availability.
🎯 Key Points
Multiple inventory lists: each list = one warehouse | Aggregation: sum across lists | OMS: preferred for enterprise fulfillment routing | Real-time WMS: HTTPClient → cache results (15-min refresh acceptable) | app.availability hook for custom calculation
🏢 XYZ Company
At XYZ Company, 3 warehouses (London/Manchester/Glasgow) each had own inventory list. B2C showed aggregate ATS. SF OMS received orders and applied sourcing rules — fulfill from nearest warehouse with stock > 10 units.
🎤 "Multi-warehouse uses multiple Inventory Lists for aggregate availability — Salesforce Order Management handles intelligent fulfillment routing based on configurable sourcing rules."
Q58
What is Page Cache and CDN strategy in B2C Commerce?
⚡ Direct Answer
Page Cache caches server-rendered pages via ISML tag (TTL-based). Akamai CDN sits in front of B2C Commerce for global edge caching. Strategy: long TTL for static assets, medium TTL for category/product, no cache for checkout/cart.
🎯 Key Points
for caching | for no cache (personalized) | CDN: category 5 min, PDP 30 min, static assets infinite (versioned URLs) | Cache purge: triggered from Business Manager after catalog updates | Checkout: always sensitive
🏢 XYZ Company
At XYZ Company, CDN strategy: static assets (infinite TTL), PDP (30 min), category (5 min). Black Friday: Akamai served 98% from edge — origin received 2% of traffic. No application server stress at 50,000 concurrent users.
🎤 "B2C Commerce page caching uses for application-level TTL — with Akamai CDN as the outer edge cache layer absorbing 95%+ of traffic."
Q59
How does multi-currency work in B2C Commerce?
⚡ Direct Answer
Multi-currency: separate price book per currency. Currency detection: geolocation, browser locale, or customer selection. Session.setCurrency() sets current currency. OCAPI requests include currency parameter. Prices displayed in selected currency.
🎯 Key Points
One price book per currency | Session.setCurrency(Currency.getCurrency('EUR')) | OCAPI: ?currency=EUR parameter | Exchange rates: manual price books OR Job calling exchange rate API weekly | Currency selector: ISML component + session currency setting
🏢 XYZ Company
At XYZ Company, 3 currencies: GBP, EUR, USD. Three price books updated weekly from exchange rate API via Job. Browser locale detected preferred currency → Session.setCurrency() → OCAPI calls included currency=EUR. Checkout in selected currency.
🎤 "Multi-currency requires separate price books per currency, session-based currency selection, and automated exchange rate updates via scheduled Jobs."
Q60
What are OCAPI performance best practices?
⚡ Direct Answer
OCAPI performance: CDN caching for GET product endpoints, field expansion to fetch only needed data, batch basket operations, exponential backoff for rate limits, SCAPI for new implementations, connection reuse for server-to-server calls.
🎯 Key Points
Field expansion: /products/{id}?expand=availability,prices | CDN for GET: product API cached at edge — 99% hit rate | Batch: add multiple items in one POST | Rate limit: 429 → exponential backoff | SCAPI: better performance for new implementations
🏢 XYZ Company
At XYZ Company: product API cached 30 min at Akamai (99% hit rate), search API 5 min, basket/checkout never cached. Minimal field expansion — 8 needed fields instead of 50+. Peak: CDN absorbed 97% of product API traffic.
🎤 "OCAPI performance requires CDN caching for product APIs, minimal field expansion, batch operations, and exponential backoff retry — SCAPI preferred for new implementations."
📱

Page Designer, PWA Kit & B2B Commerce

Q61–Q95 · Advanced topics and B2B architecture

Q61
How would you debug a checkout failure in SFRA?
⚡ Direct Answer
Log Center for error messages → Script Debugger for step-through → check OCAPI logs if headless → reproduce with simplified data → check payment gateway logs separately.
🎯 Key Points
Log Center: Administration → Operations → Log Center → filter ERROR + timestamp | Common failures: payment timeout, session expiry, basket validation, promotion errors | Script Debugger: breakpoint in Checkout-Begin | Reproduce in sandbox with same cart conditions
🏢 XYZ Company
At XYZ Company, 5% checkout failures. Log Center: HTTPClient connection timeout (ERP real-time stock check). Fix: async stock check post-checkout, 15-min cached stock. Failures: 5% → 0.1%.
🎤 "Checkout failure debugging starts in Log Center, then Script Debugger for code investigation — systematic reproduction in sandbox to isolate root cause."
Q62
How would you implement personalization without breaking page caching?
⚡ Direct Answer
Shell-and-fill pattern: cache the page structure server-side, load personalized content client-side via AJAX. Einstein Recommendation widgets load asynchronously — no caching impact.
🎯 Key Points
Cache the shell: on page template | AJAX personalization: JS reads customer group cookie → AJAX to personalization endpoint → inject content | Einstein widget: async — doesn't affect cache | Signed cookies: prevent tampering
🏢 XYZ Company
At XYZ Company, homepage cached 5 minutes. VIP hero banner personalized: generic page cached → client-side JS reads VIP cookie → AJAX to Personalization-GetHero → injects VIP banner. CDN cache efficiency maintained at 92%.
🎤 "Shell-and-fill caches the page structure and injects personalized content client-side via AJAX — maintaining high CDN cache hit rates while delivering individual experiences."
Q63
What is the B2B Commerce Cart API?
⚡ Direct Answer
B2B Commerce Cart (WebCart object) managed exclusively via ConnectApi.CartController. Operations: addItemToCart, updateCartItem, deleteCartItem, getCartSummary. Direct DML bypasses business rules — never do it. Multiple carts per account supported.
🎯 Key Points
ConnectApi.CartController.addItemToCart() — validates entitlement + applies pricing | ConnectApi.CartController.getCartSummary() — totals and item count | WebCart: Salesforce object (not B2C Basket) | Multiple carts per account: B2B supports project-based carts
🏢 XYZ Company
At XYZ Company, B2B cart: ConnectApi.addItemToCart validates entitlement → applies contract pricing → updates totals. Procurement team maintained multiple project carts: Project_Alpha_Cart, Project_Beta_Cart. Cart submitted → createOrder() → approval workflow.
🎤 "B2B Commerce Cart (WebCart) managed via ConnectApi.CartController — enforcing entitlement and contract pricing on every operation."
Q64
How do you implement approval workflows in B2B Commerce?
⚡ Direct Answer
Salesforce native Approval Process on Order object. ConnectApi.CommerceOrders.createOrder() creates Order in Pending Approval status → Approval Process routes to approver → mobile approval → Platform Event notifies portal.
🎯 Key Points
Approval Process: standard Salesforce on Order object | Trigger: createOrder() → Order status: Pending Approval | Approver: standard Salesforce email notification | Mobile: Salesforce Mobile App | Rejection: returns to buyer with notes via Platform Event
🏢 XYZ Company
At XYZ Company, orders > £5,000 required manager approval. Buyer submits → ConnectApi creates Order (Pending Approval) → manager approves via Salesforce Mobile → Platform Event notifies B2B portal → buyer sees status. Procurement compliance enforced automatically.
🎤 "B2B Commerce approval workflows use Salesforce native Approval Processes — ConnectApi creates orders in Pending Approval status, routing to configured approvers."
Q65
What are Buyer Groups in B2B Commerce?
⚡ Direct Answer
Buyer Groups segment B2B accounts into collections sharing purchasing rules — entitlement policies, price books, and shipping methods. Account membership determines what products they can buy, what prices they see, and available shipping.
🎯 Key Points
BuyerGroup → BuyerGroupMember (Account junction) | BuyerGroupPricebook: links to Pricebook | EntitlementPolicy assigned to Buyer Group | Multiple Buyer Groups per account: multiple memberships | Auto-assignment via Apex based on account attributes
🏢 XYZ Company
At XYZ Company, 3 Buyer Groups: StandardDistributor (list pricing), PremiumDistributor (top 20 accounts, 15% better pricing), PharmaLicensed (pharma-grade entitlement only). Account auto-moved to Premium via Apex when annual spend threshold met.
🎤 "Buyer Groups segment B2B accounts into collections sharing entitlement policies and price books — the primary mechanism for account-specific pricing and product access control."
Q66
What is the difference between global and site-specific configurations?
⚡ Direct Answer
Organization-level (shared): customer lists, master catalog, Business Manager users. Site-specific (isolated): cartridge path, price books, promotions, inventory lists, locale/currency, OCAPI settings.
🎯 Key Points
Common mistake: assuming price books and promotions are shared — they're site-specific | Customer list sharing: one account works across all sites | New site: configure catalog, pricing, promotions — code deploys once | OCAPI settings: configured per site
🏢 XYZ Company
At XYZ Company, shared: customer list (UK customer logs into EU site), master catalog (50K products defined once). Site-specific: price books (GBP/EUR), promotions (UK promotions don't affect EU), cartridge path.
🎤 "Organization-level config is shared across sites; site-level config is isolated — understanding this prevents multi-site configuration errors."
Q67
How does B2C Commerce Replication work?
⚡ Direct Answer
Replication copies merchant data (catalog, pricing, promotions, content) from Staging to Production — ensuring production receives validated changes without direct production edits. Code promotion is separate from data replication.
🎯 Key Points
Replication targets: catalog, content assets, promotions, price books | BM: Merchant Tools → Online Marketing → Replication | Staging: merchant working environment | Code deployment: separate via Administration → Code Deployment | No direct production edits principle
🏢 XYZ Company
At XYZ Company, workflow: merchandising creates summer campaign in staging → QA validates → BM replication 1 hour before campaign launch → all changes live simultaneously. Zero direct production edits. Marketing errors caught in staging before going live.
🎤 "B2C Commerce Replication promotes merchant data from staging to production — ensuring validated changes without direct production edits."
Q68
What are Customer Groups in B2C Commerce?
⚡ Direct Answer
Customer Groups segment B2C shoppers for targeted promotions, price book assignments, A/B testing, and personalized content. Groups defined by rules (registration, purchase history, custom attributes) or manual assignment. Customers can belong to multiple groups.
🎯 Key Points
Rule-based: automatically assigned based on attributes | Manual: merchant assigns | Campaign targeting: assign campaign to specific customer group | Price books: group-specific pricing | Session: customer group evaluated on session start
🏢 XYZ Company
At XYZ Company, customer groups: RegisteredCustomer (all registered, free shipping at £75), VIP (top 10% by spend, 15% off), FirstOrder (0 prior orders, 10% welcome discount). Nightly job evaluated VIP threshold and updated group membership.
🎤 "Customer Groups segment shoppers for targeted promotions, personalized pricing, and content — automatically assigned via rules with customers potentially in multiple groups."
Q69
How would you approach migrating from SFRA to PWA Kit?
⚡ Direct Answer
Phase-by-phase migration: category pages first (lower risk), checkout last (complex). Maintain SFRA for unmigrated pages. Validate SSR for every React page. Replace OCAPI with SCAPI. Map SFRA controller logic to SCAPI custom endpoints.
🎯 Key Points
Phased: homepage → category → PDP → account → cart → checkout | SFRA + PWA Kit coexistence during migration | SCAPI mapping: identify OCAPI endpoints, map to SCAPI | SSR validation: every page must have SSR before Google crawl | Timeline: 9-12 months for large site
🏢 XYZ Company
At XYZ Company, 12-month migration: Months 1-3 (homepage+category), 4-6 (PDP+search), 7-9 (account+cart), 10-12 (checkout+payment). SFRA ran remaining pages throughout. LCP: 4.5s → 1.2s. Mobile conversion +22%.
🎤 "PWA Kit migration is page-by-page — maintaining SFRA for unmigrated pages, validating SSR before each page goes live, replacing OCAPI with SCAPI incrementally."
Q70
What are the most common B2C Commerce developer mistakes?
⚡ Direct Answer
Top mistakes: (1) Modifying core cartridge files (blocks upgrades); (2) HTTPClient in render path (slow pages); (3) Missing Transaction.wrap() for writes (runtime exceptions); (4) Loading all product attributes on listing pages (performance); (5) Large objects in session (memory pressure).
🎯 Key Points
No core modifications: extend via server.append/superModule | HTTPClient: cache results or use async | Transaction.wrap(): always wrap writes | Attribute selection: 8-10 on listing, all on PDP | Session objects < 100KB: store IDs, load on demand
🏢 XYZ Company
At XYZ Company, developer code review checklist: no core modifications, all writes in Transaction.wrap(), no HTTPClient in render path, session < 100KB, all external callouts with timeout + error handling. Runtime production errors dropped to near-zero.
🎤 "The critical B2C Commerce mistakes are core cartridge modifications, HTTPClient in render path, and missing Transaction.wrap() — all preventable through code review standards."
Q71
What is the difference between ProductMgr and SearchModel?
⚡ Direct Answer
ProductMgr.getProduct(pid): retrieves one product with all attributes — fast, direct database. ProductSearchModel: executes search query returning multiple products with facets, sorting, pagination — uses Solr index. Use ProductMgr for PDP, SearchModel for listing pages.
🎯 Key Points
ProductMgr: one product, all attributes, direct DB | SearchModel: multiple products, indexed, facets + sorting | Never use ProductMgr on listing pages | Attribute selection: SearchModel supports explicit field selection
🏢 XYZ Company
At XYZ Company, PLP: ProductSearchModel with 10 attributes. PDP: ProductMgr.getProduct() with all attributes. Using ProductMgr on listing: 48 products × 80 attributes = 3,840 attributes vs 480 with SearchModel. 8x less data.
🎤 "ProductMgr for single PDP retrieval; ProductSearchModel for indexed listing pages with facets — never use ProductMgr for listing pages."
Q72
What is B2B Quick Order?
⚡ Direct Answer
Quick Order allows B2B buyers to enter SKUs and quantities directly — bypassing catalog browsing. Native B2B Commerce LWC components validate SKUs against entitlement, check availability, add to cart. For repeat industrial buyers who know their SKU list.
🎯 Key Points
Native LWC: b2b_buyer_quick_order component | SKU validation: ConnectApi checks entitlement before adding | CSV upload: for large orders (50+ SKUs) | Error handling: invalid SKU, not entitled, out of stock — clear per-line messages
🏢 XYZ Company
At XYZ Company, Quick Order: buyer enters SKU list → system validates entitlement + availability → displays prices → adds all valid items in one click. Reorder time: 25 minutes → 2 minutes. Highest-usage portal feature.
🎤 "B2B Quick Order enables direct SKU entry with entitlement validation — dramatically reducing reorder time for industrial buyers with known SKU requirements."
Q73
How does Commerce Cloud handle GDPR compliance?
⚡ Direct Answer
GDPR: (1) Data export — Job exports all customer PII; (2) Right to erasure — anonymization (not deletion) replaces PII; (3) Consent management — custom Customer attribute; (4) Data minimization; (5) Cookie consent — custom ISML implementation.
🎯 Key Points
Anonymization: Customer email → sha256 hash, name → 'GDPR_DELETED' | Order history retained: legal obligation (7 years) but de-identified | Consent: Customer custom attribute marketingConsent + timestamp | Cookie consent: ISML component | Guest data: Job deletes after 90 days
🏢 XYZ Company
At XYZ Company, Delete Account: anonymization Job replaced email with sha256 hash, cleared name, all PII. Order history retained but de-identified. Marketing consent captured at registration. Cookie consent banner with granular controls. EU EAC email body capture disabled.
🎤 "B2C Commerce GDPR uses anonymization (not deletion) for PII removal — preserving order history for legal compliance while removing identifiable data."
Q74
What monitoring approaches do you use for B2C Commerce?
⚡ Direct Answer
Monitoring: Google Analytics 4 (conversion, UX), Business Manager Log Center (server errors), Akamai CDN dashboard (traffic, cache hit rate), custom APM (New Relic/Datadog), Core Web Vitals monitoring.
🎯 Key Points
Core Web Vitals SLAs: LCP < 2.5s, FID < 100ms, CLS < 0.1 | Log Center: alert on ERROR rate spikes | CDN cache hit rate: >80% target for category/product | PagerDuty: alerting when error rate > 2% | BM Profiler: slow page identification
🏢 XYZ Company
At XYZ Company: GA4 (UX), Akamai real-time (traffic/CDN), Log Center alerts (error spikes), custom Grafana (OCAPI response times). Performance incidents detected 3 hours before users reported them.
🎤 "B2C Commerce monitoring requires layered observability — CDN metrics, Business Manager logs, Core Web Vitals, and conversion analytics with threshold-based alerting."
Q75
What is the difference between Content Assets and Page Designer?
⚡ Direct Answer
Content Assets are simple HTML blocks stored in Business Manager — rendered in ISML via . Page Designer is the full visual page-building system where merchants drag-and-drop developer-built components. Page Designer is the current Salesforce recommendation.
🎯 Key Points
Content Assets: simple single-content blocks, older approach | Page Designer: multi-component visual pages, modern | Component JSON schema: defines merchant-editable attributes | Both support scheduling and A/B testing | Migration: Content Assets → Page Designer is a common modernization project
🏢 XYZ Company
At XYZ Company, migration from 12 Content Assets on homepage → Page Designer with 12 reusable components. Marketing builds all seasonal pages independently. Campaign page time-to-launch: 2 days → 2 hours.
🎤 "Content Assets are simple content blocks; Page Designer is the full visual page-building system — Page Designer is the current Salesforce recommendation for merchant-driven content management."
Q76
How would you architect a high-performance PLP in SFRA?
⚡ Direct Answer
PLP architecture: ProductSearchModel with 8-10 attributes, server-side rendered initial results, AJAX for filter/sort/pagination (no full page reload), template caching with , Einstein Predictive Sort for logged-in users, CDN caching for facet-stable search results.
🎯 Key Points
Attribute selection: 8-10 on listing only | for template | AJAX refinement: filter without full page reload | Lazy loading: images load on scroll | CDN: cache search results for stable facet combinations
🏢 XYZ Company
At XYZ Company, PLP: 6.2s → 1.4s. Three fixes: 80→10 attributes, template cached 5 min, AJAX refinement (no full reload on filter). Mobile conversion on PLP improved 31%.
🎤 "High-performance PLP combines selective attribute loading, template caching, AJAX refinement, and CDN caching — with Einstein Predictive Sort for logged-in user personalization."
Q77
How would you debug a PLP performance issue?
⚡ Direct Answer
Debug PLP performance: Business Manager Profiler for bottleneck identification → audit ProductSearchModel attribute selection → check for HTTPClient in render path → verify template caching → analyze CDN cache hit rate for category pages.
🎯 Key Points
BM Profiler: Administration → Operations → Profiler | Attribute selection audit: how many attributes being loaded? | HTTPClient in render path: never acceptable | : is template cached? | CDN: check Akamai for category page cache hit rate | AJAX filter: should not reload full page
🏢 XYZ Company
At XYZ Company, PLP 6.2 seconds. Profiler: ProductSearchModel loading 80 attributes (largest bottleneck), template not cached, AJAX filter causing full reload. Fixes: 80→10 attributes (2.1s saved), template cached 5 min (1.8s saved), AJAX refinement (0.9s saved).
🎤 "PLP performance: BM Profiler for bottleneck identification, attribute selection audit, template caching verification, CDN analysis — attribute selection typically the highest-impact fix."
Q78
What is the B2B Commerce self-service portal architecture?
⚡ Direct Answer
B2B self-service portal: Experience Cloud site with B2B Commerce enabled. Features: account-specific catalog (entitlement), order history and reorder (ConnectApi), invoice access (ContentDocument), account administration, custom LWC for specialized workflows.
🎯 Key Points
Experience Cloud: portal framework with B2B Commerce embedded | Auth: Customer Community Plus or Partner Community | ConnectApi.CommerceOrders.getOrders() for order history | ConnectApi.CommerceOrders.createCartFromOrder() for reorder | Custom LWC: quote submission, sample requests, technical data sheets
🏢 XYZ Company
At XYZ Company, polymer distributor portal: account-specific catalog, reorder from history in one click, download technical data sheets, submit sample requests. Distributor support calls reduced 60%.
🎤 "B2B self-service portal combines Experience Cloud, B2B Commerce via ConnectApi, and custom LWC — reducing distributor support burden by enabling self-service account management."
Q79
How does B2B Commerce order history and reorder work?
⚡ Direct Answer
Order history: ConnectApi.CommerceOrders.getOrders(webStoreId, userId, options) returns paginated orders. Reorder: ConnectApi.CommerceOrders.createCartFromOrder(webStoreId, userId, orderId) pre-populates cart with current pricing and entitlement validation.
🎯 Key Points
ConnectApi.getOrders(): filter by account, date range, status | createCartFromOrder(): one call creates cart with all previous items at current contract pricing | Price validation: prices reflect current contract (may differ from original) | Entitlement: items removed if entitlement changed
🏢 XYZ Company
At XYZ Company, reorder: buyer views order history → selects past order → Reorder All → createCartFromOrder() creates cart → reviews updated prices → checks out. Industrial polymer buyers ordering same products weekly: 25 min → 3 min.
🎤 "B2B reorder uses ConnectApi.createCartFromOrder() to pre-populate cart from previous order — automatically validating current entitlement and applying current contract pricing."
Q80
What are the most common mistakes in B2C Commerce development?
⚡ Direct Answer
Same as Q70 but from architecture perspective: (1) Missing CDN strategy; (2) No caching architecture; (3) Real-time external calls in render path; (4) Monolithic cartridge structure; (5) No feature flags; (6) No circuit breakers for external services.
🎯 Key Points
CDN: every B2C implementation needs CDN strategy | Caching layers: page cache + Platform Cache + CDN = three layers | External calls: cache or async — never synchronous in render path | Cartridge structure: too few = monolith, too many = performance overhead | Feature flags: Custom Preferences for safe feature rollout
🏢 XYZ Company
At XYZ Company, architecture review checklist: CDN strategy documented, caching layers defined for each page type, all external calls cached or async, cartridge count minimized (7 cartridges total), Custom Preferences for all feature flags. Architecture documented before implementation began.
🎤 "B2C Commerce architecture failures: no CDN strategy, no caching layers, synchronous external calls in render path, and no feature flag mechanism — all preventable through upfront architecture definition."
Q81
How do you implement search refinements in B2C Commerce?
⚡ Direct Answer
Search facets auto-generated from attributes marked searchable in Business Manager product type configuration. Facet display order, max values, and localized labels configured in Business Manager Search Refinement Configuration per category.
🎯 Key Points
Attribute searchable: BM → Merchant Tools → Products → Product Types → edit attribute → check Searchable | Refinement config: BM → Merchant Tools → Search → Search Refinement Configuration | Localized labels: resource bundles | Max values: limit displayed facet values
🏢 XYZ Company
At XYZ Company, polymer facets: Material Grade, Diameter, Hardness, Temperature Rating, Length, Color — 6 facets in priority order. Localized display names. Max 10 values each. Price facet: custom ranges. Search refinement drove 67% of conversions.
🎤 "B2C Commerce search facets auto-generate from searchable attributes — with display order, max values, and localized labels configured in Business Manager Search Refinement Configuration."
Q82
How does B2B Punchout ordering work?
⚡ Direct Answer
Punchout (OCI/cXML) allows enterprise buyers to browse B2B Commerce from their procurement system (SAP Ariba, Coupa) and transfer cart back for PO creation. Procurement system sends punchout setup request → buyer shops → cart transferred via OCI form post.
🎯 Key Points
OCI: Open Catalog Interface — SAP-based procurement systems | cXML: XML standard for US procurement (Ariba, Coupa) | Implementation: custom Apex + LWC for punchout session | Authentication: procurement system sends user token | Cart transfer: OCI form post returns selected items
🏢 XYZ Company
At XYZ Company, SAP Ariba punchout: Ariba sent OCI setup request → Apex created punchout session → buyer browsed polymer catalog → selected items → OCI form post returned cart to Ariba → Ariba created purchase requisition. Buyers never left Ariba workflow.
🎤 "B2B Commerce punchout integrates with enterprise procurement via OCI/cXML — allowing buyers to browse B2B catalog within procurement workflow and transfer cart for purchase order creation."
Q83
What is ConnectApi CommerceOrders?
⚡ Direct Answer
ConnectApi.CommerceOrders provides B2B order management: createOrder (cart → order), getOrders (history), createCartFromOrder (reorder), getOrderSummary. All enforce B2B business rules and are scoped to webStoreId.
🎯 Key Points
createOrder(webStoreId, userId): cart → Order | getOrders(webStoreId, userId, options): paginated list | createCartFromOrder(webStoreId, userId, orderId): reorder | All operations use webStoreId to scope | Apex test: ConnectApi requires specific test setup with setTestData()
🏢 XYZ Company
At XYZ Company, B2B order lifecycle: ConnectApi.CartController.addItemToCart() → ConnectApi.CommerceOrders.createOrder() (triggers approval if >£5K threshold) → approval complete → order fulfilled. All via ConnectApi — business rules enforced at every step.
🎤 "ConnectApi.CommerceOrders is B2B Commerce's complete order lifecycle API — enforcing all business rules from cart conversion through reorder."
Q84
How do you implement a loyalty program in B2C Commerce?
⚡ Direct Answer
No native loyalty — custom implementation or third-party. Custom: Customer custom attribute for points balance, Custom Object for transaction log, order hook (app.order.created) for earning, custom promotion for redemption.
🎯 Key Points
Customer custom attribute: points_balance | Earn: app.order.created hook → Transaction.wrap updates points | Redeem: custom Promotion with threshold condition (100 points = £1) | Points history: Custom Object per transaction | Display: ISML component showing balance
🏢 XYZ Company
At XYZ Company, polymer loyalty: 1 point per £1 spent via app.order.created hook. Redeemable at checkout (100 points = £1 discount). Points history in Custom Object. Balance displayed in account page and mini-cart. 40% of lubricant revenue moved to subscription model.
🎤 "B2C Commerce has no native loyalty — implement via Custom Attributes for balance, order hooks for earning, and custom promotions for redemption."
Q85
What is Einstein Predictive Sort?
⚡ Direct Answer
Einstein Predictive Sort personalizes PLP sort order per individual shopper — ML on behavioral signals (clicks, purchases, time-on-page) to rank products a customer is most likely to buy at the top of category/search results.
🎯 Key Points
Configuration: BM → Einstein → Predictive Sort | Data: logged-in customers with sufficient behavioral history | A/B testing: compare vs manual sort rules | Guest users: insufficient data — use standard sort (best sellers) | Continuously learns from new behavioral data
🏢 XYZ Company
At XYZ Company, Predictive Sort for logged-in customers, Best Sellers for guests. A/B test: 2 weeks, Predictive Sort +14% category conversion. Rolled to 100% of logged-in users. Combined Einstein features: +22% revenue per session over 6 months.
🎤 "Predictive Sort uses Einstein ML to rank listing products per individual shopper — typically improving category conversion 10-20% vs static sort rules for logged-in users."
Q86
How would you architect B2C Commerce for a global brand with 20+ markets?
⚡ Direct Answer
Global architecture: single organization with 20+ sites (one per market), shared master catalog, market-specific site catalogs, localized price books per currency/country, resource bundle localization, Akamai CDN with regional edge nodes.
🎯 Key Points
One codebase: single cartridge deployment | Site-per-market: 20 sites in one organization | Master catalog: all products defined once | Price books: one per market | Resource bundles: per locale | OCAPI: siteId scoping per market | New market: 2 days BM configuration vs months for separate platform
🏢 XYZ Company
At XYZ Company's global expansion: 12 markets from one organization. Master catalog: 50K products. 12 site catalogs (regional availability). 8 currencies, 12 locales. One codebase. New market launch: 2 days configuration.
🎤 "Global B2C architecture uses site-per-market in one organization — sharing master catalog and codebase while isolating market-specific price books, promotions, and catalog assignments."
Q87
How do you handle Black Friday architecture in B2C Commerce?
⚡ Direct Answer
Black Friday: CDN pre-warm top 1,000 products, move heavy Jobs to off-peak, verify OCAPI rate limit headroom, load test on staging at 10x traffic, prepare disaster recovery runbook, implement real-time monitoring with PagerDuty alerts.
🎯 Key Points
CDN pre-warming: seed top products into Akamai before traffic starts | Jobs: suspend all non-critical jobs during peak hours | OCAPI rate limits: check daily quota headroom | Checkout: no CDN, ensure capacity | Payment gateway: confirm capacity with vendor | War room: developer + ops + marketing in Slack
🏢 XYZ Company
At XYZ Company, Black Friday prep (2 weeks prior): staging load test at 50K concurrent users, CDN pre-warm top 500 products, all non-critical jobs suspended 8AM-midnight. Result: 98% CDN hit rate, zero performance incidents, highest-ever conversion rate.
🎤 "Black Friday requires CDN pre-warming, job scheduling optimization, load testing, and real-time monitoring — preparation starts 2 weeks before the event."
Q88
What is the role of SFTP in B2C Commerce integrations?
⚡ Direct Answer
SFTP is B2C Commerce's primary file exchange mechanism. Built-in SFTP server configured in Business Manager. External systems (PIM, ERP, WMS) push/pull files via SFTP. Jobs process incoming files and export outgoing data in proprietary XML schemas.
🎯 Key Points
SFTP paths: /impex/src/ for imports, /impex/dst/ for exports | Import files: products (XML), price books (XML), inventory (XML) | Export files: orders for ERP, customer data | File formats: Salesforce B2C Commerce XML schemas | Security: SFTP with SSH key authentication
🏢 XYZ Company
At XYZ Company, SFTP integration: Akeneo PIM exports product XML nightly → pushes to B2C SFTP → ImportProducts Job at 11PM. SAP polls /impex/dst/orders/ hourly → processes order exports. Inventory WMS pushes stock XML every 2 hours.
🎤 "SFTP is B2C Commerce's primary file exchange mechanism — standardized XML formats for catalog, price book, inventory, and order data processed by Business Manager Jobs."
Q89
How do you implement A/B testing in B2C Commerce?
⚡ Direct Answer
B2C A/B testing via session-based customer group split: randomly assign customers to groups via session attribute, serve different Slot configurations or promotions per group. For advanced: dedicated tools (Optimizely, AB Tasty) with client-side rendering.
🎯 Key Points
Native: session attribute assigns GroupA or GroupB (50/50) → different Slot Content Asset per group | Analytics: Google Analytics event tracking per variant | Statistical significance: minimum 1,000 impressions per group before calling winner | Clean up: remove losing variation after decision
🏢 XYZ Company
At XYZ Company, A/B tested homepage hero: Banner A (product) vs Banner B (value-proposition). Session random assignment. 2 weeks + 5,000 impressions: Banner B +23% CTR, +8% conversion. Statistical significance 99%. Banner B permanent.
🎤 "B2C Commerce A/B testing uses session-based customer group splits and Slot configurations — with statistical significance requirements and clean test infrastructure removal after decisions."
Q90
What is Content Security Policy (CSP) in B2C Commerce?
⚡ Direct Answer
CSP prevents XSS by whitelisting approved external resources. Configured in Business Manager Administration → Sites → CSP. Use report-only mode first to discover existing violations, then switch to enforcing after whitelisting all required domains.
🎯 Key Points
Directives: script-src, style-src, img-src, frame-src | Report-only mode: log violations without blocking — 2-week discovery | Enforcing mode: block unauthorized resources | Common whitelist: Google Analytics, Stripe, Einstein, live chat tools | Violation monitoring: BM CSP violation reports
🏢 XYZ Company
At XYZ Company, CSP: 2 weeks report-only — discovered 12 external domains (analytics, payment, live chat). Added all to allowlist. Enabled enforcing mode — zero CSP violations. Security audit passed. XSS attack vector eliminated.
🎤 "B2C Commerce CSP prevents XSS by whitelisting external resources — implement report-only mode for discovery, then enforcing mode after comprehensive allowlisting."
Q91
What is the sfcc-ci CLI?
⚡ Direct Answer
sfcc-ci is Salesforce's Node.js CLI for B2C Commerce automation: authenticate, upload code, activate code versions. Enables Git-based CI/CD (GitHub Actions, Jenkins) replacing manual WebDAV uploads for development iteration.
🎯 Key Points
sfcc-ci auth:login, sfcc-ci code:push, sfcc-ci code:activate | dw.json: instance config file | GitHub Actions: npm install sfcc-ci → authenticate → push → test → promote | Full pipeline: 8-15 minutes from commit to staging
🏢 XYZ Company
At XYZ Company: commit → GitHub Action → npm run build → sfcc-ci code:push to dev sandbox → tests → sfcc-ci code:activate on staging → manual approval → production. Full pipeline: 12 minutes.
🎤 "sfcc-ci enables Git-based CI/CD for B2C Commerce — automating cartridge upload, activation, and promotion via GitHub Actions or Jenkins."
Q92
What is the role of Akamai CDN in B2C Commerce?
⚡ Direct Answer
Akamai is B2C Commerce's built-in CDN — sitting in front of application servers for global edge caching. Serves static assets, cached page responses, provides DDoS protection. Configured in Business Manager CDN Settings.
🎯 Key Points
CDN Settings: Administration → Sites → CDN Settings | Cache rules: define cacheable URLs and TTLs | Cache purge: triggered from BM after catalog updates | Static assets: infinite TTL with version-based busting | Black Friday: 98% CDN hit rate absorbs majority of traffic
🏢 XYZ Company
At XYZ Company, Akamai: static (infinite TTL), PDP (30 min), category (5 min). Black Friday: 50,000 concurrent users — Akamai served 98% from edge, origin received 2% of traffic.
🎤 "Salesforce B2C Commerce uses Akamai CDN as its global edge network — caching pages and static assets at the edge to handle peak traffic with minimal origin server load."
Q93
What are the key B2C Commerce certifications?
⚡ Direct Answer
Key certifications: B2C Commerce Developer (foundational — SFRA, cartridges, Business Manager), B2C Commerce Architect (advanced — integration patterns, performance, architecture decisions). Both via Trailhead and Salesforce certification program.
🎯 Key Points
B2C Developer: entry-level, SFRA + BM fundamentals | B2C Architect: senior-level, integration patterns + performance | B2B Commerce Administrator: B2B configuration | B2B Commerce Developer: Apex, ConnectApi, LWC | Trailhead Commerce trails: free preparation
🏢 XYZ Company
At XYZ Company, developer certification path: B2C Developer (Month 3), Salesforce Admin (Month 6), B2C Architect (Month 12 after production experience). Each aligned with actual project responsibilities.
🎤 "B2C Commerce Developer validates SFRA fundamentals; B2C Architect validates integration patterns and performance architecture — recommended with production experience between them."
Q94
How does session management work in B2C Commerce?
⚡ Direct Answer
Server-side sessions stored in application server memory. Session data: auth status, basket reference, locale, currency, customer groups. Session size < 100KB critical. OCAPI/headless: JWT tokens replace sessions entirely — stateless.
🎯 Key Points
Session.customer: current customer | Session.basket: cart shortcut | Session currency/locale: customer preferences | Custom attributes: small application state only | Session size: keep < 100KB — large objects cause memory pressure | Headless: JWT tokens, no server session
🏢 XYZ Company
At XYZ Company, session audit: 8 custom attributes storing large objects. Reduced to IDs only (load on demand). Memory usage reduced 40%. Headless mobile app: JWT tokens, completely stateless — no server sessions at all.
🎤 "B2C Commerce sessions store authentication, basket, and preferences server-side — OCAPI/headless uses JWT for stateless authentication with no server session overhead."
Q95
What is the role of Akamai in B2C Commerce security?
⚡ Direct Answer
Akamai provides DDoS protection, bot management, and WAF (Web Application Firewall) for B2C Commerce. Additionally: SSL/TLS termination at the edge, IP-based rate limiting, and geographic access controls — all before traffic reaches B2C Commerce application servers.
🎯 Key Points
DDoS protection: absorbs volumetric attacks before reaching B2C | Bot management: identifies and blocks malicious bots (scrapers, credential stuffing) | WAF: filters malicious HTTP requests (SQL injection, XSS attempts) | SSL/TLS: terminated at Akamai edge | Geographic blocking: restrict access by country if needed
🏢 XYZ Company
At XYZ Company, Akamai security: bot management blocked 40% of traffic as bot traffic (scrapers, security scanners). DDoS: absorbed 200Gbps attack during competitor campaign — B2C Commerce unaffected. WAF: blocked SQL injection attempts against product search. All security at CDN edge.
🎤 "Akamai provides B2C Commerce's security perimeter — DDoS protection, bot management, WAF, and SSL termination at the edge before any traffic reaches application servers."
🔗

Integration & Headless Architecture

Q96–Q110 · ERP, Marketing Cloud, OMS, composable commerce

Q96
What is headless B2C Commerce integration architecture?
⚡ Direct Answer
Headless B2C Commerce: SCAPI/OCAPI serve as the commerce microservice. Frontend (React PWA Kit or custom) calls Salesforce Commerce APIs for catalog, cart, checkout. Backend integrations (ERP, WMS, Marketing Cloud) connect via OCAPI Data API or middleware.
🎯 Key Points
SCAPI: consumer-facing Shopper APIs | OCAPI Data API: merchant/backend operations | MuleSoft: middleware hub for complex transformations | Commerce events: webhooks/Platform Events for real-time integration | CDN: Akamai/Fastly in front of all API calls
🏢 XYZ Company
At XYZ Company, headless architecture: React PWA Kit → SCAPI (consumer) + MuleSoft → SAP ERP (inventory/orders) + MC Connector → Marketing Cloud (emails). Clean separation of concerns. SCAPI handled 95% of storefront API calls.
🎤 "Headless B2C Commerce uses SCAPI for consumer operations, OCAPI Data API for merchant integrations, and middleware for complex ERP/WMS transformations."
Q97
How does Commerce Cloud integrate with Marketing Cloud?
⚡ Direct Answer
B2C Commerce to Marketing Cloud integration: Commerce Cloud Connector syncs basket data for abandoned cart emails, order events trigger Journey Builder, customer profiles sync to MC Subscribers. Connector automates all data flows via SFTP and API.
🎯 Key Points
Commerce Cloud Connector: pre-built integration cartridge | Abandoned basket: Job exports basket → MC SFTP → Journey sends reminder email | Order confirmation: order event → MC Journey | Einstein data in MC email templates | Customer data sync: B2C Customer → MC Subscriber
🏢 XYZ Company
At XYZ Company, MC integration: abandoned cart → 2-hour export to MC → personalized email with actual cart items → 24-hour follow-up with 10% discount. Cart recovery rate: 12%. ROI justified integration cost in 3 months.
🎤 "B2C Commerce to Marketing Cloud integration powers abandoned cart recovery and transactional emails via Commerce Cloud Connector and Journey Builder automation."
Q98
What is Salesforce Order Management and its role in Commerce Cloud?
⚡ Direct Answer
SF Order Management (OMS) handles post-purchase orchestration: fulfillment routing, inventory sourcing, returns, exchanges, shipping updates. Integrates with B2C Commerce (order source), warehouses/3PLs, and Service Cloud (customer service agents).
🎯 Key Points
OMS: post-purchase (after B2C places order) | B2C: order capture at checkout | OMS: routes to warehouse, manages returns and refund orchestration | Service Cloud: agents see real-time order status | Integration: B2C order event → OMS API → warehouse → tracking update
🏢 XYZ Company
At XYZ Company, B2C captured polymer orders. OMS routed to nearest warehouse based on inventory and location. Returns handled by OMS. Service agents saw real-time order status in Service Console — resolution time -40%.
🎤 "Salesforce Order Management handles post-purchase orchestration — fulfillment routing and returns — integrating B2C Commerce with warehouse systems and Service Cloud."
Q99
How do you implement a custom product configurator?
⚡ Direct Answer
Configurator: ISML/React UI for selections, client-side JS for interactive state, AJAX to custom controller for server-side price calculation and compatibility validation, Custom ProductLineItem attributes for cart storage.
🎯 Key Points
Client-side: step-by-step selection UI | AJAX: GET /Configurator-Calculate → validates compatibility, returns price | Add to cart: stores configuration in ProductLineItem custom attributes | Order: configuration persists for fulfillment engineering team | Transaction.wrap() for all cart writes
🏢 XYZ Company
At XYZ Company, polymer configurator: buyer selects material grade + diameter + length + fittings → AJAX validates compatibility + returns real-time price → Add to Cart stores configuration on ProductLineItem. Engineer receives full specification sheet automatically.
🎤 "Product configurator: client-side interactive UI + server-side AJAX validation — configuration stored in ProductLineItem custom attributes persisting through the order lifecycle."
Q100
What is Platform Cache and when should you use it?
⚡ Direct Answer
Platform Cache (dw.system.CacheMgr) provides application-level in-memory caching for expensive computations: pricing matrices, external API responses, configuration data — separate from page-level template caching.
🎯 Key Points
CacheMgr.getCache('name', SCOPE_GLOBAL, SCOPE_GLOBAL).put(key, value, ttl) | get(key) — null if expired | Max TTL: 24 hours | Use for: pricing calculations, ERP data, classification data | Not for: personalized data, session data | Refresh via Job
🏢 XYZ Company
At XYZ Company, polymer pricing matrix (5,000 entries) in Platform Cache (30-min TTL). First request: 2.1 seconds. Subsequent: 8ms. PDP price near-instant for 99.7% of requests. Cache refreshed by nightly pricing Job.
🎤 "Platform Cache is application-level in-memory caching for expensive computations — complementing page-level with reusable data caching across requests."
Q101
How do you implement multi-site with shared catalog in B2C Commerce?
⚡ Direct Answer
Multi-site with shared catalog: one master catalog organization-wide containing all products with full attributes. Each site has its own site catalog with site-specific category structure and product assignments. One product definition, multiple site presentations.
🎯 Key Points
Master catalog: one per organization, all products defined once | Site catalogs: one per site, category structure + product assignment | Assignment: product must be assigned to site catalog category to appear on that site | Price books: site-specific, different currency/pricing per site | Promotions: site-specific — UK promotions don't affect EU site
🏢 XYZ Company
At XYZ Company, one master catalog with 50K polymer products. UK site catalog: tubing → fitting → adhesive category structure. EU site catalog: different category hierarchy, different product assignments (some products not sold in EU). One code deployment, market-specific catalog configuration.
🎤 "Multi-site shared catalog uses one organization-level master catalog with per-site catalog assignments — enabling market-specific product visibility from one product definition."
Q102
What are OCAPI custom endpoints and how do you create them?
⚡ Direct Answer
OCAPI custom endpoints extend the standard OCAPI by registering custom routes in the OCAPI configuration. Created in Business Manager as OCAPI type 'custom' — these appear as /dw/shop/v23_1/custom_objects/... or via custom OCAPI hook scripts that intercept and extend existing endpoints.
🎯 Key Points
Custom endpoints: BM → Administration → Sites → OCAPI → Custom | Alternative: OCAPI hooks intercept existing endpoints to add custom behavior | Custom object OCAPI: /dw/data/v23_1/custom_objects automatically available | Custom scripts: OCAPI before/after hooks for request/response modification
🏢 XYZ Company
At XYZ Company, custom OCAPI endpoint exposed polymer compatibility check: BM registered custom OCAPI endpoint /custom/polymer_compatibility → ISML controller handled request → validated polymer grade + temperature compatibility → returned compatibility result. Mobile app used this endpoint to show compatibility warnings on PDP.
🎤 "OCAPI custom endpoints extend standard Commerce APIs — registered in Business Manager or via hooks that intercept existing endpoints, enabling platform-specific business logic exposure via RESTful API."
Q103
How do you implement subscription products in B2C Commerce?
⚡ Direct Answer
Subscription products: store subscription frequency in ProductLineItem custom attributes, integrate billing platform (Salesforce Billing or Stripe Subscriptions) for recurring charges, customer subscription management via account pages.
🎯 Key Points
Custom attributes: OrderLineItem subscription_frequency, subscription_start_date | Order hook: app.order.created → creates subscription record in billing platform | Billing: Stripe Subscriptions via HTTPClient | Customer portal: view/modify/cancel via account page ISML/LWC | Dunning: handled by billing platform
🏢 XYZ Company
At XYZ Company, polymer lubricant subscription: customer selects monthly delivery → OrderLineItem custom attribute subscription_frequency=monthly → order placed → app.order.created hook calls Stripe Subscriptions API → recurring charge created. 40% of lubricant revenue moved to subscription model.
🎤 "B2C Commerce subscriptions require custom OrderLineItem attributes and billing platform integration — using order hooks to create subscription records and account pages for self-service management."
Q104
What are the key Commerce Cloud security certifications and compliance requirements?
⚡ Direct Answer
Commerce Cloud B2C: PCI DSS compliance (payment tokenization required — no card data on B2C servers), SOC 2 (Salesforce platform-level), GDPR (customer data management), and accessibility (WCAG 2.1 AA for EU markets). B2B Commerce: inherits Salesforce platform security (SOC 2, ISO 27001).
🎯 Key Points
PCI DSS: client-side tokenization (Stripe Elements, Adyen Web Components) keeps card data off B2C | SOC 2: Salesforce provides SOC 2 reports for the platform | GDPR: anonymization, consent management, data export | WCAG 2.1 AA: required European Accessibility Act from 2025 | CSP: XSS prevention for all custom scripts
🏢 XYZ Company
At XYZ Company, compliance checklist: PCI — Stripe tokenization confirmed, no card data touched B2C servers; GDPR — anonymization Job + consent management implemented; WCAG 2.1 AA — accessibility audit passed after fixing 4 ISML components; SOC 2 — Salesforce report provided to security team. All compliance requirements met.
🎤 "Commerce Cloud compliance requires PCI DSS via payment tokenization, GDPR anonymization and consent management, WCAG 2.1 AA for accessibility, and Salesforce platform SOC 2 for data security."
Q105
How does Commerce Cloud handle large-scale catalog management?
⚡ Direct Answer
Large catalog management: Master Catalog with up to 500K+ products. Nightly full imports via SFTP XML Job, hourly delta imports for changes, search index rebuilds post-import. For extreme scale: custom attribute indexing, search relevance tuning, and category hierarchy optimization.
🎯 Key Points
Master catalog limit: practical limit ~500K products | Full import: replace all data, run off-peak | Delta import: update changed only, run frequently | Search index rebuild: triggered by BM or auto-post-import | Category depth: max 5-6 levels deep for performance | Attribute count: limit searchable attributes to 20-25 for index size
🏢 XYZ Company
At XYZ Company, 50K polymer products across 8 categories. Full import nightly (45 min), delta every 2 hours (5 min for typical 500 changed products). Search index rebuilt post-full-import automatically. 15 searchable attributes — carefully chosen for facet value.
🎤 "Large B2C Commerce catalogs use full SFTP imports for nightly refresh and frequent delta imports for changes — with search index management and searchable attribute selection critical for performance at scale."
Q106
What is the Commerce Cloud Composable Storefront strategy?
⚡ Direct Answer
Composable Storefront (Salesforce's term for headless commerce) uses best-of-breed microservices: B2C Commerce (cart, orders, pricing via SCAPI), specialized search (Algolia), CMS (Contentful), and CDN (Fastly). Each component independently scalable and replaceable.
🎯 Key Points
B2C Commerce role: cart/order/pricing microservice | External search: Algolia for better relevance + AI search | External CMS: Contentful for better editorial UX | CDN: Fastly/Akamai for edge personalization | Trade-off: composable = flexibility + complexity + vendor management | PWA Kit: Salesforce's opinionated composable starting point
🏢 XYZ Company
At XYZ Company, composable evaluation: B2C Commerce search retained (50K SKUs + technical attributes — sufficient). Contentful added for marketing content pages (better for non-technical editors). Partial composable — right tool for each job.
🎤 "Composable Storefront uses B2C Commerce as the cart/order microservice — combined with specialized best-of-breed search, CMS, and CDN components based on specific requirements."
Q107
How does B2B Commerce connect to Salesforce Revenue Cloud/CPQ?
⚡ Direct Answer
B2B Commerce to CPQ: products and pricing defined in CPQ flow to B2B Commerce pricebooks. Quotes created in CPQ become B2B Commerce orders. Contract pricing negotiated in CPQ auto-populates B2B pricebooks. One source of truth for pricing across CPQ quoting and self-service ordering.
🎯 Key Points
CPQ → Pricebook: contract terms create PricebookEntry records | B2B Commerce assignment: Buyer Group linked to CPQ-generated Pricebook | Self-service: buyer sees CPQ-negotiated price on B2B portal | Quote to Order: CPQ quote approved → B2B Commerce order auto-created | Bi-directional: complex orders can be created in BM and flow to CPQ for invoicing
🏢 XYZ Company
At XYZ Company, CPQ-B2B integration: sales negotiated polymer pricing in CPQ → contract approved → Apex created PricebookEntry for each product → assigned to distributor's Buyer Group → B2B portal showed contracted price immediately. Sales renegotiation: CRM updated → B2B portal reflected in real-time. Zero manual B2B price management.
🎤 "B2B Commerce CPQ integration creates one pricing source of truth — CPQ-negotiated contract prices auto-populate B2B Commerce pricebooks, enabling self-service ordering at agreed contract rates."
Q108
What are Commerce Cloud Agentforce integration patterns?
⚡ Direct Answer
Agentforce integrates with B2C Commerce via Commerce Actions: AI agent queries catalog via SCAPI, manages cart, answers order status questions, handles returns initiation. For B2B: agent assists with product discovery (technical specifications matching) and reorder.
🎯 Key Points
Commerce Actions: Agentforce agent equipped with SCAPI tools | Product discovery: 'Which tube handles 180°C at 50 PSI?' → agent queries catalog → recommends | Cart management: agent adds items, applies coupon codes | Order service: agent queries status, initiates returns | Data Cloud: customer purchase history informs agent context
🏢 XYZ Company
At XYZ Company, Agentforce commerce pilot: B2B portal AI agent. Buyer: 'Which silicone tube handles 220°C and 50 PSI?' → agent queries SCAPI with temperature + pressure attributes → returns 3 matching grades → buyer adds to cart via agent. Product discovery time: 25 min → 3 min.
🎤 "Agentforce brings conversational AI to Commerce Cloud — agents query catalogs via SCAPI, manage carts, and answer order inquiries, enabling technical product discovery without human agents."
Q109
How do you implement B2C Commerce custom checkout steps?
⚡ Direct Answer
Custom checkout step: (1) Controller route (Checkout-CustomStep) returning ISML or JSON; (2) Client-side JavaScript handles step transition; (3) Server-side validation before proceeding; (4) Store step data in basket custom attributes; (5) Integrate with SFRA checkout stage flow.
🎯 Key Points
Controller: server.get('Checkout-CustomStep', ...) | Validation: server validates input before calling next() | Basket storage: basket.custom.myStepData = value (Transaction.wrap()) | Client-side: AJAX call to validate, proceed on success | Back navigation: each step handles back button | Order custom attributes: persist step data to order
🏢 XYZ Company
At XYZ Company, custom checkout step for polymer compliance declaration: customer confirms regulatory usage before proceeding to payment. ISML form → controller validates checkbox → stores compliance_acknowledged in basket custom attribute → persists to Order. Regulatory requirement met within standard SFRA checkout flow.
🎤 "Custom SFRA checkout steps add controller routes with server-side validation — storing step data in basket custom attributes and integrating with the standard SFRA checkout stage flow."
Q110
What is the Commerce Cloud Einstein suite and what are its components?
⚡ Direct Answer
Commerce Cloud Einstein suite: Predictive Sort (ML-based per-shopper product ranking), Product Recommendations (collaborative filtering zones), Visual Search (image-based discovery), Search Dictionaries (synonym expansion), Einstein Personalization (individualized experiences).
🎯 Key Points
Predictive Sort: per-user behavioral ML ranking — +10-15% category conversion | Product Recommendations: You May Also Like zones — +5-10% AOV | Visual Search: image-based product discovery | Search Dictionaries: reduce zero-result searches from 15% to 3-5% | All require behavioral data volume | A/B test before full rollout
🏢 XYZ Company
At XYZ Company, Einstein full implementation: Predictive Sort (+14% conversion), 4 recommendation zones (+8% AOV), Search Dictionaries (zero-results: 18% → 4%). Combined impact: +22% revenue per session over 6 months. A/B tested each feature independently.
🎤 "Commerce Cloud Einstein provides AI personalization through Predictive Sort, Product Recommendations, Visual Search, and Search Dictionaries — all trained on behavioral data with ROI validated via A/B testing."

Einstein, Performance & Security

Q111–Q120 · AI features, performance optimization, compliance

Q111
How would you architect a B2C Commerce solution for flash sales?
⚡ Direct Answer
Flash sale architecture: (1) CDN pre-warm all flash sale products; (2) Suspend non-critical Jobs during sale; (3) Inventory reservation system (Custom Object or OMS); (4) Queue management for checkout (rate-limit basket creation); (5) Real-time monitoring with instant rollback capability.
🎯 Key Points
CDN pre-warming: all flash sale products cached before start | Inventory reservation: Custom Object locking inventory during checkout (prevent oversell) | Queue: JavaScript waitroom if concurrent checkout exceeds threshold | OCAPI rate limits: verify headroom for expected checkout volume | Rollback: disable flash sale promotion without code deployment (Custom Preference)
🏢 XYZ Company
At XYZ Company, flash sale implementation: 48-hour CDN pre-warm for 200 flash products, inventory reservation via Custom Object (60-second lock during checkout), waitroom JS for >500 concurrent checkouts, Custom Preference feature flag for instant disable. Result: 10,000 units sold in 4 minutes. Zero oversell. Zero site downtime.
🎤 "Flash sale architecture requires CDN pre-warming, inventory reservation to prevent oversell, checkout queue management for traffic spikes, and instant-disable capability via Custom Preferences."
Q112
What are common B2C Commerce integration failure modes?
⚡ Direct Answer
Common failures: external service timeout (ERP, payment gateway), rate limit exhaustion, SFTP data feed failures, search index corruption, session layer failure. Resilience: circuit breakers, stale cache fallbacks, exponential backoff, dead letter queues.
🎯 Key Points
Payment gateway: retry 3x with backoff, show friendly error, preserve basket | ERP timeout: serve stale cached data, flag for async update | SFTP failure: alert + continue with existing catalog (don't delete existing) | OCAPI 429: CDN caching reduces dependency | Health check: synthetic monitoring + PagerDuty alerting
🏢 XYZ Company
At XYZ Company resilience patterns: ERP down → Platform Cache serves 15-min stale stock (acceptable), order flagged for async ERP notification. Payment gateway timeout → retry 3x, basket preserved, friendly error. SFTP failure → existing catalog unchanged, merchandising team alerted immediately.
🎤 "B2C Commerce resilience requires circuit breakers for external services, stale cache fallbacks, graceful degradation for non-critical services, and alerting for guaranteed eventual consistency."
Q113
How does B2C Commerce handle personalized pricing?
⚡ Direct Answer
Personalized pricing: Customer Group price books (different prices per segment), discount promotions per customer group (auto-applying), and OCAPI returning pricing based on active price books for the customer's group. No single-customer pricing — only group-level.
🎯 Key Points
Customer group price books: VIP gets VIP_Pricebook, standard gets Standard_Pricebook | Promotion-based discounts: Campaign targets specific customer group → promotion auto-applies | OCAPI: prices returned based on customer's active groups | Limitation: no individual customer pricing — only group level | Custom approach: custom promotion script for individual pricing
🏢 XYZ Company
At XYZ Company, personalized pricing: VIP customer group assigned VIP_Pricebook (15% lower list prices) + VIP Campaign promotion (additional 5% off for orders >£500). OCAPI returned VIP price automatically for logged-in VIP customers. Guest users: list prices only.
🎤 "B2C Commerce personalized pricing uses Customer Group price books and targeted promotions — group-level pricing resolution with OCAPI automatically returning appropriate prices for authenticated customer groups."
Q114
What is the B2C Commerce OCAPI configuration best practices?
⚡ Direct Answer
OCAPI configuration best practices: minimum required resources only (don't enable all resources), IP-based restrictions for Data API, separate client IDs per integration (mobile, ERP, marketing), appropriate rate limits per client, JWT token lifetime minimized, and OCAPI versioning.
🎯 Key Points
Minimum resources: only enable what each integration needs | IP restrictions: Data API restricted to known server IPs | Separate client IDs: mobile app, ERP, marketing each get own client ID | Rate limits: configure per-client limits | JWT lifetime: 30 minutes max | Versioning: use specific version (v23_1) not wildcard | Monitor: OCAPI usage reports in BM
🏢 XYZ Company
At XYZ Company, OCAPI config: mobile app client ID (Shop API only, no Data API), ERP client ID (Data API only, IP restricted to ERP server), Marketing Cloud client ID (Shop API hooks only). Each integration isolated — ERP compromise wouldn't affect mobile app.
🎤 "OCAPI best practices: minimum resource enablement per client, IP restriction for Data API, separate client IDs per integration, and JWT lifetime minimization for security."
Q115
How do you implement Commerce Cloud analytics and reporting?
⚡ Direct Answer
Analytics: Google Analytics 4 for UX and conversion tracking, Business Manager built-in reports (orders, revenue, product performance), Einstein Analytics for advanced insights, and custom Log Center parsing for API performance monitoring.
🎯 Key Points
GA4 ecommerce events: view_item_list (PLP), view_item (PDP), add_to_cart, begin_checkout, purchase | ISML: dataLayer.push({event:'view_item', ecommerce:{...}}) | GTM: tag management layer | BM reports: Orders, Revenue, Promotion Effectiveness | Einstein Analytics: customer segments, cohort analysis
🏢 XYZ Company
At XYZ Company, analytics stack: GA4 (UX + conversion funnel), BM reports (product performance, promotion effectiveness), custom Grafana (OCAPI response times). Promotion effectiveness: Summer Campaign drove £47K revenue in first week — 340% ROAS. Cart abandonment: 68% drop between PDP and checkout identified.
🎤 "Commerce Cloud analytics combines GA4 ecommerce events from ISML templates with Business Manager commerce reports — providing full conversion funnel visibility from product impression to purchase."
Q116
What is the B2B Commerce product catalog architecture?
⚡ Direct Answer
B2B Commerce catalog: standard Salesforce Product2 and Pricebook2 objects — same objects used by CPQ and CRM quoting. ProductCategory and ProductCategoryProduct junction for category structure. WebStore links catalog, pricebook, and entitlement policies.
🎯 Key Points
Standard objects: Product2, Pricebook2, PricebookEntry | Category: ProductCategory + ProductCategoryProduct junction | WebStore: central config linking catalog + pricebook + entitlement | Same products used in CRM, CPQ, and B2B Commerce | Entitlement: ProductEntitlementPolicy controls per-account access | Media: ContentDocument linked to Product2 for data sheets
🏢 XYZ Company
At XYZ Company, polymer products defined once as Product2 — used in B2B Commerce storefront (ordering), Salesforce CPQ (quoting), and CRM (account management). One source of truth. Price negotiated in CPQ → PricebookEntry → B2B Commerce shows contracted price. No manual sync.
🎤 "B2B Commerce catalog uses standard Salesforce Product2 and Pricebook2 — one source of truth shared between B2B Commerce, CPQ, and CRM quoting."
Q117
How does Commerce Cloud handle returns and refunds?
⚡ Direct Answer
Returns in B2C Commerce: no native support — custom implementation or Salesforce Order Management. Custom: Return_Request custom object, customer selects items via storefront, fulfillment team processes, refund via payment gateway HTTPClient call. OMS: full native return management.
🎯 Key Points
Custom return: Return_Request__c custom object + order context | Return reasons: custom attribute | Refund: payment gateway refund API via HTTPClient | Return labels: FedEx/UPS API for label generation | OMS: preferred enterprise solution — manages RMA, refund orchestration, and return routing | Customer portal: self-service return initiation LWC
🏢 XYZ Company
At XYZ Company, custom return implementation: customer selects items to return → Apex creates Return_Request__c + notifies warehouse → warehouse confirms receipt → Apex calls Stripe refund API → confirmation email. 5-day return cycle. OMS evaluation planned for next phase to eliminate manual steps.
🎤 "B2C Commerce has no native returns — custom implementations use Custom Objects and payment gateway API calls for refunds, while Salesforce Order Management provides enterprise return orchestration."
Q118
What is the future roadmap for Salesforce Commerce Cloud?
⚡ Direct Answer
Commerce Cloud direction: PWA Kit replacing SFRA, SCAPI replacing OCAPI, deeper Agentforce AI integration (conversational commerce), B2B/B2C convergence via B2B2C architecture, and Data Cloud for real-time personalization across commerce touchpoints.
🎯 Key Points
PWA Kit: current strategic investment — new SFRA features minimal | SCAPI: new API features go here first | Agentforce: AI shopping assistants via Commerce Actions | B2B2C: hybrid architecture for brands selling both channels | Einstein + Data Cloud: real-time personalization from unified customer profiles
🏢 XYZ Company
At XYZ Company, technology roadmap: PWA Kit migration (underway), Agentforce commerce pilot (technical product discovery bot), Data Cloud integration (unified customer profile), B2B2C evaluation (single experience for distributors who also buy direct). Future state: AI-assisted polymer product selection.
🎤 "Commerce Cloud's strategic direction is PWA Kit + SCAPI + Agentforce AI — moving toward standard React technology, modern APIs, and conversational AI-powered commerce."
Q119
How do you architect Commerce Cloud for GDPR compliance at scale?
⚡ Direct Answer
GDPR at scale: automated data export Jobs (customer profile + order data on request), scheduled anonymization batch (process pending erasure requests), consent management platform (Custom Preference + Customer attribute), and data retention Jobs (delete guest data after 90 days).
🎯 Key Points
Data export Job: scheduled, generates customer PII export on request | Anonymization batch: processes queue of erasure requests overnight | Consent: Customer custom attribute marketingConsent + timestamp, captured at all touchpoints | Retention: Guest customer data deleted after 90 days via Job | Audit log: Custom Object tracking all GDPR operations
🏢 XYZ Company
At XYZ Company, GDPR at scale: 50 erasure requests per month. Anonymization Job ran nightly — processed pending requests automatically. Consent captured at registration, login, and email subscription. Data retention: guest data deleted after 90 days. Legal team: 100% GDPR compliant since implementation.
🎤 "B2C Commerce GDPR at scale requires automated anonymization batches, consent tracking as Customer attributes, data retention Jobs, and audit logging — ensuring compliance without manual processing."
Q120
What is the Commerce Cloud storefront accessibility implementation?
⚡ Direct Answer
B2C Commerce accessibility: SFRA base templates include semantic HTML and ARIA basics. Custom ISML must maintain: keyboard navigation, screen reader support (ARIA roles, labels), color contrast (WCAG 2.1 AA — 4.5:1 ratio), focus management for modals, alt text for images.
🎯 Key Points
ISML: use
🏢 XYZ Company
At XYZ Company, accessibility audit: 4 ISML components using
(keyboard inaccessible), 2 form fields without aria-label, product images without alt text on PLP. All fixed in one sprint. EU EAA compliance confirmed — avoiding potential fines from 2025 enforcement.
🎤 "B2C Commerce accessibility requires semantic HTML in ISML, ARIA labels on interactive elements, WCAG 2.1 AA color contrast, and keyboard navigation — mandatory for EU market compliance from 2025."
🎯

Scenarios & Best Practices

Q121–Q125 · Real-world implementation and career guidance

Q121
How do you implement Commerce Cloud with Salesforce Identity for SSO?
⚡ Direct Answer
Salesforce Identity provides SSO for B2C Commerce: customers authenticate once via Salesforce OAuth IdP and receive B2C Commerce sessions. Used for B2B+B2C shared identity — distributor logs into Salesforce once and accesses both B2B portal and B2C storefront.
🎯 Key Points
Implementation: BM → Administration → External Login Providers | OAuth2 flow: redirect to Salesforce Identity → authenticate → callback with token → B2C session created | Profile sync: customer profile from Salesforce synced to B2C customer | Social login: Salesforce Identity supports Google/Facebook passed through
🏢 XYZ Company
At XYZ Company, polymer distributor SSO: distributors logged into Salesforce (B2B portal) → automatically authenticated on B2C storefront without re-entering credentials. One Salesforce Identity login → access to both B2B account management and B2C product storefront.
🎤 "Salesforce Identity SSO provides unified authentication for B2C Commerce — customers authenticate once via Salesforce OAuth IdP and access both B2B Commerce portals and B2C storefronts."
Q122
What are the key developer skills for Commerce Cloud in 2026?
⚡ Direct Answer
Top 2026 skills: (1) PWA Kit and React for headless development; (2) SCAPI integration; (3) SFRA architecture and cartridge development; (4) B2B Commerce Apex and ConnectApi; (5) Performance optimization (Core Web Vitals); (6) CI/CD with sfcc-ci and GitHub Actions; (7) Einstein AI; (8) Agentforce commerce integration.
🎯 Key Points
PWA Kit/React: highest priority — strategic direction | SCAPI: both during OCAPI transition | SFRA: high — still majority of live implementations | B2B Commerce Apex/ConnectApi: growing enterprise demand | Core Web Vitals: table-stakes performance | sfcc-ci CI/CD: DevOps maturity | Agentforce: emerging rapidly
🏢 XYZ Company
At XYZ Company, 2026 developer investment: PWA Kit training (primary, all new development), SCAPI deep-dive, Agentforce commerce workshop (pilot project). B2B skills: ConnectApi for new distributor portal expansion. Team skill matrix updated quarterly.
🎤 "A 2026 Commerce Cloud developer needs PWA Kit/React, SCAPI, SFRA, B2B ConnectApi, Core Web Vitals performance, and Agentforce — with CI/CD via sfcc-ci as table-stakes operational skill."
Q123
How do you implement Einstein Search Dictionaries?
⚡ Direct Answer
Einstein Search Dictionaries intelligently expand search queries — synonyms, abbreviations, and compound words — reducing zero-result searches. Configured in Business Manager and continuously learns from search behavior.
🎯 Key Points
Configuration: BM → Merchant Tools → Einstein → Search Dictionaries | Types: Synonyms (tube=hose=pipe), Abbreviations (SS=stainless steel), Compounds | Machine learning: Einstein learns new patterns from behavior | Zero-result rate: primary KPI — target <5% | Manual curation: add industry-specific terminology at launch
🏢 XYZ Company
At XYZ Company, polymer Search Dictionaries: tubing→tube/hose/pipe, SI=silicone, spec sheet=data sheet. Before: 18% zero-result search rate. After: 4% zero-result rate. Revenue from previously lost search sessions: £12K/month uplift.
🎤 "Einstein Search Dictionaries reduce zero-result searches by intelligently expanding queries with synonyms and abbreviations — continuously learned from search behavior with manual curation for industry terms."
Q124
What is the Commerce Cloud B2B reorder and order history implementation?
⚡ Direct Answer
Order history: ConnectApi.CommerceOrders.getOrders(webStoreId, userId, options) returns paginated orders. Reorder: ConnectApi.CommerceOrders.createCartFromOrder(webStoreId, userId, orderId) pre-populates cart applying current pricing and entitlement.
🎯 Key Points
ConnectApi.getOrders(): filter by account, date range, status | createCartFromOrder(): one call creates cart with all previous items | Price validation on reorder: reflects current contract (may differ from original) | Entitlement validation: items removed if entitlement changed | Native B2B LWC: orderHistory and orderSummary components available
🏢 XYZ Company
At XYZ Company, reorder: buyer views order history → selects past order → Reorder All → createCartFromOrder() creates cart → reviews updated prices → checks out. Industrial buyers ordering same products weekly: 25 min → 3 min. Highest-usage portal feature.
🎤 "B2B reorder uses ConnectApi.createCartFromOrder() to pre-populate cart from previous order — automatically validating current entitlement and applying current contract pricing."
Q125
What are the biggest mistakes in a Commerce Cloud implementation project?
⚡ Direct Answer
Top project-level mistakes: (1) Big bang SFRA migration instead of phased; (2) No CDN strategy from day 1; (3) Going headless without SSR strategy (SEO disaster); (4) Modifying core cartridges (blocks all future upgrades); (5) No performance testing before go-live; (6) Underestimating OCAPI rate limits at scale.
🎯 Key Points
Big bang = high risk: migrate feature-by-feature | CDN: design CDN caching strategy in sprint 1, not sprint 10 | Headless + SSR: non-negotiable before first Google crawl | Core cartridges: code review policy needed from day 1 | Load testing: test on staging 2 weeks before go-live | OCAPI limits: load test reveals rate limit issues early
🏢 XYZ Company
At XYZ Company, lessons from 3 years: (1) Early SFRA migration attempt was big bang — switched to phased approach after 2-month delay; (2) CDN strategy added at sprint 8 — should have been sprint 1; (3) Agentforce added without performance budget — required architecture review. Now: CDN strategy, performance budget, and load test gates are mandatory before any project starts.
🎤 "The biggest Commerce Cloud project mistakes are big bang migrations, absent CDN strategy, headless without SSR, core cartridge modifications, and skipping load testing — all preventable with architectural governance from day 1."

More Free Salesforce Interview Prep

1,400+ questions across 19 topics. All free. No signup. No paywall. Ever.

Explore All Topics → Architecture Q&As
SF
By SF Interview Pro
Salesforce Interview Prep Team
Practical Q&A by working Salesforce professionals · LWC, Apex, Data Cloud & AI
About Us ↗
☕ Enjoyed this article?
SF Interview Pro is 100% free and maintained by a Salesforce professional. No ads, no paywalls, and no signup required. If this guide helped you prepare for an interview, earn a certification, or grow your Salesforce career, consider buying me a coffee! ☕💜
🇮🇳 UPI (India)
UPI QR Code to support sfinterviewpro
Pay by QR
GPay · PhonePe · Paytm · BHIM
🌎 International
PayPal QR Code to support sfinterviewpro Pay via PayPal ↗
Scan or tap to pay