I'm trying to update some code that i have with deprecated methods and i want to use the new inventory API but i can't save the source item. After load or create a new product with the product repository i try to update the the status and stock with the new interfaces SourceItem and sourceItemSave but i receive a validation error

In SourceItemsSaveHandler.php line 71:

After save the product i have this code:

try {

                } catch (\Exception $exception) {
                    $logger->info($sku . " Deu merda a salvar: Exception:  " . $exception->getMessage());
                $sourceItem = $this->getSourceItemsBySku->execute($product->getSku());
                if (count($sourceItem) == 0){


Is there any official way to save quantity and status of the product in 2.3?

Thanks for your help :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.