Can somebody tell me what’s wrong with this JSON? I’m trying to add variants to the cart and keep getting 400 bad request. “{“status”:“bad_request”,“message”:“Parameter Missing or Invalid”,“description”:“Required parameter missing or invalid: items”}”
Here’s my json string as it stands now, but it’s gone through a million permutations with the same results. I’m wondering if it’s a content type error I’m missing? I may just have spent so much time in front of my screen today that I’m not thinking clearly. That’s always a possibility. Anyway here’s the json:
"items": [
{
"id": "41305491210413",
"quantity": "1",
"properties": {
"url": "https://upload.cloudlift.app/s/printify-canada/ekLpytDslL.png"
}
},
{
"id": "41305491308717",
"quantity": "1",
"properties": {
"url": "https://upload.cloudlift.app/s/printify-canada/R5XSVqAlel.png"
}
}
]
and just in case I’ve lost all my faculties, here’s the ajax request. Not much to it at the moment.
$.ajax({
url: '../cart/add.js',
type: 'post',
dataType: 'json',
data: json,
success: function(data){
console.log(data);
},
error: function(data){
console.log(data)
}
});
}
I’m kind of at a loss here. I’m sure it’s something really stupid and I’ll feel dumb for even asking, because it just feels like that kind of day lol