Sitecore Commerce 10.0.0 Bootstrap 404 Error and Other Changes
If you are experiencing a 404 error when attempting to bootstrap or Ensure\Sync, it may be because the methods have changed from a PUT to a POST in Sitecore Commerce 10.0.0.
Per Sitecore’s release notes for Sitecore Commerce 10.0.0, they note the following:
“Bootstrap() is now an action(post)
EnsureSyncDefaultContentPaths() is now an action(post)”
Additionally, they have updated the InitializeEnvironment call to include a sampledata true/false with true as the default value.
“A new mandatory parameter (‘sampledata’ with true/false value) is added
for InitializeEnvironment() API. It is used to specify whether sample
data (e.g. Habitat/AWC catalogs, promotions, price cards etc.) will be created
during InitializeEnvironment. The deployment scripts and Postman
sample have been updated to include the new parameter and set to “true” as default (existing behavior).”
Updating your calls to POST should resolve the 404 error. You can view all the changes/release notes by going here and selecting Release Notes under the “Release Information” section: https://dev.sitecore.net/Downloads/Sitecore_Commerce/100/Sitecore_Experience_Commerce_100.aspx
Using the SDK and Other Notes
If you are leveraging Postman per the Sitecore documentation, the proper HTTP Verbs are already set in the SDK. The SDK is within the WDP package on the Sitecore Commerce 10.0.0 downloads page (or it could be downloaded via the direct link: https://sitecoredev.azureedge.net/~/media/7ED76B7A45D04746A3862726ADB59583.ashx?date=20200819T155203
If you automate the calls for ensuresync, and initialize… there are some additional changes. Previously, you could pass the variables for environment and shopName within the call for EnsureSyncDefaultContentPaths() via the body as follows:
{
"environment": "{{Environment}}",
"shopName": "{{ShopName}}"
}
Previously the call would be akin to the following, but this will fail:
EnsureSyncDefaultContentPaths(environment='{{Environment}}',shopName='{{ShopName}}')"
Similar to EnsureSyncDefaultContentPath, you would pass the following body for the InitializeEnvironment() noting the new sampleData requirement:
{
"environment": "{{Environment}}",
"sampleData": true
}