Filter carriers or service levels that miss a required delivery date
Some orders have hard delivery requirements: same-day gifts, event merchandise, subscription boxes with commit dates. Rather than presenting all available rates and hoping customers pick correctly, you can useestimated_delivery_date_utc to filter out any service levels that would miss the required date before displaying options or purchasing a label.
How it works
Passlatest_delivery_date in the request body. The API compares this date against the UTC date component of each prediction’s estimated_delivery_date_utc and silently omits any service level whose estimate falls after the specified date. Only service levels that can meet the deadline appear in predictions.
Timezone note:
latest_delivery_date is compared against the UTC date component of each estimate — not the local delivery date. If your deadline is expressed in a non-UTC timezone, apply the filter client-side after converting estimated_delivery_date_utc to the destination timezone. See Filtering Results for full details.Request — using latest_delivery_date
predictions.
Response
Filter by required delivery date
If your deadline is expressed as a local date rather than UTC, filter thepredictions array yourself after timezone conversion.
Purchasing a label: The Estimate API returns no pricing. Once you have the eligible
servicelevel.token values, pass them to POST /shipments (optionally with carrier_accounts) to retrieve rates, then purchase a label via POST /transactions.