Promise Dates
Use the Promise API to get an estimated delivery date to display during conversion and checkout to reduce uncertainty that leads to cart abandonment and improve customer delivery satisfaction.
Overview
parcelLab provides an API you can call to get forecasted delivery dates. This date can be used to display a delivery date promise on the product details page or at checkout. It can be shown in a format you want on your website so customers can see when a product should arrive before buying it.
Get Promise Date
You can retrieve the forecasted delivery date of an order using the v4/promise/prediction/predict
endpoint.
Account ID
Set to true, to indicate that the prediction should be done based on the current, not yet published, promise configuration
conservative
- conservativebalanced
- balancedaggressive
- aggressive
The logistics courier to be used. Defaults to returning all configured couriers.
ISO 3166-1 alpha-3 code of destination country
Postal code of destination
Forces the forecasted delivery date to skip any warehouse calculation and generate a prediction if the parcel is shipped at the moment of the API call, if set to 'true'
false
Set to true, to indicate that the prediction should be done based on the current, not yet published, promise configuration
ISO 639-1 code of the language to use for localization
Locks the prediction for a specified request date as a ISO 8601 date and time in UTC format like 2022-06-10T06:42:00Z. Defaults now to the current time if omitted, which is required for production usage.
The courier service level mapped in your Promise configuration (for example: express delivery). Defaults to returning all courier service levels.
Tag to target prediction adjustment rule
The warehouse the delivery shipped from (input field: key). Defaults to the default warehouse for the destination.
GET /v4/promise/prediction/predict/?account=1&destination_country_iso3=text HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"request_id": "text",
"success": true,
"prediction": [
{
"id": "text",
"warehouse": "text",
"courier": "text",
"courier_name": "text",
"courier_alias": [
"text"
],
"courier_service_level": [
"text"
],
"prediction": {
"min": 1,
"max": 1,
"likely": 1,
"send_date": "2025-10-13",
"earliest_date": "2025-10-13",
"latest_date": "2025-10-13",
"most_likely_date": "2025-10-13",
"earliest_locale": "text",
"latest_locale": "text",
"most_likely_locale": "text",
"cutoff": 1,
"cutoff_locale": "text"
}
}
]
}
Result Structure
The API always returns a list of applicable predictions according to the specified query. The request_id
is for tracing and troubleshooting purposes only.
{
"request_id": "abcd1234",
"success": true,
"error": null,
"prediction": [ ... ]
}
Each entry in the prediction array represents one delivery method, including a delivery prediction like the following structure:
{
"id": "Delivery Method ID",
"warehouse": "Warehouse ID",
"courier": "parcelLab courier code, e.g. ups",
"courier_name": "Pretty courier name",
"courier_alias": [ "Retailer internal courier code" ],
"courier_service_level": [ "all specified aliases for the service level" ],
"prediction": {
"min": 1,
"max": 2,
"likely": 2,
"send_date": "2022-06-11",
"earliest_date": "2022-06-12",
"latest_date": "2022-06-13",
"most_likely_date": "2022-06-13",
"earliest_locale": "Thursday, Jun 12th, 2022",
"latest_locale": "Friday, Jun 13th, 2022",
"most_likely_locale": " Friday, Jun 13th, 2022",
"cutoff": 747,
"cutoff_locale": "12 hours"
}
}
Delivery Prediction Details
The details included in a delivery prediction are described in the following table.
min
Integer
The minimum number of expected courier working days until delivery. Note: The value for minimum and maximum can be equal.
max
Integer
The maximum number of expected courier working days until delivery.
Note: The value for minimum and maximum can be equal.
likely
Integer
The most likely number of expected courier working days until delivery.
earliest_date
ISO 8601 date format: YYYY-MM-DD
The earliest expected delivery date taking into consideration working days of the courier, holidays in the destination, and warehouse cut-off and handling times.
latest_date
ISO 8601 date format: YYYY-MM-DD
The latest expected delivery date taking into consideration working days of the courier, holidays in the destination, and warehouse cut-off and handling times.
earliest_locale
Defaults to dddd, MMM DDD, YYYY
Localized representations of the earliest expected delivery date in the specified format.
latest_locale
Defaults to dddd, MMM DDD, YYYY
Localized representations of the latest expected delivery date in the specified format.
most_likely_locale
Defaults to dddd, MMM DDD, YYYY
Localized representations of the most likely delivery date in the specified format.
cutoff
Integer
The time in minutes until cut-off for the estimated delivery dates.
cutoff_locale
String
Localized representations of the cut-off. Can be used within a sentence like "Order within [2 hours | an hour | 20 minutes] to receive your order by [Saturday, Mar 23rd, 2022]".
Sample Calls
The sample API calls below show different information in the request (for example: home delivery as the courier service type) for the delivery prediction.
https://api.parcellab.com/v4/promise/prediction/predict?account=1612197&destination_country_iso3=DEU
{
"requestId": "wLy6ThLp",
"success": true,
"prediction": [{
"id": "DHL Standard",
"warehouse": "Europe Warehouse",
"courier": "dhl-germany",
"courier_name": "DHL",
"courier_alias": [],
"courier_service_level": ["home-delivery","pick-from-store"]
"prediction": {
"min": 1,
"max": 3,
"likely": 2,
"send_date": "2023-11-23",
"earliest_date": "2023-11-24",
"latest_date": "2023-11-27",
"most_likely_date": "2022-11-25",
"earliest_locale": "Friday, Nov 24th, 2023",
"latest_locale": "Monday, Nov 27th, 2023",
"most_likely_locale": "Saturday, Nov 25th, 2023",
"cutoff": 104,
"cutoff_locale": "1 hour, 44 minutes"},
{
"id": "UPS Express,
"warehouse": "Europe Warehouse",
"courier": "ups",
"courier_name": "UPS",
"courier_alias": [],
"courier_service_level": ["home-delivery","express","overnight"]
"prediction": {
"min": 1,
"max": 1,
"likely": 1,
"send_date": "2023-11-23",
"earliest_date": "2023-11-24",
"latestdate: "2023-11-24",
"most_likely_date": "2023-11-24",
"earliest_locale": "Friday, Nov 24th, 2023",
"latest_locale": "Friday, Nov 24th, 2023",
"most_likely_locale": "Friday, Nov 24th, 2023",
"cutoff": 76,
"cutoff_locale": "1 hour, 16 minutes"
}
}]
}
Calculating Delivery Dates for Orders with Known Dispatch Date
For orders where you know the actual dispatch date, you can calculate accurate delivery dates based on when the order will ship. This is useful for scenarios where:
An order's dispatch date is confirmed after placement
You need to provide customers with updated delivery expectations based on actual shipment dates
Customer service agents need to communicate accurate timelines for existing orders
How It Works
To calculate a delivery date for an already placed order when you know the dispatch date, use these two parameters together:
now_override=<date>
- set this to the known dispatch date/time in ISO 8601 UTC format (for example:2025-07-01T16:00:00.000Z
)dispatch_now=true
- this forces the API to skip warehouse cutoff calculations and calculate the delivery date as if the parcel ships at the exact time specified innow_override
The now_override
timestamp must be in UTC (Zulu time), not local time. Always include the Z
suffix or .000Z
to indicate UTC.
Testing Your Promise Configuration
To preview saved but unpublished changes to your Promise configuration in a staging environment:
Integrate the Promise API call to your staging environment.
Add the query parameter
&draft=true
to your Promise API call.
This will generate a promise date based on your unpublished Promise configuration, that can be used to review the effect of any configuration updates on the frontend of your staging environment.
Last updated
Was this helpful?