Why can't I add a new product variant via REST API?

Hi everyone,

I’m trying to create new variants to some products via API using the JSON format that is written in the documentation and my tries using POSTMAN always give me a “406 Not Acceptable” error response.

Here is where I found the docuemntation on how to do it:

https://shopify.dev/api/admin/rest/reference/products/product-variant#create-2021-07

This is my JSON code:

{
“variant”: {
“option1”: “36”,
“option2”: “Metallic”,
“price”: “1.00”
}
}

This is my API URL (Note “xxx” are my API credentials):

https://xxx:xxx@xxxmyshop.myshopify.com/admin/api/2021-07/7024343679125/variants.json

Those are my sent headers:

hope somebody could help me with this.

I’ve been trying to solve this for many more days,

could anybody give me some new info?

Everybody can create new variants to their products via REST API??? Am I the only one with problems?

thanks…

It was my fault, I write this too many days after fiding the solution but it was something like a misspelling in the ID used in the URL