# Search receipts

Operation ID: `searchReceipts`

Group: Inventory › Receipts

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

`POST /inventory/receipts/search`

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

Searches receipts. The response has each receipt in full: its lines with their batch, serial, and bin detail, and the same fields GET inventory/receipts/:id returns.

This is the only endpoint that filters by vendor, reference number, tracking number, item, or warehouse. The collection GET inventory/receipts has none of those filters and returns no lines.

## 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`: searchReceiptsInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filters` | object | yes | The filters to apply. A receipt must match every filter you send. Send an empty object to return all receipts. Example: `{"documentStatus":"DRAFT"}`. |
| `filters.documentNumber` | string | no | Limits results to the receipt with this receipt number. The match is exact. |
| `filters.documentStatus` | string | no | Limits results to receipts with this status. The match is exact. This api's own routes produce 'DRAFT' and 'COMMITTED'; 'RECEIVED', 'DELIVERED', 'PARTIALLY_INVOICED', 'INVOICED' and 'CANCELLED' are written by the receiving and invoicing processes around it. |
| `filters.entityId` | string | no | Limits results to receipts for this legal entity. |
| `filters.businessPartnerId` | string | no | Limits results to receipts from this vendor. |
| `filters.locationId` | string | no | Limits results to receipts that have a line for this warehouse. |
| `filters.itemId` | string | no | Limits results to receipts that have a line for this item. |
| `filters.referenceNumber` | string | no | The vendor's own reference, matched exactly — their delivery note number is what a buyer has in front of them. |
| `filters.trackingNumber` | string | no | The carrier's tracking number, matched exactly and case-sensitively. |
| `filters.fromDate` | date | no | Inclusive lower bound on documentDate (YYYY-MM-DD). |
| `filters.toDate` | date | no | Limits results to receipts dated on or before this date. Format YYYY-MM-DD. |
| `filters.modifiedSince` | date-time | no | Limits results to receipts changed on or after this time. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `page` | object | no | The pagination controls. Omit for the first page. |
| `page.cursor` | string | no | The cursor from the previous response's pagination.nextCursor. Omit for the first page. |
| `page.size` | number | no | The number of receipts per page. Defaults to 50. A value above 200 is treated as 200, not rejected. |

```json
{
  "filters": {
    "documentStatus": "DRAFT"
  },
  "page": {
    "cursor": "<cursor>",
    "size": 0
  }
}
```

## Response

`200` Success

Under `data` (searchReceiptsOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array<object> | yes | The receipts on this page, oldest first, each with its lines. An empty array when nothing matches. Example: `[{"id":"6a1f30c9-4d82-4b57-9e60-83c25f0a71b4","documentNumber":"GR-2291","documentStatus":"COMMITTED","documentDate":"2026-08-14","deliveryDate":"2026-08-14","entityId":"1a9c4e70-38b5-4d26-9f01-7c2e5b8a6d43","entityName":"Acme Netherlands B.V.","businessPartnerId":"b62e4f17-0c93-4a58-8d21-5f70e3b9a4c6","businessPartnerName":"Van Dijk Components B.V.","referenceNumber":"DN-77120","currency":"EUR","totalAmount":"725.00","notes":"Received at the back dock","createdDate":"2026-08-14T09:20:00.000Z","lastModifiedDate":"2026-08-14T10:05:00.000Z","lines":[{"id":"8c14a6f2-3b70-4d59-9e02-6f5a1d38b47c","lineType":"Inventory","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","quantity":"200.00","inventoryQuantity":"200.00","openQuantity":"200.00","unitPrice":"3.20","lineTotal":"640.00","sourceDocumentLineId":"551043","sourceDocumentLineType":"PurchaseOrderLine","notes":"Two pallets"},{"id":"d0a7e3b5-2f61-4c98-b704-1a5e9c86d243","lineType":"Service","serviceDescription":"Inbound freight","lineTotal":"85.00","expenseAccountId":"4b7c0e29-6d15-4830-9f42-8a3e57c1d604","expenseAccountNumber":"615200","expenseAccountName":"Inbound freight"}]}]`. |
| `items[].id` | string | yes | The unique identifier for the receipt. |
| `items[].documentNumber` | string | no | The receipt number, for example 'GR-2291'. Assigned when the receipt is created. |
| `items[].documentStatus` | string | yes | The status of the receipt. It is DRAFT when the receipt is created through this API and COMMITTED once you commit it with POST inventory/receipts/:id/commit. The receiving and invoicing processes set the other statuses. |
| `items[].documentDate` | date | yes | The date of the receipt. Format YYYY-MM-DD. |
| `items[].deliveryDate` | date | no | The date the goods arrived or are expected. Format YYYY-MM-DD. |
| `items[].entityId` | string | yes | The legal entity the receipt belongs to. |
| `items[].entityName` | string | no | The name of that legal entity. |
| `items[].businessPartnerId` | string | yes | The vendor the goods came from. |
| `items[].businessPartnerName` | string | no | The name of that vendor. |
| `items[].referenceNumber` | string | no | The vendor's own reference, typically their delivery note number. |
| `items[].trackingNumber` | string | no | The carrier's tracking number for the inbound shipment. |
| `items[].currency` | string | no | ISO 4217 code governing every amount on the document. The VENDOR's currency, which need not be the entity's functional one — see functionalUnitPrice on the line. |
| `items[].totalAmount` | decimal | no | The total value of the receipt, in the receipt's currency. |
| `items[].notes` | string | no | Free text on the receipt. |
| `items[].createdDate` | date-time | no | The date and time the receipt was created, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `items[].lastModifiedDate` | date-time | no | The date and time the receipt last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `items[].lines` | array<object> | yes | The lines of the receipt, oldest first. A receipt always has at least one line. |
| `items[].lines[].id` | string | yes | The unique identifier for the line. Use it in updateLines and deleteLines. |
| `items[].lines[].lineType` | string | no | The type of the line. Possible values: 'Inventory', 'Service', 'Expense'. Only an Inventory line moves stock. A Service or Expense line records something bought that does not enter a warehouse and has a description instead of an item. |
| `items[].lines[].itemId` | string | no | The item received. Absent on a Service or Expense line. |
| `items[].lines[].itemCode` | string | no | The short code of that item. |
| `items[].lines[].itemName` | string | no | The name of that item. |
| `items[].lines[].serviceDescription` | string | no | What a Service or Expense line is for. Absent on an Inventory line. |
| `items[].lines[].locationId` | string | no | The warehouse the goods went into. Absent on a Service or Expense line. |
| `items[].lines[].locationCode` | string | no | The short code of that warehouse. |
| `items[].lines[].locationName` | string | no | The name of that warehouse. |
| `items[].lines[].unitId` | string | no | The unit the quantity is counted in. |
| `items[].lines[].unitCode` | string | no | The short code of that unit. |
| `items[].lines[].quantity` | decimal | no | The quantity received, in the line's unit. |
| `items[].lines[].inventoryQuantity` | decimal | no | The same quantity in the item's stocking unit. |
| `items[].lines[].receivedQuantity` | decimal | no | The quantity actually received, where the receiving process records it separately. |
| `items[].lines[].openQuantity` | decimal | no | The quantity still to be invoiced. |
| `items[].lines[].returnedQuantity` | decimal | no | The quantity that has gone back on a purchase return. |
| `items[].lines[].unitPrice` | decimal | no | The price of one unit, in the receipt's currency. |
| `items[].lines[].lineTotal` | decimal | no | The total for the line, in the receipt's currency. |
| `items[].lines[].functionalUnitPrice` | decimal | no | The unit price in the entity's functional currency. Present when the receipt is in another currency. |
| `items[].lines[].functionalLineTotal` | decimal | no | The line total in the entity's functional currency. |
| `items[].lines[].expenseAccountId` | string | no | The general ledger account a Service or Expense line is charged to. Absent on an Inventory line. |
| `items[].lines[].expenseAccountNumber` | string | no | The number of that account. |
| `items[].lines[].expenseAccountName` | string | no | The name of that account. |
| `items[].lines[].status` | string | no | Where the line is in the receiving process. This is free text, with no fixed set of values. |
| `items[].lines[].sourceDocumentLineId` | string | no | The purchase order line this line was received against. It is a numeric id in string form, not a UUID. Purchase order lines are not individually addressable, so there is no endpoint that takes it. |
| `items[].lines[].sourceDocumentLineType` | any | no | The kind of source document line this receipt line was created from. One of: `"IMInventorySalesOrderLine"`, `"IMInventorySalesDeliveryLine"`, `"IMSalesOrderLine"`, `"IMInventoryPurchaseReturnLine"`, `"IMInventorySalesReturnLine"`, `"IMWarehouseTransferLine"`, `"IMInventoryDecreaseLine"`, `"IMInventoryIncreaseLine"`, `"IMInventoryRevaluationLine"`, `"IMInventoryTransferLine"`, `"IMInventoryAdjustmentLine"`, `"IMInventoryCountLine"`, `"IMInventoryPutAwayTask"`, `"IMInventoryPurchaseReturnReversal"`, `"PurchaseOrderLine"`, `"IMLandedCostAllocationLine"`, `"SalesOrderProductItem"`, `"IMWarehouseTransferOrderLine"`, `"VendorBillItemBase"`, `"InvPurchaseDeliveryLine"`. |
| `items[].lines[].notes` | string | no | Free text on the line. |
| `items[].lines[].batches` | array<object> | no | The batches received on this line, for a batch-tracked item. Absent when the item is not batch-tracked. |
| `items[].lines[].batches[].batchNumberId` | string | no | The unique identifier for the batch record this entry created or matched. |
| `items[].lines[].batches[].batchNumber` | string | yes | The batch number as printed. |
| `items[].lines[].batches[].expirationDate` | date | no | The expiration date of the batch. Format YYYY-MM-DD. |
| `items[].lines[].batches[].quantity` | decimal | yes | The quantity of this batch received, in the line's unit. |
| `items[].lines[].batches[].inventoryQuantity` | decimal | no | The same quantity in the item's stocking unit. |
| `items[].lines[].batches[].openQuantity` | decimal | no | The quantity of this batch still to be invoiced. |
| `items[].lines[].batches[].returnedQuantity` | decimal | no | The quantity of this batch that has gone back to the vendor. |
| `items[].lines[].batches[].unitCost` | decimal | no | The cost of one unit of this batch, in the receipt's currency. |
| `items[].lines[].serials` | array<object> | no | The serialized units received, one entry per unit. Absent when the item is not serialized. |
| `items[].lines[].serials[].serialNumberId` | string | no | The unique identifier for the serial record this entry created or matched. |
| `items[].lines[].serials[].serialNumber` | string | yes | The serial number as stamped on the unit. |
| `items[].lines[].serials[].openQuantity` | decimal | no | The quantity of this unit still to be invoiced. |
| `items[].lines[].serials[].returnedQuantity` | decimal | no | The quantity of this unit that has gone back to the vendor. |
| `items[].lines[].serials[].unitCost` | decimal | no | The cost of this unit, in the receipt's currency. |
| `items[].lines[].binLocations` | array<object> | no | The bins the goods went into, in a bin-tracked warehouse. One flat array per line: an entry that names a batchNumber or serialNumber belongs to that batch or unit, and one that names neither belongs to the line. |
| `items[].lines[].binLocations[].binLocationId` | string | yes | The bin the goods went into. |
| `items[].lines[].binLocations[].binLocationCode` | string | no | The short code of that bin. |
| `items[].lines[].binLocations[].quantity` | decimal | yes | The quantity put into this bin, in the line's unit. |
| `items[].lines[].binLocations[].inventoryQuantity` | decimal | no | The same quantity in the item's stocking unit. |
| `items[].lines[].binLocations[].batchNumber` | string | no | The batch this bin entry belongs to, when it belongs to one of the line's batches. |
| `items[].lines[].binLocations[].serialNumber` | string | no | The serialized unit this bin entry belongs to, when it belongs to one of the line's units. |
| `pagination` | object | yes | The pagination cursor for this page. Example: `{"hasMore":false}`. |
| `pagination.nextCursor` | string | no | The cursor for the next page. Pass it as page.cursor. Absent on the last page. |
| `pagination.hasMore` | boolean | yes | True when more receipts remain beyond this page. |

```json
{
  "data": {
    "items": [
      {
        "id": "6a1f30c9-4d82-4b57-9e60-83c25f0a71b4",
        "documentNumber": "GR-2291",
        "documentStatus": "COMMITTED",
        "documentDate": "2026-08-14",
        "deliveryDate": "2026-08-14",
        "entityId": "1a9c4e70-38b5-4d26-9f01-7c2e5b8a6d43",
        "entityName": "Acme Netherlands B.V.",
        "businessPartnerId": "b62e4f17-0c93-4a58-8d21-5f70e3b9a4c6",
        "businessPartnerName": "Van Dijk Components B.V.",
        "referenceNumber": "DN-77120",
        "currency": "EUR",
        "totalAmount": "725.00",
        "notes": "Received at the back dock",
        "createdDate": "2026-08-14T09:20:00.000Z",
        "lastModifiedDate": "2026-08-14T10:05:00.000Z",
        "lines": [
          {
            "id": "8c14a6f2-3b70-4d59-9e02-6f5a1d38b47c",
            "lineType": "Inventory",
            "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",
            "quantity": "200.00",
            "inventoryQuantity": "200.00",
            "openQuantity": "200.00",
            "unitPrice": "3.20",
            "lineTotal": "640.00",
            "sourceDocumentLineId": "551043",
            "sourceDocumentLineType": "PurchaseOrderLine",
            "notes": "Two pallets"
          },
          {
            "id": "d0a7e3b5-2f61-4c98-b704-1a5e9c86d243",
            "lineType": "Service",
            "serviceDescription": "Inbound freight",
            "lineTotal": "85.00",
            "expenseAccountId": "4b7c0e29-6d15-4830-9f42-8a3e57c1d604",
            "expenseAccountNumber": "615200",
            "expenseAccountName": "Inbound freight"
          }
        ]
      }
    ],
    "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
