Has the Create Job behaviour changed in the API recently

When I started using your API 2 years ago to deliver jobs for my company one of the problems that we used to have was:

If we created a job that was going pretty far, the API would not let us create a job with a small package type, the API would return an error message saying something like “Distance Not Allowed”… so we would be forced to create a job with a “Large” package size forcing stuart to look for a car to do our job. - and a lot of the time they didn’t have any cars. - So we would end up cancelling the order.

99% of my orders would fit on a motorbike.

So my code would start with the smallest page type if I got the “Distance Not allowed” error I would then retry go to the next package size up until the API accepted the order. - Not ideal but the only way to do it, as I wouldn’t know which package size the API would accept because I only had the post code.

I have been refactoring code, and running a few test in sandbox and it looks like the API now allows me to create a job with a small package size, regardless of the distance of the job which is great!

Can someone tell me if what I have discovered is true?
Will this behaviour be the same in production?

Hello @ayo.adesina,

Thank you for raising your question here, it’s an interesting one!

It’s likely that a change like this could be introduced as an update to zone configurations on our side, since our Operational teams can change the maximum delivery distance to transport type mapping on a per zone basis.

I can confirm that our Sandbox and Production zone configurations should be aligned so that you can expect the same behaviour across environments.

Hi @Lauren,

I’m in the process of finishing the new version of our software, which relies heavily on successful API calls for prices and creating jobs. I’m hoping you can help me confirm the API behavior so that we can ensure our software is reliable.

About two years ago, when I first started using the Stuart API, I noticed that if I tried to create a job for a delivery that required traveling a far distance and used a small package size, the API would reject the request with a 422 HTTP response and an error message “JOB_DISTANCE_NOT_ALLOWED”. However, if I made another request to create a job for the same location and changed the package size, the API would accept the request.

Could you please help me confirm whether this behavior is still the case? Knowing the answer would make our code to make reliable API calls much simpler, as we won’t have to check every package size.

Thank you for your help!

Hello @ayo.adesina,

I can confirm that we still validate the package size against the job distance which is set as a per zone configuration. This means that it is still possible that you’d encounter the behaviour you described where increasing package size would allow for a longer job distance.

Great thanks!

1 Like