phpclassic / php-shopify

PHP SDK for Shopify API
Apache License 2.0
568 stars 211 forks source link

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

Open vasanthhr opened 3 years ago

vasanthhr commented 3 years ago

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 commented 3 years ago

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

fabio-sassi-spotview commented 2 years ago

@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