Product Create curl example from docs not working, help?

Solved
gauze
New Member
2 1 0

curl -d '{"product":{"title":"Burton Custom Freestyle 151","body_html":"\u003cstrong\u003eGood snowboard!\u003c\/strong\u003e","vendor":"Mapisart","product_type":"Towel"},"api_version": "2021-10"}' -X POST "https://mapart-2.myshopify.com/admin/api/2021-10/products.json" -H "X-Shopify-Access-Token:[xxx]"

modified from:

https://shopify.dev/api/admin-rest/2021-10/resources/product#[post]/admin/api/2021-10/products.json

I changed vendor and product_type to the right thing for our page (it has products imported from CSVs in the past they want me to add some stuff over REST for keeping to pages in sync)

and the only required parameter listed in the docs is api_version which I think 2021-10 is correct but I always get this reply:

{"errors":{"product":"Required parameter missing or invalid"}}

 

I tried with and without {} around "2021-10" and "api_version": "2021-10" inside and outside the product: braces.

Also without api_version at all as it's not even in the example in the first place.

I'm really stumped what is required here, any help is appreciated.

Brian

Accepted Solution (1)

Accepted Solutions
gauze
New Member
2 1 0

This is an accepted solution.

Solved, documentation error it was missing -H "Content-Type: application/json" in the curl example

View solution in original post

Reply 1 (1)
gauze
New Member
2 1 0

This is an accepted solution.

Solved, documentation error it was missing -H "Content-Type: application/json" in the curl example

View solution in original post