BNMetrics / Laravel-ShopifyAPI

Shopify Laravel API Wrapper ( with Billing support!)
MIT License
53 stars 29 forks source link

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

Open praveen-asset opened 4 years ago

praveen-asset commented 4 years ago

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