Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined array key "product" when trying to create a product #49

Open
DiarQoroviqi opened this issue Aug 9, 2023 · 1 comment
Open

Comments

@DiarQoroviqi
Copy link

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"?

@ikyandhi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants