Magento 2: "The product that was requested doesn't exist. Verify the product and try again."

Viewed 6739

Help me! I create an API to get product information with ID: getProductByID ($ id). When I run in POSTMAN and the URL: "http://127.0.0.1:8080/magento/rest/V1/products/9" then I get the error result: "The product that was requested doesn't exist. Verify the product and try again. "

I checked in Catalog> Products, the product has an id of 9. Why does the API for this product result do not exist? How to fix this error?

1 Answers

I met the same error with you. Please try this.

    try{
          $this->productRepository->deleteById($sku);
    }catch (Exception $e){
          echo ""No Exist Product<br/>";
    }

I hope it would be helpful.

Related