Retrying deliveries in case of cancellation

Hello, in case Stuart cancels a job because of no_supply or courier_issue or any other due to Stuart’s part. Is there a way to retry delivery for the same order without creating a brand new delivery?
Or do I need to go through the same process again or do you advise against trying again, what’s best practice here?

Thank you.

Hello Asn,

Thank you for reaching out on our community forum.

I can confirm that once a delivery is canceled, it cannot be retried. If necessary, the requester can create a new one.

Regarding cancellations initiated by Stuart, overall we do not cancel a delivery unless it is not possible to complete it. While the specific reasons for such cancellations can vary, they usually entitle that a new delivery is not possible, hence you are always welcome to contact our support team for further assistance.

We recommend reviewing the list of possible cancellation reasons provided in our documentation. This will help ensure that your integration is tailored to handle these scenarios according to your specific requirements and preferences.

Note: To prevent cancellations due to no_supply, we strongly encourage you to perform a call to our validation endpoint early in the order flow, as this endpoint has a specific response that indicates when our service is temporarily unavailable.

Let us know if you have any more questions or need further assistance!

Best regards.

OK I am validating before I create any. Perhaps it was because there was a problem with the sandbox I created this thread but it’s resolved now.

I get an warning using the php client:
vendor/stuartapp/stuart-client-php/src/Stuart/Converters/JsonToJob.php on line 34

PHP Deprecated: DateTime::createFromFormat(): Passing null to parameter #2 ($datetime) of type string is deprecated

In this case is passing a time always necessary?


Thanks for your reply.

If you’re referring to something different, kindly elaborate so we can assist you further.

I’ll be attentive to your response,

Hi Andreas, sorry for the lack of information.
So yes it is using the stuart php library.

Here’s how I create it:

$job = new \Stuart\Job();
$job->addPickup('Example St SE16 1FE')
->setComment('Please ask for order no '.$customer['order_id'])
->setContactCompany('Shop Name')
$size = 'small';

->setPackageDescription('Food box.');

$respData = $client->createJob($job);

I think I need to add a dropoff or pick up time?

PHP Deprecated: DateTime::createFromFormat(): Passing null to parameter #2 ($datetime) of type string is deprecated


Thanks for the additional context.

First and foremost, please note that although this particular case is supported, our client libraries are deprecated. This means we no longer maintain them, some features are unavailable, and they may be removed in the future.

Regarding the pickup, you can use the ‘pickup_at’ field to specify the DateTime when the courier is expected to pick up the package based on the preparation time. For example, if you receive an order at 13:00 and it takes 30 minutes to prepare the package, create the job as soon as the order is received, but set the ‘pickup_at’ to 13:30.

For dropoff, you can schedule it within a time window if you want to perform deliveries within a slot previously selected by your customer.

Neither of these fields are mandatory for job creation, but scheduling the pickup is strongly recommended to improve the delivery experience by reducing waiting times while scheduling the dropoff is recommended for groceries or retail deliveries when you want to offer deliveries within specific slots for your customers.

Please take a moment to review our best practices for order flow and our scheduling offering.


Hi, thank you for the clarifications.
In terms of package deprecation, do you recommend using raw php code without any libraries?


As Andres pointed out, client libraries are no longer maintained by our teams.Thus, we recommend accessing our API directly via its REST service endpoints.
Kindly refer to our documentation page for guidance.

We’ll be glad to assist you with any further questions.


Hello, sorry to continue this thread it is slightly related.

I validate a job then create it, I couldn’t find any information relating to errors e.g. job couldn’t be created for some reason. Or is it that if I validate it then it will definetly create the job after that if it was successful.

Is there any scenario like this? Kindly direct me to it.


Validating a job before its creation is highly recommended. This process involves checking the job payload against the requirements to ensure everything is in order.

However, even if the validation is successful, errors can still occur during job creation.
We advise you to consult the following guide, which covers common errors and provides suggestions for addressing them. Additionally, our API documentation contains a comprehensive list of errors.

We also recommend associating each API error response with a user-friendly message for clear communication in case of an unsuccessful delivery creation.

Please feel free to reach out if you have any further questions.