
Creating B2b Commerce Store
Spin up the Salesforce Commerce B2B backend store (catalog, buyers, pricing, tax, payments) in the org before any storefront work.
Overview
Creating B2B Commerce Store is an agent skill for the Build phase that guides you through creating and configuring the Salesforce Commerce B2B backend store in the org before storefront development.
Install
npx skills add https://github.com/forcedotcom/afv-library --skill creating-b2b-commerce-storeWhat is this skill?
- Explains Commerce Store (org runtime data) vs Storefront and why the store must be created first
- Walks through WebStore settings, buyer groups, entitlement policies, and catalog/price book associations
- Covers payment gateways (Stripe, Adyen), tax providers (Avalara, Vertex, manual), and shipping method configuration
- Clarifies that the store is created via Commerce UI—not Metadata API or sf project deploy
- Maps configuration to standard objects: WebStore, BuyerGroup, EntitlementPolicy, CommerceEntitlementProduct, ProductCata
- Store configuration spans 10+ areas including buyer groups, entitlements, pricing, payments, tax, shipping, catalog, inv
- Documents 6+ standard Commerce-related objects including WebStore, BuyerGroup, EntitlementPolicy, and Pricebook2
Adoption & trust: 1.3k installs on skills.sh; 513 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a B2B commerce backend in Salesforce but confuse deployable metadata with runtime store data and risk building a storefront before buyer groups, entitlements, and payments exist.
Who is it for?
Developers on Salesforce Commerce B2B who are creating a new store via the Commerce app and must configure entitlements, price books, and payment/tax providers before any storefront.
Skip if: Teams not on Salesforce Commerce B2B, headless-only shops with no org store step, or anyone expecting to provision WebStore entirely through Metadata API deploy.
When should I use this skill?
You are starting Salesforce Commerce B2B and must create the Commerce Store backend in the org before building or connecting a storefront.
What do I get? / Deliverables
You get a correctly ordered Commerce Store setup in the org with catalog, entitlements, pricing, and provider hooks documented—ready to attach a storefront or integration layer next.
- Configured Commerce Store runtime settings in the Salesforce org
- Buyer groups, entitlement policies, and catalog/price book associations aligned to B2B accounts
- Documented payment, tax, and shipping provider setup for the store
Recommended Skills
Journey fit
Creating the Commerce Store is backend platform setup in Salesforce—runtime store configuration that must exist before you integrate or build a B2B storefront. The skill centers on wiring Commerce objects, policies, and third-party providers (payments, tax, shipping) into the org, which maps to product integrations rather than pure UI frontend work.
How it compares
Use this for org-side Commerce Store configuration—not for generic ecommerce scaffolding or MCP-based storefront generators.
Common Questions / FAQ
Who is creating-b2b-commerce-store for?
It is for solo builders and small teams implementing Salesforce Commerce B2B who need to create the backend store, buyer policies, and commerce integrations in the Salesforce org.
When should I use creating-b2b-commerce-store?
Use it during Build when you are standing up B2B commerce in Salesforce—after you have licensed Commerce and before storefront or Experience Cloud work that depends on entitlements and price books.
Is creating-b2b-commerce-store safe to install?
Treat it as procedural guidance for production org changes; review the Security Audits panel on this Prism page and follow your org change-management rules before configuring payments or tax in live environments.
SKILL.md
READMESKILL.md - Creating B2b Commerce Store
# Commerce Store vs Storefront: Technical Reference ## Overview Understanding the distinction between Commerce Store and Storefront is critical for successful Commerce B2B development. This document provides technical details about these two components and explains why they must be created in a specific order. --- ## The Two Components ### 1. Commerce Store (Backend Data) **What it is:** - Runtime data and configuration created in the Salesforce org - NOT source-controllable metadata - Created through Commerce app UI **What it includes:** - Store configuration and settings - Default buyer groups (associated with Accounts) - Entitlement policies (who can see which products) - Pricing policies and price book mappings - Payment gateway configuration (Stripe, Adyen, etc.) - Tax provider configuration (Avalara, Vertex, manual) - Shipping methods and configurations - Product catalog associations - Inventory locations - Search index configurations **Where it lives:** - Data records in standard Commerce objects: - `WebStore` - Store settings and configuration - `BuyerGroup` - Account-based buyer segments - `EntitlementPolicy` - Product visibility rules - `CommerceEntitlementProduct` - Product-policy associations - `ProductCatalog` - Catalog definitions - `Pricebook2` - Price books - Additional payment, tax, shipping records **How to create:** - Via UI: Setup → Commerce → Stores - Cannot be created via Metadata API - Cannot be deployed via `sf project deploy` --- ### 2. Storefront (Frontend Metadata) **What it is:** - Digital Experience (LWR site) for buyer-facing shopping experience - Source-controllable as ExperienceBundle metadata - Created automatically when you create a Commerce Store **What it includes:** - ExperienceBundle metadata (`StorefrontName.digitalExperience-meta.xml`) - URL routing configuration (`sfdc_cms__route`) - Page definitions (`sfdc_cms__view`) - Homepage - Product List Pages (PLP) - Product Detail Pages (PDP) - Shopping cart - Checkout flow - Order confirmation - Search results - Lightning Web Components (product cards, cart components, checkout) - Branding and theme configuration (`sfdc_cms__brandingSet`, `sfdc_cms__theme`) - Page layouts (`sfdc_cms__themeLayout`) - Navigation structure - Custom LWCs for extensions **Where it lives:** - `force-app/main/default/digitalExperiences/site/StorefrontName/` - Example: `force-app/main/default/digitalExperiences/site/My_B2B_Store1/` **How to create:** - Automatically generated by Commerce Store setup wizard - Retrieved from org using Salesforce CLI - Cannot be manually created from scratch **How to deploy:** - Retrievable: `sf project retrieve start -m DigitalExperienceBundle:site/<name>` - Deployable: `sf project deploy start -m DigitalExperienceBundle` - Source-controllable in Git --- ## Why You Cannot Create Storefront Metadata from Scratch ### Technical Reasons 1. **Complex Dependency Chain** - Create merchandisers store - Create DigitalExperienceBundle - Integrate both together 2. **Hundreds of Auto-Generated Configurations** - Component IDs and region IDs (UUIDs) - WebStore associations - Commerce-managed component configurations - Default routing rules - Search configurations - Cart and checkout flow definitions - Payment integration settings 3. **Commerce-Managed Components** - Product List Page (PLP) components - Product Detail Page (PDP) components - Cart components - Checkout components - Search components - These require specific configurations from Store data 4. **Metadata API Limitation** - Metadata API deploys metadata types (Apex, LWCs, objects) - Metadata API CANNOT create SObject data (WebStore records) - Store creation requires data operations, not metadata operations --- ## The Required Creation Order ### Step 1: Create Commerce Store (Must Be First) ``` User Interface (Commerce App) ↓ WebStore Record Created ↓ BuyerGroup Records