Statuses and Errors
Following is a reference to the Order and Shipment Statuses, and the possible errors that can occur during Order processing and Shipment delivery. Please refer to HTTP Responses for a guide to the interactive HTTP error responses returned by the API endpoints.
Order Status
The Order object contains a status
field that indicates the current order state.
Status | Description |
---|---|
ACCEPTED |
The Order has passed initial validation, was accepted by Intelligent Foods, and is queued for processing. Orders may be cancelled in this state. |
IN_PROCESS |
The Order is currently actively being processed. This is generally a short-lived state. Contact Intelligent Foods API support if an Order is found to be in this state persistently. |
PROCESSED |
The Order has been processed – inventory has been reserved, a shipping label has been purchased, and the Order is schedule for packing and delivery. Orders with this status may not be cancelled under normal circumstances. This is the final state for successfully processed Orders. |
CANCELLED |
The Order has been cancelled by the Partner. Final state. |
ERROR |
A possibly recoverable error was encountered during Order processing. This state typically requires manual intervention by Intelligent Foods or the Partner to resolve. Orders in this state will include the additional fields error_type and error_details indicating the reason for the error. Partners may cancel an Order in this state and submit a new Order Request to attempt to correct the error. Or contact Intelligent Foods API support for help resolving the error. |
ERROR_CANCELLED |
An unrecoverable error was encountered during Order processing, and the Order was automatically cancelled. Orders in this state will include the additional fields error_type and error_details indicating the reason for the error. Final state. |
Temperature Out Of Range
The primary reason an Order may be ERROR_CANCELLED
is due to temperature_out_of_range_error
. Partners should be prepared to handle this condition.
In the interest of food-safe delivery, Intelligent Foods will not deliver an Order to a zip code where the forecast temperature on the requested delivery date is outside of acceptable range. This range is variable depending on the contents of the Order and the transit time, but in general temperatures above 105 F and below -19 F are out of range.
In this case, our Order processing system will set the order.status
to ERROR_CANCELLED
and the error_type
to temperature_out_of_range_error
. The error_details
will additionally contain information on the forecast temperature and zip code.
Partners may send a Simulate Create Order Request to attempt to determine if the temperature for the Order is out-of-range, in which case the API will respond with an HTTP 416
temperature_out_of_range_error
. However beware that the weather forecast changes daily, so an Order placed on a Tuesday may be acceptable at the time, but could be out-of-range at the time orders are processed on Wednesday. As a result, it is good practice to always include a callback_url
with Create Order requests, to be informed regarding Order processing errors.
Shipment Status
Successfully processed Orders will result in 1 or more Shipments. The shipment.status
field only has 2 possible states:
Status | Description |
---|---|
CREATED |
The Shipment has been created and is scheduled for delivery. |
CANCELLED |
The Shipment has been cancelled by the Partner. Partners may not cancel an individual Shipment. Cancelling an Order will result in cancelled Shipments. |
Delivery Status Fields
There are 4 delivery related fields on a shipment that Partners may use to track the status of the Shipment delivery.
Field | Description |
---|---|
delivery_status |
This is the primary delivery status field, with the following possible values (see below for more detail): UNKNOWN, PRE_TRANSIT, IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERED, CANCELLED, FAILURE, RETURN_TO_SENDER |
delivery_status_detail |
This is additional delivery status details, supplied by the carrier. There are no standard values as it varies from carrier to carrier. For a DELIVERED status, the detail is typically arrived_at_destination . For delivery failure statues, example values are transit_exception , delivery_exception , missorted , refused , damaged . |
delivery_status_message |
Human readable delivery status detail. For a DELIVERED status, values typically include detail on where the box was left, for example dropoff succeeded: Left with/at Front Door/Patio , Delivered (Signature Service not requested.) , dropoff succeeded: Left with/at Doorman . For delivery failure statuses, examples are Order missorted to incorrect delivery facility , REFUSED DELIVERY - OTHER REASON , damaged , WRONG DELIVERY ADDRESS , Missorted , Shipment exception (Cannot locate recipient) . |
est_delivery_date |
Intelligent Foods always designates an Order for delivery on the date requested by the Partner, but that date may be delayed or (occasionally) moved up by the carrier. This field indicates the most up-to-date estimated delivery date according to the carrier. Note, not all carrier provide this information. |
Delivery Status
Status | Description |
---|---|
UNKNOWN |
Initial state - the carrier does not yet know about the shipment. |
PRE_TRANSIT |
The shipment is being processed at a facility. |
IN_TRANSIT |
The shipment is currently en route. |
OUT_FOR_DELIVERY |
The shipment is currently on its last mile and is en route to the destination address. |
DELIVERED |
The shipment has been delivered. |
RETURN_TO_SENDER |
Failure state: the shipment was not successfully delivered and is en route back to sender. |
CANCELLED |
Failure state: the delivery has been cancelled by the carrier. |
FAILURE |
Failure state: the delivery has failed to be delivered. |
ERROR |
Failure state: unknown delivery error. |
Partners should be aware the delivery statuses change frequently as delivery proceeds. A carrier may send PRE_TRANSIT
and IN_TRANSIT
multiple times as a shipment moves from facility to facility. Additionally, failure states may not always be final. Most carriers will attempt a 2nd delivery later in the day or the next day, in which case a FAILURE
state may move to OUT_FOR_DELIVERY
and then DELIVERED
. In most cases, the delivery_status_detail
and delivery_status_message
will indicate why the delivery failed, and if and when redelivery will be attempted.