Direct Delivery
Direct Delivery API
The Direct Delivery API enables retailers and DSP aggregators to request delivery quotes, create deliveries from those quotes, and receive real-time status updates via webhooks.
The flow is two-step: quote first, then create. A quote returns availability, pickup ETA, delivery ETA, and locked delivery cost; the create call promotes that quote into an active delivery, honoring the same locked terms.
Authentication
All requests require an Autolane API key in the Authorization header and a per-site x-retailer-id header. Your organization and retailer context are resolved automatically from these.
Permissions
API keys carry granular permissions:
Create API keys in the Autolane Portal under Organization Settings > API Keys.
Delivery Lifecycle
- Quote —
POST /dd/v1/deliveries/quotewith the customer phone, delivery address, ready-by time, and order items. The response includesavailable,pickup_eta,delivery_eta,delivery_fee_cents, andexpires_at(5 minutes from creation). Whenavailableisfalse, the response carries anunavailable_reason(OUT_OF_SERVICE_AREA,NO_DRIVERS_ONLINE, orCUSTOMER_OPTED_OUT). - Create —
POST /dd/v1/deliverieswith the sameexternal_delivery_idyou used on the quote. The locked terms (price, ETAs) carry over from the quote; the response returns the created delivery. - Pending — the delivery starts in
PENDINGstatus. - Ready — at the
ready_bytime, the delivery automatically transitions toREADYand becomes visible in the driver queue. - Pickup — a driver claims the delivery, picks it up from the store, and delivers it to the customer.
- Complete — delivery confirmed.
Quote Semantics
- A quote is identified by
(retailer, external_delivery_id). Re-quoting with the same key replaces the prior quote. - A quote is valid for 5 minutes. After
expires_at, callingPOST /dd/v1/deliveriesreturns410 QUOTE_EXPIRED. - A quote can only be consumed once. After a successful create, re-creating with the same
external_delivery_idreturns409 QUOTE_ALREADY_CONSUMED. - A quote with
available: falsecannot be promoted to a delivery. Calling create returns422 QUOTE_NOT_AVAILABLE.
Cancellation
Cancel a delivery via PATCH /dd/v1/deliveries/{external_delivery_id} with { "status": "CANCELLED" }. Cancellation is allowed any time before the delivery reaches a terminal state (CANCELLED, EXPIRED). If a pickup is in progress, it is also cancelled.