The following code does not produce a price and returns that the dropoffs array needs to be filled. I believe this is s a bug, please advise
const tempJob = {
"job": {
"pickup_at": "2023-03-21T016:00:00.000Z",
"pickups": [
{
"address": "32 Coombe Ln, Raynes Park, London SW20 0LA",
"comment": "Ask Bobby",
"contact": {
"firstname": "Bobby",
"lastname": "Brown",
"phone": "+33610101010",
"email": "brown@gmail.com",
"company": "Pizza Shop"
}
}
],
"dropoffs": [
{
"package_type": "medium",
"package_description": "yellow package",
"client_reference": "ru483jejf98wg",
"address": "23 Ethelbert Rd, London SW20 8QD",
"comment": "3nd floor on the right",
"end_customer_time_window_start": "2023-03-21T16:20:00.000Z",
"end_customer_time_window_end": "2023-03-21T18:00:00.000Z",
"contact": {
"firstname": "Julia",
"lastname": "Moore",
"phone": "+33712222222",
"email": "moore@gmail.com",
"company": "findchow company"
}
}
]
}
};
const API_KEY = await obtainToken();
let returnValue = null;
const url = "https://api.sandbox.stuart.com/v2/jobs/pricing";
const options = {
method: "POST",
headers: {
Accept: "application/json",
'Authorization': `Bearer ${API_KEY}`
},
body: tempJob
};
// console.log(options, 'options');
await fetch(url, options)
.then((response) => response.json())
.then((data) => {
console.log(data);
returnValue = data;
});
return returnValue;