Can not create product via API

Im trying to create product in my shop.

Sample of product looks like this:

$data = [
   "product" => [
      "title" => "test me 1",
      "handle" => "random-132",
      "product_type" => "Dynamic",
      "vendor" => "My vendor",
      "variants" => [
         [
            "option1" => "Default Title",
            "price" => "107.00"
         ]
      ]
   ]
];

Than i fire it to /admin/api/2021-10/products.json with curl using POST method.
https://shopify.dev/docs/api/admin-rest/unstable/resources/product#post-products

And than i got this:> > {> > “erors”: {“product”: “Required parameter missing or invalid”}> > }

Any changes sto pachake does not bring any changes.

I can open shopify admin and go to products and create one setting only title. No validation appers.

How to even understand which parameter is failing or what missing ?

Hi,

Hope this will work

Fix price format by using number

  • Add “options” => [“Title”] for variants.
  • Ensure you send data as JSON with correct headers.

headers:

POST /admin/api/2025-01/products.json HTTP/1.1
Host: .myshopify.com
Accept: /
X-Shopify-Access-Token: …
Content-Type: application/json

oprtions… i dont understand what you mean .
changing to number type brings no changes