Wolt Drive API error handling

Managing both expected and unexpected errors is crucial when integrating with Wolt Drive APIs.

API relies on standard HTTP response codes to indicate the outcome of API requests. Status 5XX should be retried, while retrying any of the requests with 4XX status will result in the same response. Retries should follow a retry strategy with maximum 5 retries per request and, if possible, exponential back-off (increased time between retries).

A clear feedback loop for errors is needed to keep users informed of delivery unavailability or any mishaps. Additionally, error responses should be logged for further analysis.

Senders or recipients should never need to double-check delivery status by contacting support. Do not indicate a delivery is in progress if it failed at creation. These features are tested by Wolt during integration tests.

Status codeProcedureExplanation
2XXSuccessSuccessful operation
400Do not retryPayload error, or delivery unavailable. See the response payload for details.
401Do not retryUnauthorized. The Bearer token ("merchant key") does not match with the resource ID in path.
404Do not retryInvalid resource ID in path parameters, wrong venue/merchant ID. Invalid shipment promise ID.
422Do not retryRequest payload did not pass validation. Location and reason is detailed in the error response.
429Wait before retryAbnormally large number of requests was received. Wait 5 seconds to 1 minute before retrying.
500RetryGeneral error. Retry the request. If the issue persists, please contact your Wolt contact person.

Standard error response formats

400 Invalid payload

In the provided example, dropoff location is too far from the pickup location. Standard format applies to venueful and venueless endpoints. Webhook service and order modification endpoints may have different response formatting, detailed in their documentation.

See the list of error codes below.

Response example
{
"error_code": "DROPOFF_OUTSIDE_OF_DELIVERY_AREA",
"reason": "Dropoff location is outside of the delivery area",
"details": "Delivery distance between pickup and dropoff (10711m) is longer than maximum allowed distance (8000m)"
}

401 Unauthorized

In the provided example, used merchant key does not allow access to merchant's resources.

Response example
{
"detail": "Token not found for the given key and author"
}

404 Not found

In the provided example, venue ID does not exist in the system.

Response example
{
"detail": "Not Found"
}

Additionally, shipment promise ID does not exist in the system.

Response example
{
"error_code": "SHIPMENT_PROMISE_NOT_FOUND",
"reason": "Shipment promise not found",
"details": "Shipment Promise not found for the given id: {id}"
}

422 Unprocessable Entity

In the provided example, recipient phone number does not pass validation.

Response example
{
"detail": [
{
"type": "value_error",
"loc": ["body", "recipient", "phone_number"],
"msg": "Value error, Impossible phone number: {phone_number}"
}
]
}

500 Generic Internal Error

Response example
{
"error_code": "GENERIC_INTERNAL_ERROR",
"reason": "Internal server error",
"details": ""
}

Error codes

Error codeExplanationAction
SHIPMENT_PROMISE_NOT_FOUNDShipment promise ID is invalid or promise is expired.Create a new shipment promise and use its ID to create a delivery.
DROPOFF_OUTSIDE_OF_DELIVERY_AREADropoff location is outside of the delivery area.Do not allow creating a Wolt Drive delivery to this location.
INVALID_DROPOFF_ADDRESSDropoff location is invalid.Verify dropoff location details.
INVALID_PICKUP_ADDRESSInvalid pickup address.Verify pickup location details (venueless).
INVALID_PAYLOADGeneral invalid payload.Fix the request payload by following the response details.
REQUEST_OUTSIDE_DELIVERY_HOURSDelivery requested outside delivery hours.Do not allow creating a Wolt Drive delivery, or do not allow the selected delivery time.
INVALID_SCHEDULED_DROPOFF_TIMEInvalid scheduled dropoff time.Do not allow creating a Wolt Drive delivery on the selected delivery time.
CASH_ON_DELIVERY_DISABLEDDelivery order includes cash fields but cash has been disabled.Do not allow cash orders.
DELIVERY_NOT_ENABLED_FOR_DELIVERY_AREANew deliveries in this area are currently disabled.Do not allow creating a Wolt Drive delivery at this time.
DELIVERY_AREA_CLOSEDDelivery area is closed.Do not allow creating a Wolt Drive delivery at this time.
DELIVERY_AREA_CLOSED_TEMPORARILYDelivery area is closed temporarily.Do not allow creating a Wolt Drive delivery at this time.
DUPLICATE_ORDERDuplicate order exists with same merchant reference id.Check if a duplicate order exists, or change the merchant reference ID.
VENUE_CLOSEDDelivery from the venue is not possible at this time.Do not allow creating a Wolt Drive delivery at this time.
MISSING_MERCHANT_CONFIGURATIONAccount is not configured correctly.Contact Wolt to fix.
B2B_CONFIG_NOT_FOUNDAccount is not configured correctly.Contact Wolt to fix.
CORPORATE_PAYMENT_METHOD_NOT_FOUNDAccount is not configured correctly.Contact Wolt to fix.
DELIVERY_CONFIG_MISSING_PRICINGDelivery area is not configured correctly.Contact Wolt to fix.
VENUE_ORDER_LIMIT_EXCEEDEDOrder limit exceeded.Contact Wolt to fix.
GENERIC_INTERNAL_ERRORGeneric internal error.Retry the request. If the error persists, contact Wolt for further analysis.