Delivery API

Track a delivery

States, polling and the tracker link.

Markdown

States

A delivery's progress is one field: state.

StateMeaning
draftCreated with draft: true. Nothing happens until you publish it with PATCH and draft: false.
pendingWaiting for a bot.
going_to_pickupA bot is on its way to the pickup.
at_pickupThe bot is at the pickup. Load it now.
going_to_dropoffLoaded and on its way.
at_dropoffThe bot is at the dropoff. Unload it now.
deliveredHanded off. Final.
going_to_return, at_return, returnedCanceled after loading, with a return set: the bot brings the order back. returned is final.
canceledSomeone called it off. Final.
failedIt could not be completed. Final.

Pickup-only orders have their own states: see Pickup-only orders.

Next to state:

  • paused is true while the delivery is on hold. state keeps the leg it was on.
  • arriving is true while the bot approaches its next stop. Do not load on it: wait for at_pickup.

Follow a delivery

  • Poll GET /delivery/{id}, or use your own id with ?id_type=external.
  • Or get every change at your URL: Webhooks.
  • Give your customer tracker_url, a live tracking page.

Timing

  • estimates.pickup and estimates.dropoff say when the bot arrives and finishes at each stop. source: actual means it already happened.
  • POST /delivery/eta gives arrival times before you create a delivery.
  • GET /delivery/{id}/route returns the path left to drive, to draw on a map.

Cancel or pause