Laravel-ShopifyAPI icon indicating copy to clipboard operation
Laravel-ShopifyAPI copied to clipboard

Not able to create a new product on store using api call

Open praveen-asset opened this issue 6 years ago • 0 comments

Hello there,

I am using Shopify::retrieve to get access token and after that I am trying to create an new product using api but not able to create send error "{"errors":{"product":"Required parameter missing or invalid"}"

$cUser = auth()->user()->providers->where('provider', 'shopify')->first(); $shopify = \Shopify::retrieve(auth()->user()->username, $cUser->provider_token); $productData = [ 'products' => [ 'id' => 0, 'title' => 'my cool products', 'body_html' => '

my cool product!

', 'vendor' => 'My Shopify Shop', 'product_type' => 'Snowboard', 'published_scope' => 'global', 'handle' => 'chain-bracelet', 'template_suffix' => null, 'published_scope' => 'web', 'tags' => 'amit', ] ]; $productResponse = $shopify->create('products', $productData);

praveen-asset avatar Jan 02 '20 13:01 praveen-asset