Order ready endpoint not working

The following:

const ready = await fetch(https://api.sandbox.stuart.com/v2/deliveries/${deliveryId}/order_ready, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’
}
});

    const result = await ready.json();
    console.log(result, 'result');

produces {error: ‘NOT_FOUND’, message: ‘Not found’}

This happens when adding the id of the job (I could not locate an explicit delivery_id)

Please assit. Thank you

Hi @lmitchsmith

Thanks for using Stuart’s developers community forum.

The error message you’re encountering is due to the use of jobId instead of deliveryId.

Please note you can extract the deliveryId from the job creation response. Below is a screenshot of an example payload for your reference:

I hope this information is helpful but should you have any further questions, let us know.

Thank you Andres

I have attempted this in sandbox and error persists: { error: ‘NOT_FOUND’, message: ‘Not found’ }

Andres -in this instance I sent the following request:

const ready = await fetch(https://api.sandbox.stuart.com/v2/deliveries/100739914/order_ready, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’
}
});

const result = await ready.json();
console.log(result, 'result ready');

My mistake - I hadn’t included the Auth Headers. Thank you for your help

1 Like