php-shopify
php-shopify copied to clipboard
Always throwing exception as {"errors":"Not Found"} even though SKUs present in inventory
I tried this $shoppify->ProductVariant->search("sku:{$sku}") but it always gives output as Uncaught PHPShopify\Exception\ApiException: {"errors":"Not Found"} even though sku present in inventory
Note: used composer to install latest phpclassic/php-shopify
example:
$sku="example-shirt-s";
var_dump($shopify->ProductVariant->search("sku:{$sku}"));

But I just tried with to get list of products with below APIs then it got list of products :
$products = $shopify->Product->get();
var_dump($products);
@tareqtms Could you please help on this issue sooner, really appreciate for your quick response.
@vasanthhr
As far as I know the rest api cannot search product variant by sku (I know this is crazy)
https://community.shopify.com/c/shopify-apis-and-sdks/api-to-search-products-by-sku/td-p/380758