# Search inventory transactions

Operation ID: `searchInventoryTransactions`

Group: Inventory › Inventory Transactions

[Open in the interactive reference](https://docs.api.lensing.ai/lensing/v1/endpoints/searchInventoryTransactions)

`POST /inventory/inventory-transactions/search`

Read-only: A read that takes its filters in the body. Changes nothing, and ignores Idempotency-Key.

Searches inventory transactions. Results are in the order the inventory transactions were created, not in order of `transactionDate`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · 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`. |

## Request body

Required, `application/json`: searchInventoryTransactionsInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filters` | object | yes | The filters to apply. An inventory transaction must match every filter you send. Send an empty object to return all inventory transactions. Example: `{"itemId":"5f21c8b0-9d34-4a76-8e12-04b93c7de5a8","fromDate":"2026-08-01","toDate":"2026-08-31"}`. |
| `filters.itemId` | string | no | Limits results to inventory transactions for the item with this unique identifier. Format: UUID. See `id` on GET inventory/items/:id (getItem). |
| `filters.locationId` | string | no | Limits results to inventory transactions for the warehouse with this unique identifier. Format: UUID. See `id` on GET inventory/warehouses/:id (getWarehouse). |
| `filters.fromDate` | date | no | Limits results to inventory transactions with a `transactionDate` on or after this date. Format: YYYY-MM-DD. |
| `filters.toDate` | date | no | Limits results to inventory transactions with a `transactionDate` on or before this date. Format: YYYY-MM-DD. |
| `filters.sourceDocumentLineType` | any | no | Limits results to inventory transactions from this type of document line. One of: `"IMInventorySalesOrderLine"`, `"IMInventorySalesDeliveryLine"`, `"IMSalesOrderLine"`, `"IMInventoryPurchaseReturnLine"`, `"IMInventorySalesReturnLine"`, `"IMWarehouseTransferLine"`, `"IMInventoryDecreaseLine"`, `"IMInventoryIncreaseLine"`, `"IMInventoryRevaluationLine"`, `"IMInventoryTransferLine"`, `"IMInventoryAdjustmentLine"`, `"IMInventoryCountLine"`, `"IMInventoryPutAwayTask"`, `"IMInventoryPurchaseReturnReversal"`, `"PurchaseOrderLine"`, `"IMLandedCostAllocationLine"`, `"SalesOrderProductItem"`, `"IMWarehouseTransferOrderLine"`, `"VendorBillItemBase"`, `"InvPurchaseDeliveryLine"`. |
| `filters.isReturn` | boolean | no | Limits results to inventory transactions from sales returns and purchase returns when true, and to all other inventory transactions when false. |
| `filters.modifiedSince` | date-time | no | Limits results to inventory transactions whose `lastModifiedDate` is on or after this time. Format: YYYY-MM-DDTHH:mm:ss.sssZ. |
| `page` | object | no | The page to return and its size. Omit to get the first page at the default size. Example: `{"size":50}`. |
| `page.cursor` | string | no | The cursor from the previous response's `pagination.nextCursor`. Send it exactly as you received it. Omit on the first request. |
| `page.size` | number | no | The number of inventory transactions per page, from 1 to 200. Defaults to 50. A value above 200 is treated as 200, not rejected. |

```json
{
  "filters": {
    "itemId": "5f21c8b0-9d34-4a76-8e12-04b93c7de5a8",
    "fromDate": "2026-08-01",
    "toDate": "2026-08-31"
  },
  "page": {
    "size": 50
  }
}
```

## Response

`200` Success

Under `data` (searchInventoryTransactionsOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array<object> | yes | The matching inventory transactions in this response. When more inventory transactions match than fit in one response, use `pagination` to get the rest. Empty when nothing matches. Example: `[{"id":"3a7c1f95-04eb-4d62-8917-5c0e2b8d4a63","itemId":"5f21c8b0-9d34-4a76-8e12-04b93c7de5a8","itemCode":"WIDGET-01","itemName":"Standard widget","locationId":"e1d84c07-5b39-4a26-9f70-2c8b613ad495","locationCode":"WH-01","locationName":"Rotterdam Distribution Centre","unitId":"3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45","unitCode":"EA","unitName":"Each","transactionDate":"2026-08-03","inQuantity":"500.00","outQuantity":"0.00","unitInQuantity":"500.00","unitCost":"3.75","totalCost":"1875.00","currency":"EUR","sourceDocumentLineType":"InvPurchaseDeliveryLine","isReturn":false,"isPriceDiff":false,"lastModifiedDate":"2026-08-03T11:15:00.000Z"}]`. |
| `items[].id` | string | yes | The unique identifier for the inventory transaction. Format: UUID. |
| `items[].itemId` | string | yes | The unique identifier of the item. Format: UUID. See `id` on GET inventory/items/:id (getItem). |
| `items[].itemCode` | string | no | The code of the item in `itemId`. |
| `items[].itemName` | string | no | The name of the item in `itemId`. |
| `items[].locationId` | string | yes | The unique identifier of the warehouse. Format: UUID. See `id` on GET inventory/warehouses/:id (getWarehouse). |
| `items[].locationCode` | string | no | The code of the warehouse in `locationId`. |
| `items[].locationName` | string | no | The name of the warehouse in `locationId`. |
| `items[].unitId` | string | no | The unique identifier of the unit of measure the inventory transaction was recorded in. Format: UUID. For receipts, shipments, and warehouse transfers, it is the unit on the document line. For inventory increases, inventory decreases, and inventory revaluations, it is the item's stocking unit. See `id` on GET inventory/unit-of-measures/:id (getUnitOfMeasure). |
| `items[].unitCode` | string | no | The code of the unit of measure in `unitId`. |
| `items[].unitName` | string | no | The name of the unit of measure in `unitId`. |
| `items[].transactionDate` | date | yes | The date the stock came in or went out, or its value changed. Format: YYYY-MM-DD. |
| `items[].inQuantity` | decimal | yes | The quantity that this inventory transaction brought into stock, in the item's stocking unit. It is 0 when the inventory transaction takes stock out or changes only the value of the stock. |
| `items[].outQuantity` | decimal | no | The quantity that this inventory transaction took out of stock, in the item's stocking unit. It is 0 when the inventory transaction brings stock in or changes only the value of the stock. |
| `items[].unitInQuantity` | decimal | no | The quantity that this inventory transaction brought into stock, in the unit of measure named by `unitId`. It can differ from `inQuantity`, which is in the item's stocking unit. |
| `items[].unitOutQuantity` | decimal | no | The quantity that this inventory transaction took out of stock, in the unit of measure named by `unitId`. It can differ from `outQuantity`, which is in the item's stocking unit. |
| `items[].unitCost` | decimal | no | The cost of one unit of the item, in the item's stocking unit and in the currency named by `currency`. When stock goes out, it is the item's cost at that time, from its valuation method. |
| `items[].totalCost` | decimal | no | The total cost of the stock that this inventory transaction brought in or took out, in the currency named by `currency`. It is positive whichever way the stock moved, so use `inQuantity` and `outQuantity` to tell the direction. On an inventory revaluation, it is the change in the value of the stock: a positive amount raises the value and a negative amount lowers it. |
| `items[].salesAmount` | decimal | no | The total selling price of the stock on the shipment line, in the currency named by `currency`. It is the line's unit price multiplied by the quantity. Only inventory transactions created by shipments have it. |
| `items[].currency` | string | no | The currency that `unitCost`, `totalCost`, and `salesAmount` are in. Format: ISO 4217, for example 'USD'. |
| `items[].sourceDocumentLineType` | any | no | The type of document line the inventory transaction came from. One of: `"IMInventorySalesOrderLine"`, `"IMInventorySalesDeliveryLine"`, `"IMSalesOrderLine"`, `"IMInventoryPurchaseReturnLine"`, `"IMInventorySalesReturnLine"`, `"IMWarehouseTransferLine"`, `"IMInventoryDecreaseLine"`, `"IMInventoryIncreaseLine"`, `"IMInventoryRevaluationLine"`, `"IMInventoryTransferLine"`, `"IMInventoryAdjustmentLine"`, `"IMInventoryCountLine"`, `"IMInventoryPutAwayTask"`, `"IMInventoryPurchaseReturnReversal"`, `"PurchaseOrderLine"`, `"IMLandedCostAllocationLine"`, `"SalesOrderProductItem"`, `"IMWarehouseTransferOrderLine"`, `"VendorBillItemBase"`, `"InvPurchaseDeliveryLine"`. |
| `items[].isReturn` | boolean | no | Whether the inventory transaction comes from a sales return or a purchase return, including the inventory transactions created when a return is canceled. |
| `items[].isPriceDiff` | boolean | no | Whether the inventory transaction changes only the value of stock, without moving any, such as an inventory revaluation or a landed cost. |
| `items[].lastModifiedDate` | date-time | no | The date and time the inventory transaction last changed, in UTC. Format: YYYY-MM-DDTHH:mm:ss.sssZ. Changes to the item, warehouse, or unit of measure do not update this field. |
| `pagination` | object | yes | Whether there are more results than are in this response, and the cursor you use to get the next ones. Example: `{"hasMore":false}`. |
| `pagination.nextCursor` | string | no | The cursor that marks where this response stopped. To get the next results, send it as `page.cursor` in your next request. Absent when there are no more results. |
| `pagination.hasMore` | boolean | yes | Whether there are more results than are in this response. |

```json
{
  "data": {
    "items": [
      {
        "id": "3a7c1f95-04eb-4d62-8917-5c0e2b8d4a63",
        "itemId": "5f21c8b0-9d34-4a76-8e12-04b93c7de5a8",
        "itemCode": "WIDGET-01",
        "itemName": "Standard widget",
        "locationId": "e1d84c07-5b39-4a26-9f70-2c8b613ad495",
        "locationCode": "WH-01",
        "locationName": "Rotterdam Distribution Centre",
        "unitId": "3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45",
        "unitCode": "EA",
        "unitName": "Each",
        "transactionDate": "2026-08-03",
        "inQuantity": "500.00",
        "outQuantity": "0.00",
        "unitInQuantity": "500.00",
        "unitCost": "3.75",
        "totalCost": "1875.00",
        "currency": "EUR",
        "sourceDocumentLineType": "InvPurchaseDeliveryLine",
        "isReturn": false,
        "isPriceDiff": false,
        "lastModifiedDate": "2026-08-03T11:15:00.000Z"
      }
    ],
    "pagination": {
      "hasMore": false
    }
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Statuses

- `400` — Invalid request or business failure
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
