Pickup at past sends error but Stuart still schedules it

We’ve moved from V1 to V2 and we have a doubt when creating a job:
We have a web application where we the user generates a delivery (A.S.A.P or for the future) and then the establishment accepts it. The problem is that it may pass some time between when the user makes the delivery for A.S.A.P and the establishment accepts it. For this example the time past is 5 minutes between the 2 actions (making and accepting the deliveries). When this happens, we get the following message:
{“error”:“RECORD_INVALID”,“message”:“Unable to save record”,“data”:{“pickup_at”:[“can not schedule a pickup in the past”,“is not a valid pickup time”]}}

We’ve looked for the error in the documentation but we can’t find it. The problem is that we get this error but the delivery is still made! (meaning that stuart goes and picks up the delivery). It’s a bit confusing because we get an error saying that it cannot schedule but it still schedules (I don’t know if i’m making myself clear, my english is not great).

Should we check it ourselves before creating the job? I’m also telling you this because in V1 it directly did it without sending an error, so it could be that other users of the api could have the same problem.

Thank you,
Jordi Pino.

Hello Jordi,

Thank you for your message. What is your account? Can you share us the request so we can reproduce and investigate on our side ?

Here are the Id’s (i’m guessing of the job) in the dashboard:

One is cancelled because the scheduling was done twice (the user tried twice to send the delivery not knowing that the scheduling was done because we send the message that it cannot be scheduled, just like in the previous message).

If you want to try it on your side, this happens when you send a pickup time previous to the current time.

Thanks for your time.

Thank you,

I am able to see the logs of these 2 requests on my side.

  • The first one was received at 17:46:15 with the pickup_at = 2018-06-05T17:47:00+02:00 and successfully create the job id 2827538
  • second request was received at 17:46:56 with the pickup_at = 2018-06-05T17:47:00+02:00 and successfully create the job id 2827544.

I don’t see any error about the pickup_at parameter in this case.

What is triggering the Job creation on your side? Is it the user’s order or the acceptation of the establishment?
I confirm that if you try to create a job in the past the Job creation will fail. So you might want to create instant jobs (without any pickup_at parameter) if not scheduled more than x min into the future.

Best Regards,

Hi Paul,
In regards to your question is the acceptation of the establishment. The pickup_at we have on our data base is for 17:39:00, so i don’t know how it scheduled for 17:47:00. Anyway, we are going to check that the pickup_at value is never set for the past.
Thanks again for your time.

1 Like