---
title: "Sets a line's picked quantity (the Details page's picked-quantity editor); lowering it unpicks and releases stock."
method: PUT
path: "/api/v1/sales-orders/{id}/lines/{lineId}/picked-quantity"
tags: ["SalesOrders"]
---

# Sets a line's picked quantity (the Details page's picked-quantity editor); lowering it unpicks and releases stock.

`PUT /api/v1/sales-orders/{id}/lines/{lineId}/picked-quantity`

## Request

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

Requires `ManageSalesOrders` and an `Idempotency-Key` header. Body:
`{ "quantityPicked": 3 }`. Only while the order is `Picking`. Same code path as
the app: raising the quantity claims that many more available units (the primary source
location and already-opened bundles first) onto the order's live transfer — or creates a
transfer for the uncovered remainder when there is none; lowering it takes units off the
live transfers (secondary locations first), releases them to stock and cancels a transfer
left empty. Over-picking is allowed. The order's `updatedAt` moves and a "Picking
progress — X of Y unit(s) picked" entry is written; the status does not change. This is
the line-level count; the transfer scan flow is `/pick`.

## Path parameters

- `id` integer, required
- `lineId` integer, required

## Request body

- SetSalesOrderLinePickedApiRequest: Body of `PUT /api/v1/sales-orders/{id}/lines/{lineId}/picked-quantity`. Example: `{ "quantityPicked": 3 }`.
  - `quantityPicked` number, double, required: The line's new picked quantity, 0–1,000,000 (more than ordered is allowed, as in the app). Lower than now = unpick. Example: `3`.

## Response `200`

Saved; the line's quantities.

- SalesOrderLinePickResponse: Response of the line-level pick endpoints (`/scan`, `/lines/{lineId}/pick`, `/lines/pick-all`, `/lines/{lineId}/picked-quantity`).
  - `salesOrderId` integer: The sales order's id. Example: `318`.
  - `lineId` integer, nullable: The line picked; null for `/lines/pick-all`. Example: `1502`.
  - `itemName` string, nullable: The picked item's name; null for `/lines/pick-all`. Example: `Copper 12/2 Romex`.
  - `quantityPicked` number, double: The line's picked quantity after the call (0 for `/lines/pick-all`). Example: `3`.
  - `quantityOrdered` number, double: The line's ordered quantity (0 for `/lines/pick-all`). Example: `10`.
  - `orderComplete` boolean: `/scan`, `/lines/{lineId}/pick`, `/lines/pick-all`: every line of the order is now picked in full. Always `false` for `picked-quantity`. Example: `false`.
  - `linesUpdated` integer: `/lines/pick-all`: lines raised to their ordered quantity (0 = all were already picked). Example: `2`.
  - `unitsAdded` number, double: `/lines/pick-all`: units added across those lines. Example: `7`.
  - `status` string: The order's status after the call (line picks never change it). Example: `Picking`.
  - `message` string, nullable: Human-readable confirmation, as the app shows it; null for a single scan / pick. Example: `Picking progress saved`.

## Other responses

- `400`: Missing `Idempotency-Key` or `quantityPicked` missing / out of range.
- `401`: Unauthorized
- `403`: Forbidden
- `404`: No such sales order in this organization, or the line is not one of its live lines.
- `409`: The order is not `Picking` (detail: `Can only save picking progress when order is in Picking status`), a needed transfer could not be created (`Error creating transfer: …`), or the key's creator is unknown.
- `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)
