Can't Add a new variant via REST API

Solved
zenerry
Shopify Partner
8 1 0

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:

zenerry_0-1629026766446.png

 

 

hope somebody could help me with this.

Accepted Solution (1)

Accepted Solutions
zenerry
Shopify Partner
8 1 0

This is an accepted solution.

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

View solution in original post

Replies 2 (2)
zenerry
Shopify Partner
8 1 0

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?

 

Captura de pantalla 2021-08-22 221824.jpg

thanks...

zenerry
Shopify Partner
8 1 0

This is an accepted solution.

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