# First Delivery Developer Documentation > Canonical integration documentation for the First Delivery Platform API, outbound webhooks, and Driver App API. ## Machine-Readable Resources - [Documentation Manifest](https://developer.firstdelivery.com/docs-manifest.json): Topic metadata, canonical URLs, raw Markdown, and OpenAPI resources. - [Combined OpenAPI 3.1](https://developer.firstdelivery.com/openapi.json): Normalized Platform and Driver App HTTP contract. - [Orders Agent Context](https://developer.firstdelivery.com/llms-orders.txt) - [Webhooks Agent Context](https://developer.firstdelivery.com/llms-webhooks.txt) - [Authentication Agent Context](https://developer.firstdelivery.com/llms-auth.txt) - [Full Documentation Corpus](https://developer.firstdelivery.com/llms-full.txt) - Generated on: 2026-11-25 ## Agent Quick Start 1. Authenticate with a least-privilege Bearer API-client key. 2. Optionally quote with `POST /v3/quotes`, then create with `POST /v3/orders`. 3. Persist the First Delivery order ID and request ID. 4. Process webhook deliveries idempotently; tolerate duplicates, delays, and reordering. 5. Reconcile critical state with `GET /v3/orders/{order_id}`. - Source-of-truth precedence: OpenAPI for HTTP structure; curated guides for behavior and constraints; saved examples are illustrative. - Retry only transient failures with bounded exponential backoff and jitter. Do not blindly retry non-idempotent creates; use a stable external ID and reconcile first. - Never expose API keys or webhook secrets in client code or logs. - Documentation root: https://developer.firstdelivery.com/ - Production API: https://api.firstdelivery.com/api - Sandbox API: https://sandbox.firstdelivery.com/api - Authentication: `Authorization: Bearer ` - Prefer `f1rst_k1_` named API-client keys with least-privilege scopes. - Treat webhook events as potentially delayed, duplicated, or out of order; reconcile critical state with the Orders API. ## Start Here - [Getting Started](https://developer.firstdelivery.com/getting-started/): Quote providers, create an order, and understand what happens next. - [Authentication and Errors](https://developer.firstdelivery.com/auth-errors/): API-client keys, scopes, rotation, rate limits, and error handling. - [Sandbox](https://developer.firstdelivery.com/sandbox/): Environment isolation, realistic test data, and sandbox limitations. ## Guides - [Workflow Recipes](https://developer.firstdelivery.com/guides/workflow-recipes/): Production-shaped patterns for quoting, creating, tracking, cancelling, and exporting orders. - [Delivery Lifecycle](https://developer.firstdelivery.com/guides/delivery-lifecycle/): Order states, webhook mappings, cancellation, reassignment, and reconciliation. - [POS Integrations](https://developer.firstdelivery.com/guides/pos-integrations/): How supported POS orders enter FIRST Delivery and use the standard order lifecycle, routing, tracking, and webhooks. - [Auto-Routing Strategies](https://developer.firstdelivery.com/guides/auto-routing/): Strategy resolution, routing gates, delays, provider ranking, fallbacks, and auto-reassignment. - [Orders](https://developer.firstdelivery.com/guides/orders/): Create, update, cancel, and reconcile delivery orders. - [Create an Order](https://developer.firstdelivery.com/create-order/): Build a reliable Create Order request and understand what happens after First accepts it. - [Create Order Request Fields](https://developer.firstdelivery.com/create-order/request-fields/): Required and optional request fields, contents, options, and response identifiers. - [Create Order Addresses](https://developer.firstdelivery.com/create-order/addresses/): Send geocodable pickup and drop-off addresses providers accept reliably. - [Create Order Payments and Tips](https://developer.firstdelivery.com/create-order/payments/): Understand which amounts affect providers and which are retained for reporting. - [Create Order Sandbox Testing](https://developer.firstdelivery.com/create-order/sandbox-testing/): Use realistic test data and understand sandbox lifecycle simulation. - [Create Order Quotes and Routing](https://developer.firstdelivery.com/create-order/routing/): Choose default strategy routing, overrides, quote routing, or manual assignment. - [Create Order Provider Rejects](https://developer.firstdelivery.com/create-order/provider-rejects/): Diagnose orders that are created but not accepted by an external provider. - [Webhooks](https://developer.firstdelivery.com/guides/webhooks/): Payload semantics, delivery guarantees, deduplication, and receiver security. - [Tracking Links](https://developer.firstdelivery.com/guides/tracking-links/): The customer tracking page: where to get the link, what it shows, and how to brand it and text it to customers. - [Fleet Behavior](https://developer.firstdelivery.com/guides/fleet-behavior/): Provider-specific PIN, scheduling, update, and handoff behavior. - [Debugging](https://developer.firstdelivery.com/guides/debugging/): Request provenance, request IDs, event history, and archive behavior. - [Service Status](https://developer.firstdelivery.com/guides/service-status/): Live service status, incident subscriptions, and the status JSON API. - [Exports](https://developer.firstdelivery.com/guides/exports/): Create and download asynchronous order exports safely. - [Driver Mileage](https://developer.firstdelivery.com/guides/driver-mileage/): Straight-line, routed, and odometer miles, and why Miles Difference is usually negative. - [API Change Policy](https://developer.firstdelivery.com/guides/change-policy/): Compatibility expectations and integration-safe change practices. - [Driver App API](https://developer.firstdelivery.com/guides/driver-app/): Authentication and endpoint conventions for driver-app workflows. - [Partner Accounts](https://developer.firstdelivery.com/partner-accounts/): Onboard and operate sub-operators for partner integrations. - [Refunds](https://developer.firstdelivery.com/guides/refunds/): Create, inspect, and update delivery refund requests. - [Scheduled Orders](https://developer.firstdelivery.com/guides/scheduled-orders/): Create scheduled deliveries with supported timing constraints. - [Order Options](https://developer.firstdelivery.com/guides/order-options/): Choose delivery options supported by external fleets. - [Proof of Delivery](https://developer.firstdelivery.com/guides/proof-of-delivery/): Request and consume provider proof-of-delivery artifacts. - [Age-Restricted Items](https://developer.firstdelivery.com/guides/alcohol-delivery/): Flag alcohol, tobacco, and hemp orders and see which fleets check age. - [Cash Orders](https://developer.firstdelivery.com/guides/cash-orders/): Represent cash collection and cash-on-delivery orders. - [Catering Orders](https://developer.firstdelivery.com/guides/catering-orders/): Configure large and catering delivery orders. - [Tips](https://developer.firstdelivery.com/guides/tips/): Send courier tips and understand provider behavior. ## Updates - [Changelog](https://developer.firstdelivery.com/changelog/): Recent developer-facing API and webhook changes. ## API Reference ### First API #### Platform API / Account - [GET Get Account](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/account/get-get-account/): `GET /me`. Required scope: `account:read`. Returns the operator that owns this `f1rst_k1_` key, its country, and whether that operator can place orders. #### Platform API / Territories - [POST Create Territory](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/territories/post-create-territory/): `POST /v3/territories`. Required scope: `territories:write`. A **territory** is a geographic zone under which merchants and runners are grouped. This gives you the ability to - [GET Get Territories](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/territories/get-get-territories/): `GET /v3/territories`. Required scope: `territories:read`. - [GET Get Territory](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/territories/get-get-territory/): `GET /v3/territories/{territory_id}`. Required scope: `territories:read`. #### Platform API / Cohorts - [GET Get Cohorts](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/cohorts/get-get-cohorts/): `GET /v3/cohorts`. Required scope: `cohorts:read`. Gets all cohorts. You can pass these `id` fields as the `cohort_id` in a merchant create post. #### Platform API / Runners - [POST Create Runner](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/runners/post-create-runner/): `POST /v3/runners`. Required scope: `runners:write`. Creates a runner in a given territory. **The** **`id`** **field in a successful response should be saved on your end - this needs to be sent as the** **`runner_id`** **field when assigning orders.** #### Platform API / Merchants - [POST Create Merchant](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/merchants/post-create-merchant/): `POST /v3/merchants`. Required scope: `merchants:write`. Creates a merchant. Every `order` must have a merchant associated with it. - [PATCH Update Merchant](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/merchants/patch-update-merchant/): `PATCH /vendors/{merchant_id}`. Required scope: `merchants:write`. Partially updates a business profile (merchant). All body fields are optional — only the fields you include will be changed. - [GET Get Merchants](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/merchants/get-get-merchants/): `GET /v3/merchants`. Required scope: `merchants:read`. Fetch all merchants for your workspace, limited to 250 per fetch, but with pagination options. - [GET Get Merchant](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/merchants/get-get-merchant/): `GET /v3/merchants/{merchant_id}`. Required scope: `merchants:read`. Gets a specific merchant object given an id #### Platform API / Orders - [POST Get Provider Quotes](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/post-get-provider-quotes/): `POST /v3/quotes`. Required scope: `quotes:create`. Why do I need quotes? - [POST Create Order](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/post-create-order/): `POST /v3/orders`. Required scope: `orders:write`. Creates a delivery order. For implementation guidance, request fields, sandbox behavior, routing, and provider rejects, see [Create an order](https://developer.firstdelivery.com/create-order/). - [GET Get Orders](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/get-get-orders/): `GET /v3/orders`. Required scope: `orders:read`. Returns a **paginated** list of orders for your operator. - [GET Get Order](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/get-get-order/): `GET /v3/orders/{order_id}`. Required scope: `orders:read`. - [PATCH Update Order](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/patch-update-order/): `PATCH /v3/orders/{order_id}`. Required scope: `orders:write`. Update order details - [POST Update Fulfillment Status](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/post-update-fulfillment-status/): `POST /v3/orders/{order_id}/status`. Required scope: `orders:write`. **If you operate your own fleet, and runners are** _**not using the First Runner app,**_ **you can remotely update the status of an order, and send runner location updates, via this endpoint.** - [GET Get Fulfillment Status](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/get-get-fulfillment-status/): `GET /v3/orders/{order_id}/status`. Required scope: `orders:read`. - [POST Cancel Order](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/post-cancel-order/): `POST /orders/{order_id}/cancel`. Required scope: `orders:write`. Cancel an order **before it has been fulfilled.** If you are using our DSP Fleet network, orders can only be cancelled before the driver has picked up the food. #### Platform API / Strategies - [POST Create Dispatch Strategy](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/strategies/post-create-dispatch-strategy/): `POST /v3/strategies`. Required scope: `strategies:write`. **Strategies** allow you to configure ranked preferences for which DSPs should receive an order, based on several parameters. Our algorithm determines the strategy based on this order: - [POST Replace Strategy Schedule](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/strategies/post-replace-strategy-schedule/): `POST /dispatch/strategies_hours/{strategies_hour_id}`. Required scope: `strategies:write`. - [GET Get Dispatch Strategies](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/strategies/get-get-dispatch-strategies/): `GET /v3/strategies`. Required scope: `strategies:read`. Get all Strategies - [GET (BETA) Get Strategy Schedule](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/strategies/get-beta-get-strategy-schedule/): `GET /`. - [DELETE (BETA) Remove Strategy Schedule](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/strategies/delete-beta-remove-strategy-schedule/): `DELETE /dispatch/strategies_hours/{strategies_hour_id}`. Required scope: `strategies:write`. - [PATCH Append To Strategy Schedule](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/strategies/patch-append-to-strategy-schedule/): `PATCH /dispatch/strategies_hours/{strategies_hour_id}`. Required scope: `strategies:write`. Add ranges of hours for which a strategy is INACTIVE, meaning that the strategy will not be executed during those hours, and order must be manually placed with an external DSP by a dispatcher. #### Platform API / Exports - [POST Create Order Export](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/exports/post-create-order-export/): `POST /v3/orders/export`. Required scope: `reports:read`. Start an **asynchronous orders export** using the same filters and search as [Get Orders](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/orders/get-get-orders/). - [GET Get Order Export](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/exports/get-get-order-export/): `GET /v3/orders/export/{order_export_id}`. Required scope: `reports:read`. Poll the status of an asynchronous orders export started with **Create Order Export**. - [GET Download Order Export](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/exports/get-download-order-export/): `GET /v3/orders/export/{order_export_id}/download`. Required scope: `reports:read`. Download the generated orders export file. - [POST Orders (Legacy)](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/exports/post-orders-legacy/): `POST /v3/exports`. Required scope: `reports:read`. > ## ⚠️ Legacy — always use the async export flow instead #### Platform API / Refunds - [POST Create DSP Refund Request](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/refunds/post-create-dsp-refund-request/): `POST /v3/refunds`. Required scope: `refunds:write`. Creates a new DSP refund request. Requires admin, partner, or vendor authentication. - [GET Get DSP Refunds](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/refunds/get-get-dsp-refunds/): `GET /v3/refunds`. Required scope: `refunds:read`. Retrieves a paginated list of DSP refunds with filtering and sorting options. Supports CSV/Excel export. - [PATCH Update DSP Refund](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/refunds/patch-update-dsp-refund/): `PATCH /v3/refunds/{refund_id}`. Required scope: `refunds:write`. Updates a DSP refund's internal status. Requires DspRefundEdit permission. - [GET Get DSP Refund by DSP ID](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/refunds/get-get-dsp-refund-by-dsp-id/): `GET /v3/refunds/{dsps_delivery_id}`. Required scope: `refunds:read`. Retrieves a specific DSP refund by its external DSP delivery ID. #### Platform API / Shifts - [GET List Shifts](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/shifts/get-list-shifts/): `GET /v3/shifts`. Required scope: `shifts:read`. Returns a paginated, operator-scoped list of public shift records. Roles: admin, partner, or vendor. - [GET Get Shift](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/shifts/get-get-shift/): `GET /v3/shifts/{shift_id}`. Required scope: `shifts:read`. Returns one public shift record. Roles: admin, partner, or vendor. The shift must belong to the caller's operator; missing and foreign-operator IDs both return 404. Internal rider, payout, and Toast fields are omitted. - [POST Create Shift](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/shifts/post-create-shift/): `POST /v3/shifts`. Required scope: `shifts:write`. Creates an operator-owned shift. Requires admin credentials. - [PATCH Update Shift](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/shifts/patch-update-shift/): `PATCH /v3/shifts/{shift_id}`. Required scope: `shifts:write`. Partially updates an operator-owned shift. Requires admin credentials. Send `user_id: null` to unassign the runner. - [DELETE Cancel Shift](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/shifts/delete-cancel-shift/): `DELETE /v3/shifts/{shift_id}`. Required scope: `shifts:write`. Cancels (soft-deletes) an operator-owned shift. Requires admin credentials. This action cannot be applied to a Toast-clocked shift and returns 409 in that case. Missing and foreign-operator shift IDs return 404. - [POST Check In to Shift](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/shifts/post-check-in-to-shift/): `POST /v3/shifts/{shift_id}/check_in`. Required scope: `shifts:write`. Checks the runner in to an operator-owned shift. Requires admin credentials. The optional flags record whether the runner has cash and a hotbag. The operation is idempotent: retrying it preserves the original check-in timestamp. - [POST Check Out of Shift](https://developer.firstdelivery.com/reference/generated/first-api/platform-api/shifts/post-check-out-of-shift/): `POST /v3/shifts/{shift_id}/check_out`. Required scope: `shifts:write`. Checks the runner out of an operator-owned shift. Requires admin credentials. The operation is idempotent: retrying it keeps the shift checked out. #### Webhooks / Webhook Events - [POST Order Scheduled (scheduled)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-order-scheduled-scheduled/): `POST /first-delivery/webhook`. `status_v3: scheduled` · `status: Pending` - [POST Driver Assigned (en_route_pickup)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-driver-assigned-en-route-pickup/): `POST /first-delivery/webhook`. `status_v3: en_route_pickup` · `status: Assigned` - [POST Arrived at Pickup (arrived_pickup)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-arrived-at-pickup-arrived-pickup/): `POST /first-delivery/webhook`. `status_v3: arrived_pickup` · `status: AtPickup` - [POST Picked Up (en_route_dropoff)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-picked-up-en-route-dropoff/): `POST /first-delivery/webhook`. `status_v3: en_route_dropoff` · `status: InTransit` - [POST Arrived at Dropoff (arrived_dropoff)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-arrived-at-dropoff-arrived-dropoff/): `POST /first-delivery/webhook`. `status_v3: arrived_dropoff` · `status: AtDestination` - [POST Delivered (completed)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-delivered-completed/): `POST /first-delivery/webhook`. `status_v3: completed` · `status: Delivered` - [POST Cancelled (cancelled)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-cancelled-cancelled/): `POST /first-delivery/webhook`. `status_v3: cancelled` · `status: Cancelled` - [POST Reassigned (reassign)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-reassigned-reassign/): `POST /first-delivery/webhook`. `status_v3: reassign` · `status: Reassign` - [POST Refunded (Refunded)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-refunded-refunded/): `POST /first-delivery/webhook`. `status: Refunded` (no `status_v3`) - [POST Ready Now (ready_now)](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/webhook-events/post-ready-now-ready-now/): `POST /first-delivery/webhook`. `event: ready_now` · current `status_v3` is preserved #### Webhooks - [POST Create Webhook](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/post-create-webhook/): `POST /webhooks`. Required scope: `webhooks:write`. Registers a webhook destination for your operator. First sends JSON `POST` requests when matching order lifecycle statuses or opted-in events occur. - [GET List Webhooks](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/get-list-webhooks/): `GET /webhooks`. Required scope: `webhooks:read`. Lists every webhook registered for your operator, newest first. - [PATCH Update Webhook](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/patch-update-webhook/): `PATCH /webhooks/{id}`. Required scope: `webhooks:write`. Partially updates a webhook. Only supplied fields change. - [DELETE Delete Webhook](https://developer.firstdelivery.com/reference/generated/first-api/webhooks/delete-delete-webhook/): `DELETE /webhooks/{id}`. Required scope: `webhooks:write`. Permanently removes a webhook. Deliveries to its URL stop immediately. ### Driver App #### Auth & Login - [POST Send verification code](https://developer.firstdelivery.com/reference/generated/driver-app/auth-login/post-send-verification-code/): `POST /verifications`. Requests an SMS verification PIN for the given phone number. Public endpoint, no auth required — called before login. - [POST Login (phone + PIN)](https://developer.firstdelivery.com/reference/generated/driver-app/auth-login/post-login-phone-pin/): `POST /login`. Exchanges a phone number + PIN for an access token. Public endpoint, no auth required. Source: store.ts `login()`. #### User & Profile - [GET Get current user](https://developer.firstdelivery.com/reference/generated/driver-app/user-profile/get-get-current-user/): `GET /me`. Returns the signed-in driver's full profile plus operator/retreat-point context. Source: endpoints/users.ts `GET /me`. - [PATCH Update profile](https://developer.firstdelivery.com/reference/generated/driver-app/user-profile/patch-update-profile/): `PATCH /runners/{user_id}`. Updates one or more fields on the driver's own profile. Source: models/users.ts `updateProfile()`. Accepts a partial body — only send the fields you're changing (the server's `updateRunnerSchema` Joi validation rejects unknown keys). - [GET Get availability](https://developer.firstdelivery.com/reference/generated/driver-app/user-profile/get-get-availability/): `GET /runners/{user_id}/availability`. Returns the driver's saved weekly availability preferences. Source: models/runner_availability.ts `findByUserId()`. - [PUT Update availability](https://developer.firstdelivery.com/reference/generated/driver-app/user-profile/put-update-availability/): `PUT /runners/{user_id}/availability`. Saves the driver's weekly availability preferences. Source: models/runner_availability.ts `modify()`. Note `days_available`/`shifts_available` are sent as JSON-stringified arrays in the body (see `RunnerAvailabilityUpdate` type) even though the response returns them as real arrays. - [PATCH Repair / resync run](https://developer.firstdelivery.com/reference/generated/driver-app/user-profile/patch-repair-resync-run/): `PATCH /runners/repair/{user_id}`. Rebuilds the driver's run/stop ordering from their current in-progress orders. Source: models/runs.ts `resync()`. #### Devices - [POST Register device](https://developer.firstdelivery.com/reference/generated/driver-app/devices/post-register-device/): `POST /devices/{device_id}`. Registers (or updates) the driver's device metadata. Source: models/devices.ts `insert()` — upserts by `device_id`. #### Geolocation - [POST Post location ping](https://developer.firstdelivery.com/reference/generated/driver-app/geolocation/post-post-location-ping/): `POST /runners/location`. Reports the driver's current GPS location while on shift. Source: util/background_geolocation.ts. #### Orders - [PATCH Place order (finalize pickup items)](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-place-order-finalize-pickup-items/): `PATCH /orders/{order_id}/place`. Finalizes a placed order after the driver confirms pickup items. Source: components/PlaceOrder.ios.tsx (calls `PATCH` directly, not through a store.ts method). - [PATCH Self-assign order](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-self-assign-order/): `PATCH /orders/{order_id}/assign`. Self-assigns an order to the driver. Source: modules/transactions/.../assignOrderController.ts. - [PATCH Unassign order (set pending_dispatch)](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-unassign-order-set-pending-dispatch/): `PATCH /orders/{order_id}/status`. Unassigns the driver from an order, returning it to the dispatch pool. Source: endpoints/orders.ts `PATCH /orders/:orderId/status` (drivers may only set `status: "pending_dispatch"` on their own order — anything else is rejected with 401). - [GET Get order contents](https://developer.firstdelivery.com/reference/generated/driver-app/orders/get-get-order-contents/): `GET /orders/{order_id}/contents`. Returns the line items for an order. Source: `PlainOrder` type. - [PATCH Acknowledge order](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-acknowledge-order/): `PATCH /orders/{order_id}/acknowledge`. Driver acknowledges a newly-assigned order. Source: store.ts `acknowledge()`. - [PATCH Arrive at pickup](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-arrive-at-pickup/): `PATCH /orders/{order_id}/arrive-pickup`. Marks the driver as arrived at the pickup location. Source: store.ts `arriveOrigin()` → models/orders.ts `arriveOrigin()`. - [PATCH Arrive at dropoff](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-arrive-at-dropoff/): `PATCH /orders/{order_id}/arrive-dropoff`. Marks the driver as arrived at the dropoff location. Source: store.ts `arriveDropoff()` → models/orders.ts `arriveDropoff()`. - [PATCH Mark picked up](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-mark-picked-up/): `PATCH /orders/{order_id}/pickup`. Marks the order as picked up from the merchant. Source: store.ts `pickup()` → models/orders.ts `setPickedUp()`. - [PATCH Mark order not ready](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-mark-order-not-ready/): `PATCH /orders/{order_id}/not-ready`. Flags that the merchant isn't ready yet. Source: store.ts `orderNotReady()` → models/orders.ts `notReady()`. - [PATCH Drop off order](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-drop-off-order/): `PATCH /orders/{order_id}/drop`. Drops off the order and records the tip. Source: store.ts `dropoff()` → models/orders.ts `setDroppedOff()`. - [PATCH Submit proof of delivery](https://developer.firstdelivery.com/reference/generated/driver-app/orders/patch-submit-proof-of-delivery/): `PATCH /orders/{order_id}/proof`. Submits proof-of-delivery (signature/photo flag). Source: store.ts `proofDelivery()` → endpoints/orders.ts `PATCH /orders/:orderId/proof`. - [POST Upload receipt image](https://developer.firstdelivery.com/reference/generated/driver-app/orders/post-upload-receipt-image/): `POST /orders/{order_id}/uploadReceipt`. Uploads a receipt photo as multipart form data. Goes through the `api_unauthed` axios instance (no `/api` prefix, explicit `Authorization: Bearer` header) rather than the usual authenticated client. - [GET Get my orders (v3)](https://developer.firstdelivery.com/reference/generated/driver-app/orders/get-get-my-orders-v3/): `GET /v3/orders/runner`. Lists the driver's active orders. Source: modules/transactions/.../getOrdersController.ts `GetOrdersRunnerController`. - [GET Get previous orders (v3)](https://developer.firstdelivery.com/reference/generated/driver-app/orders/get-get-previous-orders-v3/): `GET /v3/orders/runner`. Lists the driver's completed/past orders (`active=false`). Same controller and response shape as "Get my orders (v3)" — see that request's description for the field glossary. `status` will typically read `completed` or `cancelled`. - [GET New Request](https://developer.firstdelivery.com/reference/generated/driver-app/orders/get-new-request/): `GET /`. #### Runs & Plans - [GET Get current run](https://developer.firstdelivery.com/reference/generated/driver-app/runs-plans/get-get-current-run/): `GET /runs/{user_id}`. Returns the driver's current batched run. Source: models/runs.ts `getRunForRunner()` — `RunComposite` type. #### Shifts & Blocks - [PATCH Claim shift](https://developer.firstdelivery.com/reference/generated/driver-app/shifts-blocks/patch-claim-shift/): `PATCH /shifts/claim`. Claims an open shift. Source: models/shifts.ts `claim()`. - [PATCH Drop shift](https://developer.firstdelivery.com/reference/generated/driver-app/shifts-blocks/patch-drop-shift/): `PATCH /shifts/drop`. Drops a shift the driver previously claimed. Source: models/shifts.ts `drop()`. - [PATCH Check in to shift](https://developer.firstdelivery.com/reference/generated/driver-app/shifts-blocks/patch-check-in-to-shift/): `PATCH /shifts/check_in`. Checks the driver in to a claimed shift, recording whether they have a cash bag / hot bag. Source: models/shifts.ts `update()` (called via the check-in flow). - [GET Get upcoming shifts](https://developer.firstdelivery.com/reference/generated/driver-app/shifts-blocks/get-get-upcoming-shifts/): `GET /shifts/couriers/upcoming`. Lists the driver's upcoming claimed shifts. Source: endpoints/staffing.ts `GET /shifts/couriers/upcoming` — array of `Shift`. - [GET Get free shifts (categorized)](https://developer.firstdelivery.com/reference/generated/driver-app/shifts-blocks/get-get-free-shifts-categorized/): `GET /shifts/free/categorized`. Lists open shifts the driver could claim, pre-sorted into buckets. Source: models/shifts.ts `categorizedFreeShifts()`. - [GET Get previous shifts](https://developer.firstdelivery.com/reference/generated/driver-app/shifts-blocks/get-get-previous-shifts/): `GET /shifts/couriers/previous`. Lists the driver's past shifts. Source: endpoints/staffing.ts `GET /shifts/couriers/previous` — same `Shift[]` shape as "Get upcoming shifts", just in the past (`checked_in` will usually be set). #### Messages - [GET Get legacy messages](https://developer.firstdelivery.com/reference/generated/driver-app/messages/get-get-legacy-messages/): `GET /messages/{user_id}`. Gets the legacy 1:1 dispatcher chat thread for this user. Source: models/messages.ts `getMessages()` — returns a flat array, newest first, capped at 100. - [PATCH Mark legacy messages seen](https://developer.firstdelivery.com/reference/generated/driver-app/messages/patch-mark-legacy-messages-seen/): `PATCH /messages/{user_id}`. Marks unseen legacy messages addressed to this user as seen. Source: models/messages.ts `seenByRunner()`. - [POST Send legacy message](https://developer.firstdelivery.com/reference/generated/driver-app/messages/post-send-legacy-message/): `POST /messages`. Sends a legacy 1:1 message. Source: modules/messages/postMessageController.ts. As a `runner`, the `to` field is inferred server-side (your last message thread, falling back to an admin) — you don't need to pass it. - [GET Get group messages](https://developer.firstdelivery.com/reference/generated/driver-app/messages/get-get-group-messages/): `GET /v3/messages/{group_id}`. Gets messages for one v3 group chat (territory or retreat-point channel). Source: group_messages/endpoints/getMessagesController.ts → `ChatMessage` type. Supports `?limit=`, `?page=`, `?since=` query params (not currently set on this request). - [POST Mark group messages read](https://developer.firstdelivery.com/reference/generated/driver-app/messages/post-mark-group-messages-read/): `POST /v3/messages/{group_id}/mark_read`. Marks all messages in a v3 group as read for this user. Source: group_messages/endpoints/markGroupMessagesReadController.ts. - [POST Send group message](https://developer.firstdelivery.com/reference/generated/driver-app/messages/post-send-group-message/): `POST /v3/messages`. Sends a message into a v3 group chat. Source: group_messages/endpoints/createMessageController.ts. - [GET Get message groups](https://developer.firstdelivery.com/reference/generated/driver-app/messages/get-get-message-groups/): `GET /v3/message_groups`. Lists the v3 chat groups (channels) this user belongs to — their active territory, plus their current shift's retreat point if checked into one. Source: group_messages/endpoints/getMessageGroupsController.ts → `ChatWithContext` type. #### Territory & Operator Config - [GET Get my territory](https://developer.firstdelivery.com/reference/generated/driver-app/territory-operator-config/get-get-my-territory/): `GET /runners/territory`. Returns a driver-relevant subset of the driver's active territory's settings (not the full `Territory` row — see "Get territory by id" for that). Source: models/territories.ts `findPartialByUserId()`. - [GET Get territory by id](https://developer.firstdelivery.com/reference/generated/driver-app/territory-operator-config/get-get-territory-by-id/): `GET /territories/{territory_id}`. Returns the full `Territory` row by id (no field filtering — unlike "Get my territory", which only returns a driver-relevant subset). Source: models/territories.ts `findById()`. This is a large object (60+ fields covering dispatch/engine/billing config); the example below shows only the fields relevant to a driver. - [GET Get operator config](https://developer.firstdelivery.com/reference/generated/driver-app/territory-operator-config/get-get-operator-config/): `GET /runners/operator`. Returns a driver-relevant subset of the driver's operator config. Source: models/operators.ts `findPartialByUserId()`. #### Payouts - [GET Get Stripe balance](https://developer.firstdelivery.com/reference/generated/driver-app/payouts/get-get-stripe-balance/): `GET /users/stripe/balance`. Returns the driver's unpaid Stripe Connect balance. Source: endpoints/users.ts `GET /users/stripe/balance` → `Stripe.getUnpaidBalance()`. - [GET Get Stripe Connect client id](https://developer.firstdelivery.com/reference/generated/driver-app/payouts/get-get-stripe-connect-client-id/): `GET /users/stripe/client_id`. Returns the operator's Stripe Connect client id (used to kick off the OAuth onboarding flow). Source: endpoints/users.ts `GET /users/stripe/client_id`. - [GET Get Stripe dashboard URL](https://developer.firstdelivery.com/reference/generated/driver-app/payouts/get-get-stripe-dashboard-url/): `GET /users/stripe/dashboard_url`. Returns a one-time link to the driver's Stripe Express dashboard. Source: endpoints/users.ts `GET /users/stripe/dashboard_url`. - [GET Get daily summaries](https://developer.firstdelivery.com/reference/generated/driver-app/payouts/get-get-daily-summaries/): `GET /runners/daily_summaries`. Returns daily earnings summaries for the given `runnerId` query param. Source: endpoints/runners.ts `GET /runners/daily_summaries` → models `DailySummaries.forRunner()`. Drivers may only query their own `runnerId` (admins can query anyone) — a mismatch returns 401. #### Offers - [GET Get offers for runner](https://developer.firstdelivery.com/reference/generated/driver-app/offers/get-get-offers-for-runner/): `GET /offers/runner/{user_id}`. Returns push-style order offers pending for this driver. Source: endpoints/offers.ts `GET /offers/runner/:runnerId`. #### Retreat Points - [GET Get retreat points](https://developer.firstdelivery.com/reference/generated/driver-app/retreat-points/get-get-retreat-points/): `GET /retreat_points`. Lists retreat points. Source: endpoints/retreat_points.ts `GET /retreat_points` — for `role: runner` this is scoped to the driver's active territory (`findByTerritory()`); admins get every retreat point on the operator instead. #### Realtime (Socket.IO) — reference only - [GET emit: authenticate](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-emit-authenticate/): `GET /`. Client → server. Sent once on socket connect to authenticate the realtime session. Source: util/socket.ts. Not a real HTTP request — method/URL on this item aren't meaningful, this is documentation only. - [GET listen: connect](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-connect/): `GET /`. Server → client. Fires when the underlying Socket.IO transport connects. Source: util/socket.ts. Not a real HTTP request — documentation only. - [GET listen: connect_error](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-connect-error/): `GET /`. Server → client. Fires when the socket fails to connect. Source: util/socket.ts. Not a real HTTP request — documentation only. - [GET listen: authenticate-callback](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-authenticate-callback/): `GET /`. Server → client. Acknowledges the `authenticate` emit succeeded, confirming the socket is now subscribed to this user's channels. Source: util/socket.ts. Not a real HTTP request — documentation only. - [GET listen: {userId}:plan](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-userid-plan/): `GET /`. Server → client. Fires when this driver's run/plan changes — the payload is expected to mirror "Get current run"'s `RunComposite` response, but the exact emit payload wasn't independently verified this pass. Source: util/socket.ts. Not a real HTTP request — documentation only. - [GET listen: {userId}:orders](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-userid-orders/): `GET /`. Server → client. Fires when one of this driver's orders changes — payload likely mirrors an `ExternalOrder`/`TransactionSQL` row, not independently verified this pass. Source: util/socket.ts. Not a real HTTP request — documentation only. - [GET listen: {userId}:shift](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-userid-shift/): `GET /`. Server → client. Fires when one of this driver's shifts changes — payload likely mirrors a `Shift` row, not independently verified this pass. Source: util/socket.ts. Not a real HTTP request — documentation only. - [GET listen: {userId}:user](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-userid-user/): `GET /`. Server → client. Fires when the driver's own user record changes — payload likely mirrors the `GET /me` user fields, not independently verified this pass. Source: util/socket.ts. Not a real HTTP request — documentation only. - [GET listen: group-message-change](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-group-message-change/): `GET /`. Server → client. Fires when a v3 group chat has a new message or unread-count change — payload likely mirrors the `ChatWithContext` shape used by "Get message groups" (`{group, unread, latest}`), not independently verified this pass. Source: util/socket.ts. Not a real HTTP request — documentation only. - [GET listen: messages](https://developer.firstdelivery.com/reference/generated/driver-app/realtime-socket-io-reference-only/get-listen-messages/): `GET /`. Server → client. Fires on new legacy 1:1 messages — payload likely mirrors a `MessageSQL` row, not independently verified this pass. Source: util/socket.ts. Not a real HTTP request — documentation only. ## Additional Machine Resources - [First API OpenAPI 3.1](https://developer.firstdelivery.com/openapi/first-api.openapi.json): Platform API and Webhooks. - [Driver App OpenAPI 3.1](https://developer.firstdelivery.com/openapi/driver-app.openapi.json): Driver application API. - [Legacy Anchor Map](https://developer.firstdelivery.com/anchor-map.json): Postman item IDs to canonical developer-site URLs.