php-shopify icon indicating copy to clipboard operation
php-shopify copied to clipboard

Always throwing exception as {"errors":"Not Found"} even though SKUs present in inventory

Open vasanthhr opened this issue 4 years ago • 2 comments

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}"));

image

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);

vasanthhr avatar Aug 17 '21 07:08 vasanthhr

@tareqtms Could you please help on this issue sooner, really appreciate for your quick response.

vasanthhr avatar Aug 19 '21 04:08 vasanthhr

@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

fabio-sassi-spotview avatar Sep 16 '21 09:09 fabio-sassi-spotview