Unable to create Scratch Org with B2B Commerce Lightning

b2b-commercesalesforcedxscratch-org

I get the error when creating the scratch org:

Commerce.settings Not available for deploy for this API version

I'm using a Dev Hub based on an org that has B2B Commerce on Lightning Experience and I'm able to create a sandbox but not a scratch org. I would like to use scratch org to serve as a container for some projects. I'm also using the latest SFDX and the project is set to v52.

Is there some permission or setup that I am missing. Or could it be unsupported as of yet?

Here it is the scratch org definition file (based on b2b-commerce-on-lightning-quickstart):

{
  "orgName": "Jeferson B2B Company",
  "edition": "Developer",
  "features": ["Communities", "B2BCommerce", "OrderManagement", "EnableSetPasswordInApi"],
  "settings": { 
    "lightningExperienceSettings": {
          "enableS1DesktopEnabled": true
      },
      "experienceBundleSettings": {
        "enableExperienceBundleMetadata": true
      },
      "communitiesSettings": {
        "enableNetworksEnabled": true
      },
      "orderManagementSettings": {
        "enableOrderManagement": true
      },
      "orderSettings": {
        "enableOrders": true,
        "enableEnhancedCommerceOrders": true,
        "enableOptionalPricebook": true
      },
      "commerceSettings": {
        "commerceEnabled": true
      }
  }
} 

Best Answer

The solution is fairly simple: Define the APIVersion as part of the scratch org creation. --apiversion 54.0 Example:

sfdx force:org:create -f config/project-scratch-def-b2b.json -a ci_scratch -s -d 1 --apiversion 54.0
Related Topic