this is my first question here in SO, so thanks to any one that help me with this problem.
Basically im trying to update in a PUT request a variant price. I'm using Airtbale scripting to run a javascript, and on this script i fetch the info to call the api and make the update.
var raw = JSON.stringify({
"variant": {
"price": "1011",
"compare_at_price": "1011"
}
});
console.log(raw);
var myHeaders = new Headers();
myHeaders.append("X-Shopify-Access-Token", api_token);
myHeaders.append("Content-Type", "application/json");
const params = {
method:'PUT',
headers:myHeaders,
body: raw,
};
const url =
`https://tryp-mexico.myshopify.com/admin/admin/api/2022-04/variants/42242378334462.json`
const response = await fetch(url,params);
console.log(response);
When i try tu run this update on Postman, it works well. But here im getting:
{type: "basic", url: "https://tryp-mexico.myshopify.com/admin/admin/api/2022-04/variants/42242378334462.json", status: 406, statusText: "Not Acceptable", ok: false…}
¡Thanks a lot for your help!