> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create delivery

> Requests an Uber Direct courier to pick up items and deliver them.

`uber.createDelivery` dispatches a courier and returns the new delivery with its `id`, `status`, `fee`, and public `trackingUrl`.

```ts automations/dispatch-uber-delivery.automation.ts theme={null}
import { automation, onDashboardRun, sendEmail, t } from "automate.ax"
import { uber } from "automate.ax/uber"

export default automation("Dispatch an order", () => {
  onDashboardRun({ title: "Dispatch order 1042" })

  const pickup = {
    name: "Corner Florist",
    address: "175 Greenwich St, New York, NY 10007",
    phoneNumber: "+15555555555",
  }
  const dropoff = {
    name: "Ada Lovelace",
    address: "231 Hudson St, New York, NY 10013",
    phoneNumber: "+15555555556",
  }
  const quote = uber.createDeliveryQuote({ pickup, dropoff })

  const delivery = uber.createDelivery({
    quoteId: quote.id,
    idempotencyKey: "order-1042",
    pickup,
    dropoff: {
      ...dropoff,
      notes: "Buzz 4B",
      verification: { signatureRequirement: { enabled: true } },
    },
    manifestItems: [{ name: "Bouquet", quantity: 1, size: "medium" }],
    manifestReference: "Order 1042",
  })

  sendEmail({
    to: "*",
    subject: "Order 1042 dispatched",
    text: t`Track it at ${delivery.trackingUrl}`,
  })
})
```

`pickup` and `dropoff` require `name`, `address`, and `phoneNumber`. Phone numbers must start with `+` and contain only digits. Addresses accept the same formats as [Create delivery quote](https://docs.automate.ax/reference/integrations/uber/actions/create-delivery-quote.md). Both waypoints accept `businessName`, `latitude`, `longitude`, `notes` (up to 280 characters), `readyAt`, `deadlineAt`, and `verification`; `dropoff` also accepts `sellerNotes`.

`manifestItems` requires at least one item with `name` and `quantity`. `size` is `small`, `medium`, `large`, or `xlarge` and defaults to `small`. If you pass `dimensions` in centimeters, also pass `weight` in grams.

## Proof and handoff

* `pickup.verification` accepts `picture`, `barcodes`, and `signatureRequirement`.
* `dropoff.verification` also accepts `pincode` and `identification: { minAge }` for age-restricted items. Identification includes a sobriety check unless you set `noSobrietyCheck`.
* `returnVerification` applies when Uber returns an undeliverable order.
* `deliverableAction` is `deliverable_action_meet_at_door` by default or `deliverable_action_leave_at_door`. Leave-at-door deliveries cannot require a signature, PIN, or ID check, and Uber requires a photo for them.
* `undeliverableAction` is `return` by default, `discard`, or `leave_at_door`. Orders that require a signature, PIN, or ID check cannot be left at the door.

Automate.ax rejects those invalid combinations before calling Uber.

## Retries and duplicates

Pass `idempotencyKey` to make the action safe to retry. Uber refuses to create a second delivery with the same key for 60 minutes, so a retry cannot dispatch a second courier. Without a key, Automate.ax does not repeat a request whose outcome is uncertain because it could dispatch a second courier. Uber also rejects a second delivery with the same `manifestReference` and `externalId` pair.

## Other inputs

`tip` is in cents and is included in `fee`. `externalStoreId` (up to 150 characters) and `externalId` link the delivery to your systems. `returnNotes`, `externalUserInfo`, and `userFeesSummary` pass through to Uber.

With test credentials, set `roboCourier: { mode: "auto" }` to have Uber's simulated courier advance the delivery about every 30 seconds, or `mode: "custom"` with `enrouteForPickupAt`, `pickupImminentAt`, `pickupAt`, `dropoffImminentAt`, and `dropoffAt` to control each step. Add `cancelReason` to simulate a courier cancellation.

Uber returns `couriers_busy` or `address_undeliverable_limited_couriers` when no courier is available; Automate.ax retries both. `address_undeliverable`, `expired_quote`, `used_quote`, and time-window errors fail without retrying.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.