laravel-shopify
laravel-shopify copied to clipboard
Undefined array key "product" when trying to create a product
I am using the latest version of package, and when trying to create a product like its written in the documentation:
// Create a product
$product = $shopify->createProduct([
'title' => 'Adidas Shoe, Pink',
]); // returns a ProductResource
it returns me an error: Undefined array key "product"
?
I am using the latest version of package, and when trying to create a product like its written in the documentation:
// Create a product $product = $shopify->createProduct([ 'title' => 'Adidas Shoe, Pink', ]); // returns a ProductResource
it returns me an error:
Undefined array key "product"
?
It looks like you missing the detail from the official Shopify documentation. Since this package is mostly wrapper, the expected payload shall comply with the docs. Refer here https://shopify.dev/docs/api/admin-rest/2023-07/resources/product#post-products. It requires product
key as the root index.