When a new item is created from Boomi, it gets the website assigned to the store from the url, but when the next call comes for the other site, it does not assign the website to it. i.e. first call to /rest/drcomfort_b2b_en/V1/products will create sku and add to B2B when second call comes right after for /rest/V1/products it does not assign to B2C store diff --git a/vendor/magento/module-catalog/Model/ProductRepository.php b/vendor/magento/module-catalog/Model/ProductRepository.php --- a/vendor/magento/module-catalog/Model/ProductRepository.php +++ b/vendor/magento/module-catalog/Model/ProductRepository.php @@ -397,6 +397,15 @@ $product->setData($key, $value); } + $requestUri = $_SERVER['REQUEST_URI'] ?? ''; + if ($requestUri === '/rest/V1/products' || $requestUri === '/rest/drcomfort_b2b_en/V1/products') { + $websiteIds = $product->getWebsiteIds(); + if (count($websiteIds) && !in_array($this->storeManager->getStore()->getWebsiteId(), $websiteIds)) { + $websiteIds[] = $this->storeManager->getStore()->getWebsiteId(); + $product->setWebsiteIds($websiteIds); + } + } + return $product; }