---
title: "Marks a shipped transfer delivered (the app's \"Mark as Delivered\"): its stock moves to the customer."
method: POST
path: "/api/v1/sales-orders/{id}/deliver"
tags: ["SalesOrders"]
---

# Marks a shipped transfer delivered (the app's "Mark as Delivered"): its stock moves to the customer.

`POST /api/v1/sales-orders/{id}/deliver`

## Request

- Base URL: `https://app.flexonthejob.com`
- URL: `https://app.flexonthejob.com/api/v1/sales-orders/{id}/deliver`
- Auth: HTTP bearer

Requires `ManageSalesOrders` and an `Idempotency-Key` header. Body optional:
`{ "transferId": 904 }`; omitted = the order's single in-transit transfer. The transfer
must be in transit (at its last stop, if it has several) and have shipping info
(`/ship`). Same code path as the app: the transfer becomes `Completed`, each remaining
line's `quantityDelivered` is recorded, its stock units move to the delivery location and are
released — and consumed (removed from inventory) when that location's type consumes
inventory or is a job site, as customer delivery locations usually are. Lines marked
`Failed` in transit are not delivered: their units stay at their current location, are
released from the transfer, and the line ends `Returned` with no `quantityDelivered`
and a "[RETURNED] …" note on the item; lines already `Returned` are skipped. The history records
"Transfer completed — items delivered (via API key '…')" and the order's `status` is
recalculated: `Delivered` when every transfer is complete, or straight to
`Complete` when its invoices already cover the order and are paid.

## Path parameters

- `id` integer, required

## Request body

- SalesOrderTransferStepApiRequest: Body of `POST /api/v1/sales-orders/{id}/complete-pick` and `/deliver`; optional. Example: `{ "transferId": 904 }`.
  - `transferId` integer, nullable: The order's transfer to act on. Omit when the order has exactly one transfer in the state the step needs (`Pending` for complete-pick, in transit for deliver). Example: `904`.

## Response `200`

Delivered; the recalculated order status.

- SalesOrderStepResponse: Response of the sales-order fulfilment steps (`/pick`, `/complete-pick`, `/ship`, `/deliver`, `/complete`, `/cancel`).
  - `salesOrderId` integer: The sales order's id. Example: `318`.
  - `status` string: Order status after the step: `Pending`, `Picking`, `Packed`, `Shipped`, `Delivered`, `Complete` or `Cancelled`. Recalculated from the order's transfers, so always read it rather than assuming the next status. Example: `Packed`.
  - `fulfillmentStatus` string, nullable: Aggregate status of the order's transfers (`None`, `Pending`, `InTransit`, `AtWaypoint`, `Completed`, `Cancelled`…), as `fulfillmentStatus` on the order. Example: `InTransit`.
  - `transferId` integer, nullable: The transfer the step acted on (resolved when the request did not name one); null for `/complete` and `/cancel`. Example: `904`.
  - `message` string, nullable: Human-readable confirmation, as the app shows it. Example: `Transfer status updated to In Transit.`
  - `unitsPicked` integer: `/pick`: units marked picked by this call (0 for other steps). Example: `10`.
  - `itemsReturned` integer: `/cancel`: delivered units returned to inventory (0 for other steps). Example: `0`.
  - `transfersCancelled` integer: `/cancel`: transfers cancelled (0 for other steps). Example: `1`.

## Other responses

- `400`: Missing `Idempotency-Key`.
- `401`: Unauthorized
- `403`: Forbidden
- `404`: No such sales order in this organization, or `transferId` is not one of its transfers.
- `409`: The transfer is not in transit (detail: `Transfer must be In Transit to complete. Current status: …`), has waypoints left, has no shipping info yet, the order has no transfer in transit, or the key's creator is unknown.
- `422`: Several transfers in transit and no `transferId` (`errors.transferId` lists them).
- `429`: Too Many Requests

---

[API](https://skmtc.dev/flexonthejob/apis/flex-api.md) · [All operations](https://skmtc.dev/flexonthejob/apis/flex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flexonthejob/apis/flex-api/revisions/19c8f4d27acf?raw)
