My mutation is formatted exactly the same in my custom code as it is in postman but it keeps returning a 400 error when I try to run it on my server. Not sure if anyone has had this experience but if there is any feed back that would be great! This is what the code looks like
const mutation =
mutation {
product_create(
data: {
name: “john”
sku: “john123”
price: “23.00”
warehouse_products: {
warehouse_id: “actualidnotshown”
on_hand: 130
inventory_bin: “Bin A1”
reserve_inventory: 0
replenishment_level: 1
reorder_level: 1
reorder_amount: 20
custom: false
}
value: “15.00”
barcode: “2233443355chair”
country_of_manufacture: “US”
dimensions: { weight: “12”, height: “25”, width: “10”, length: “25” }
kit: false
kit_build: false
no_air: false
final_sale: false
customs_value: “1.00”
not_owned: true
dropship: false
}
) {
request_id
complexity
product {
id
legacy_id
account_id
name
sku
price
value
barcode
country_of_manufacture
dimensions {
weight
height
width
length
}
tariff_code
kit
kit_build
no_air
final_sale
customs_value
customs_description
not_owned
dropship
created_at
}
}
}`
const options = {
headers: {
"Authorization": `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ mutation }),
}
got
.post(shipheroUrl, options)
.then((response) => {
console.log(response)
}).catch((err) => {
console.log(err)
})
})`