# Update Inventory Increase

`PATCH /inventory/inventory-increases/{id}`

Group: Inventory › Inventory Increases · Operation ID: `updateInventoryIncrease`

Updates the inventory increase with the given identifier. Only the fields in the request body change.

Updates one draft inventory increase. Only the fields in the request body change. Only a draft can be changed: a committed document has already moved stock and posted a journal entry, so cancel it and post a new one instead. Lines change through three arrays, deleteLines, updateLines and createLines, applied in that order, so one call can retire a line and add its replacement. Sending a line's batches, serials or binLocations replaces what that line had. The warehouse cannot be changed. Replace it by deleting the document and posting a new one. A line id belonging to another inventory increase is rejected, not skipped. The response is the updated document in full.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=updateInventoryIncrease)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | `"v1"` | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |
| `Idempotency-Key` | header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with `400 IDEMPOTENCY_NOT_SUPPORTED` rather than silently ignored. |
| `id` | path | string | yes | The unique identifier for the inventory increase to update. |

## Request body

Required, `application/json`: updateInventoryIncreaseInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `documentDate` | string (date) | no | A new document date. It sets the posting period. Use format YYYY-MM-DD. |
| `reasonCodeId` | string | no | A new reason code. See id on GET inventory/reason-codes/:id. |
| `notes` | string | no | New free text. Pass an empty string to clear it. |
| `deleteLines` | array of string | no | The unique identifiers of lines to remove. Applied before updateLines and createLines. |
| `updateLines` | array of object | no | The lines to change, each addressed by id. Applied after deleteLines and before createLines. |
| `updateLines[].id` | string | yes | The unique identifier for the line to change. A line belonging to another inventory increase is rejected, not skipped. |
| `updateLines[].itemId` | string | no | A new item for the line. See id on GET inventory/items/:id. |
| `updateLines[].unitId` | string | no | A new unit for the line's quantity. See id on GET inventory/unit-of-measures/:id. |
| `updateLines[].quantity` | string (decimal) | no | A new quantity, in the line's unit. Greater than zero when given. |
| `updateLines[].unitPrice` | string (decimal) | no | A new unit value, in the inventory increase's currency. Greater than zero when given. |
| `updateLines[].notes` | string | no | New free text. Pass an empty string to clear it. |
| `updateLines[].batches` | array of object | no | The batches making up this line's quantity. Required for a batch-tracked item, and the quantities must add up to the line's quantity. Sending this array replaces the line's batches. |
| `updateLines[].batches[].batchNumberId` | string | no | The unique identifier for an existing batch. Omit it and give batchNumber to receive a new lot, which creates the batch record when the number is new to the item. |
| `updateLines[].batches[].batchNumber` | string | no | The batch number as printed. Required unless batchNumberId is given. |
| `updateLines[].batches[].manufacturerBatchNumber` | string | no | The maker's own number for the batch. |
| `updateLines[].batches[].expirationDate` | string (date) | no | The expiration date of the batch. Use format YYYY-MM-DD. |
| `updateLines[].batches[].quantity` | string (decimal) | yes | The quantity of this batch, in the line's unit. The batch quantities of a line must add up to the line's quantity. |
| `updateLines[].batches[].unitCost` | string (decimal) | no | The cost of one unit of this batch, in the inventory increase's currency. Defaults to the line's unitPrice. |
| `updateLines[].serials` | array of object | no | The serialized units, one entry per unit. Required for a serialized item, and the count must equal the line's quantity. Sending this array replaces the line's serials. |
| `updateLines[].serials[].serialNumberId` | string | no | The unique identifier for an existing serial record. Omit it and give serialNumber for a unit new to the system. |
| `updateLines[].serials[].serialNumber` | string | no | The serial number stamped on the unit. Required unless serialNumberId is given. |
| `updateLines[].serials[].manufacturerSerialNumber` | string | no | The maker's own number for the unit. |
| `updateLines[].serials[].unitCost` | string (decimal) | no | The cost of this unit, in the inventory increase's currency. Defaults to the line's unitPrice. |
| `updateLines[].binLocations` | array of object | no | The bins the quantity lands in, in a bin-tracked warehouse. An entry may name a batchNumber or serialNumber of its own line. Sending this array replaces the line's bin entries. |
| `updateLines[].binLocations[].binLocationId` | string | yes | The unique identifier for the bin the quantity lands in. See id on GET inventory/bins/:id. |
| `updateLines[].binLocations[].quantity` | string (decimal) | yes | The quantity landing in this bin, in the line's unit. |
| `updateLines[].binLocations[].batchNumber` | string | no | Names one of this line's batches, when the bin entry belongs to it. A number not on the line is rejected. |
| `updateLines[].binLocations[].serialNumber` | string | no | Names one of this line's serialized units, when the bin entry belongs to it. |
| `createLines` | array of object | no | The lines to add. They land at the inventory increase's existing warehouse. A document with no lines cannot take new ones. |
| `createLines[].itemId` | string | yes | The unique identifier for the item this line adds to stock. See id on GET inventory/items/:id. |
| `createLines[].unitId` | string | yes | The unique identifier for the unit the quantity is counted in. See id on GET inventory/unit-of-measures/:id. |
| `createLines[].quantity` | string (decimal) | yes | The quantity added, in that unit. Greater than zero. |
| `createLines[].unitPrice` | string (decimal) | yes | The value of one unit, in the inventory increase's currency. Greater than zero. |
| `createLines[].notes` | string | no | Free text on the line. |
| `createLines[].batches` | array of object | no | The batches making up this line's quantity. Required for a batch-tracked item, and the quantities must add up to the line's quantity. |
| `createLines[].batches[].batchNumberId` | string | no | The unique identifier for an existing batch. Omit it and give batchNumber to receive a new lot, which creates the batch record when the number is new to the item. |
| `createLines[].batches[].batchNumber` | string | no | The batch number as printed. Required unless batchNumberId is given. |
| `createLines[].batches[].manufacturerBatchNumber` | string | no | The maker's own number for the batch. |
| `createLines[].batches[].expirationDate` | string (date) | no | The expiration date of the batch. Use format YYYY-MM-DD. |
| `createLines[].batches[].quantity` | string (decimal) | yes | The quantity of this batch, in the line's unit. The batch quantities of a line must add up to the line's quantity. |
| `createLines[].batches[].unitCost` | string (decimal) | no | The cost of one unit of this batch, in the inventory increase's currency. Defaults to the line's unitPrice. |
| `createLines[].serials` | array of object | no | The serialized units, one entry per unit. Required for a serialized item, and the count must equal the line's quantity. |
| `createLines[].serials[].serialNumberId` | string | no | The unique identifier for an existing serial record. Omit it and give serialNumber for a unit new to the system. |
| `createLines[].serials[].serialNumber` | string | no | The serial number stamped on the unit. Required unless serialNumberId is given. |
| `createLines[].serials[].manufacturerSerialNumber` | string | no | The maker's own number for the unit. |
| `createLines[].serials[].unitCost` | string (decimal) | no | The cost of this unit, in the inventory increase's currency. Defaults to the line's unitPrice. |
| `createLines[].binLocations` | array of object | no | The bins the quantity lands in, in a bin-tracked warehouse. An entry may name a batchNumber or serialNumber of its own line. |
| `createLines[].binLocations[].binLocationId` | string | yes | The unique identifier for the bin the quantity lands in. See id on GET inventory/bins/:id. |
| `createLines[].binLocations[].quantity` | string (decimal) | yes | The quantity landing in this bin, in the line's unit. |
| `createLines[].binLocations[].batchNumber` | string | no | Names one of this line's batches, when the bin entry belongs to it. A number not on the line is rejected. |
| `createLines[].binLocations[].serialNumber` | string | no | Names one of this line's serialized units, when the bin entry belongs to it. |

Example:

```json
{
  "documentDate": "2026-01-15",
  "reasonCodeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "notes": "August cycle count, recounted",
  "deleteLines": [
    "<deleteLines>"
  ],
  "updateLines": [
    {
      "id": "9b3f5a10-7c24-4e68-8d05-1f6a92b4c837",
      "quantity": "150.00",
      "batches": [
        {
          "batchNumber": "LOT-2026-08-14",
          "expirationDate": "2027-08-14",
          "quantity": "150.00"
        }
      ],
      "binLocations": [
        {
          "binLocationId": "0c7e91d3-4a58-4b26-9e10-63f8a2c5d704",
          "quantity": "150.00",
          "batchNumber": "LOT-2026-08-14"
        }
      ]
    }
  ],
  "createLines": [
    {
      "itemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "unitId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "quantity": "19.99",
      "unitPrice": "19.99",
      "notes": "<notes>",
      "batches": [
        {
          "batchNumberId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "batchNumber": "<batchNumber>",
          "manufacturerBatchNumber": "<manufacturerBatchNumber>",
          "expirationDate": "2026-01-15",
          "quantity": "19.99",
          "unitCost": "19.99"
        }
      ],
      "serials": [
        {
          "serialNumberId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "serialNumber": "<serialNumber>",
          "manufacturerSerialNumber": "<manufacturerSerialNumber>",
          "unitCost": "19.99"
        }
      ],
      "binLocations": [
        {
          "binLocationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "quantity": "19.99",
          "batchNumber": "<batchNumber>",
          "serialNumber": "<serialNumber>"
        }
      ]
    }
  ]
}
```

## Response

`200` Success

Under `data` (updateInventoryIncreaseOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the inventory increase. |
| `documentNumber` | string | no | The inventory increase's document number, for example 'INC-42'. Absent while none has been assigned. |
| `documentStatus` | string | yes | The status of the inventory increase. Possible values: 'DRAFT', 'COMMITTED', 'CANCELLED'. |
| `documentDate` | string (date) | yes | The date the inventory increase is dated. It sets the posting period. Format YYYY-MM-DD. |
| `entityId` | string | yes | The unique identifier for the legal entity the inventory increase belongs to. See id on GET base/entities. |
| `entityName` | string | no | The display name of that legal entity. |
| `locationId` | string | no | The unique identifier for the warehouse the stock is added to. One warehouse for the whole inventory increase. Absent only on a document with no lines. See id on GET inventory/warehouses/:id. |
| `locationCode` | string | no | The short code of that warehouse. |
| `locationName` | string | no | The display name of that warehouse. |
| `reasonCodeId` | string | no | The unique identifier for the reason code, when one was given. See id on GET inventory/reason-codes/:id. |
| `reasonCode` | string | no | The short code of that reason code. |
| `reasonCodeDescription` | string | no | The description of that reason code. |
| `currency` | string | no | The currency of every amount on the inventory increase. Format ISO 4217, for example 'EUR'. |
| `notes` | string | no | Free text on the inventory increase. |
| `createdDate` | string (date-time) | no | The date and time the inventory increase was created, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `lastModifiedDate` | string (date-time) | no | The date and time the inventory increase record last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `lines` | array of object | yes | The lines of the inventory increase. An inventory increase always has at least one. |
| `lines[].id` | string | yes | The unique identifier for the inventory increase line. |
| `lines[].itemId` | string | yes | The unique identifier for the item this line adds to stock. See id on GET inventory/items/:id. |
| `lines[].itemCode` | string | no | The short code of that item. |
| `lines[].itemName` | string | no | The display name of that item. |
| `lines[].unitId` | string | yes | The unique identifier for the unit the quantity is counted in. See id on GET inventory/unit-of-measures/:id. |
| `lines[].unitCode` | string | no | The short code of that unit, for example 'BOX'. |
| `lines[].quantity` | string (decimal) | yes | The quantity added, in the line's unit. |
| `lines[].inventoryQuantity` | string (decimal) | no | The same quantity in the item's stocking unit. |
| `lines[].unitPrice` | string (decimal) | no | The value of one unit, in the inventory increase's currency. |
| `lines[].notes` | string | no | Free text on the line. |
| `lines[].batches` | array of object | no | The batches making up this line's quantity, for a batch-tracked item. Absent when the item is not batch-tracked. |
| `lines[].batches[].batchNumberId` | string | no | The unique identifier for the batch record this entry created or matched. |
| `lines[].batches[].batchNumber` | string | yes | The batch number as printed, for example 'LOT-2026-08-14'. |
| `lines[].batches[].manufacturerBatchNumber` | string | no | The maker's own number for the same batch, when one was recorded. |
| `lines[].batches[].expirationDate` | string (date) | no | The expiration date of the batch. Format YYYY-MM-DD. |
| `lines[].batches[].quantity` | string (decimal) | yes | The quantity of this batch on the line, in the line's unit. |
| `lines[].batches[].inventoryQuantity` | string (decimal) | no | The same quantity in the item's stocking unit. |
| `lines[].batches[].unitCost` | string (decimal) | no | The cost of one unit of this batch, in the inventory increase's currency. |
| `lines[].serials` | array of object | no | The serialized units making up this line's quantity, one entry per unit. Absent when the item is not serialized. |
| `lines[].serials[].serialNumberId` | string | no | The unique identifier for the serial record this entry created or matched. |
| `lines[].serials[].serialNumber` | string | yes | The serial number stamped on the unit. |
| `lines[].serials[].manufacturerSerialNumber` | string | no | The maker's own number for the same unit, when one was recorded. |
| `lines[].serials[].unitCost` | string (decimal) | no | The cost of this unit, in the inventory increase's currency. |
| `lines[].binLocations` | array of object | no | The bins the quantity lands in, in a bin-tracked warehouse. Each entry that names a batchNumber or serialNumber belongs to that batch or unit, and one that names neither belongs to the line. |
| `lines[].binLocations[].binLocationId` | string | yes | The unique identifier for the bin the quantity landed in. See id on GET inventory/bins/:id. |
| `lines[].binLocations[].binLocationCode` | string | no | The short code of that bin. |
| `lines[].binLocations[].quantity` | string (decimal) | yes | The quantity landing in this bin, in the line's unit. |
| `lines[].binLocations[].inventoryQuantity` | string (decimal) | no | The same quantity in the item's stocking unit. |
| `lines[].binLocations[].batchNumber` | string | no | The batch this bin entry belongs to, when it belongs to one of the line's batches. |
| `lines[].binLocations[].serialNumber` | string | no | The serialized unit this bin entry belongs to, when it belongs to one of the line's units. |

## Response headers

- `Idempotency-Replayed` — Present and `true` only when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent as `false`.

## Errors

| Code | Status |
| --- | --- |
| `NOT_FOUND` | 400 |
| `WRONG_STATUS` | 400 |
| `REFERENCE_NOT_FOUND` | 400 |
| `NO_LINES` | 400 |
| `INVALID_QUANTITY` | 400 |
| `DUPLICATE_TRACKING_NUMBER` | 400 |
| `UNKNOWN_TRACKING_REFERENCE` | 400 |
| `POSTING_REJECTED` | 400 |
| `IDEMPOTENCY_KEY_CONFLICT` | 409 |
| `IDEMPOTENCY_PAYLOAD_MISMATCH` | 422 |

## Statuses

- `400` — Invalid request or business failure. Codes: NOT_FOUND, WRONG_STATUS, REFERENCE_NOT_FOUND, NO_LINES, INVALID_QUANTITY, DUPLICATE_TRACKING_NUMBER, UNKNOWN_TRACKING_REFERENCE, POSTING_REJECTED
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `409` — The Idempotency-Key is still being processed by another request.
- `422` — The Idempotency-Key was already used with a different request payload.
- `429` — Too many requests
- `500` — Internal server error
