# Returns the receipt with the given identifier.

`GET /inventory/receipts/{id}`

Group: Inventory › Receipts · Operation ID: `getReceipt`

Returns one receipt with all of its lines and their batch, serial and bin detail. POST inventory/receipts/search returns the same fields. The collection GET inventory/receipts returns the header only and gives lineCount in place of the lines.

Read lineType before reading a line. An Inventory line has an item, a warehouse and a quantity. A Service or Expense line has a description and an amount and none of the rest.

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

## 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`. |
| `id` | path | string | yes | The unique identifier for the receipt to return. |

## Response

`200` Success

Under `data` (getReceiptOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the receipt. |
| `documentNumber` | string | no | The receipt number, for example 'GR-2291'. Assigned when the receipt is created. |
| `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. |
| `documentDate` | string (date) | yes | The date of the receipt. Format YYYY-MM-DD. |
| `deliveryDate` | string (date) | no | The date the goods arrived or are expected. Format YYYY-MM-DD. |
| `entityId` | string | yes | The legal entity the receipt belongs to. |
| `entityName` | string | no | The name of that legal entity. |
| `businessPartnerId` | string | yes | The vendor the goods came from. |
| `businessPartnerName` | string | no | The name of that vendor. |
| `referenceNumber` | string | no | The vendor's own reference, typically their delivery note number. |
| `currency` | string | no | The currency of the receipt's amounts. Format ISO 4217, for example 'EUR'. This is the vendor's currency, which need not be the entity's functional currency. See functionalUnitPrice on the line for the functional-currency amounts. |
| `totalAmount` | string (decimal) | no | The total value of the receipt, in the receipt's currency. |
| `notes` | string | no | Free text on the receipt. |
| `createdDate` | string (date-time) | no | The date and time the receipt was created, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `lastModifiedDate` | string (date-time) | no | The date and time the receipt last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `lines` | array of object | yes | The lines of the receipt, oldest first. A receipt always has at least one line. |
| `lines[].id` | string | yes | The unique identifier for the line. Use it in updateLines and deleteLines. |
| `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. |
| `lines[].itemId` | string | no | The item received. Absent on a Service or Expense line. |
| `lines[].itemCode` | string | no | The short code of that item. |
| `lines[].itemName` | string | no | The name of that item. |
| `lines[].serviceDescription` | string | no | What a Service or Expense line is for. Absent on an Inventory line. |
| `lines[].locationId` | string | no | The warehouse the goods went into. Absent on a Service or Expense line. |
| `lines[].locationCode` | string | no | The short code of that warehouse. |
| `lines[].locationName` | string | no | The name of that warehouse. |
| `lines[].unitId` | string | no | The unit the quantity is counted in. |
| `lines[].unitCode` | string | no | The short code of that unit. |
| `lines[].quantity` | string (decimal) | no | The quantity received, in the line's unit. |
| `lines[].inventoryQuantity` | string (decimal) | no | The same quantity in the item's stocking unit. |
| `lines[].receivedQuantity` | string (decimal) | no | The quantity actually received, where the receiving process records it separately. |
| `lines[].openQuantity` | string (decimal) | no | The quantity still to be invoiced. |
| `lines[].returnedQuantity` | string (decimal) | no | The quantity that has gone back on a purchase return. |
| `lines[].unitPrice` | string (decimal) | no | The price of one unit, in the receipt's currency. |
| `lines[].lineTotal` | string (decimal) | no | The total for the line, in the receipt's currency. |
| `lines[].functionalUnitPrice` | string (decimal) | no | The unit price in the entity's functional currency. Present when the receipt is in another currency. |
| `lines[].functionalLineTotal` | string (decimal) | no | The line total in the entity's functional currency. |
| `lines[].expenseAccountId` | string | no | The GL account a Service or Expense line is charged to. Absent on an Inventory line. |
| `lines[].expenseAccountNumber` | string | no | The number of that account. |
| `lines[].expenseAccountName` | string | no | The name of that account. |
| `lines[].status` | string | no | Where the line is in the receiving process. This is free text, with no fixed set of values. |
| `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. |
| `lines[].sourceDocumentLineType` | string, one of `"IMInventorySalesOrderLine"`, `"IMInventorySalesDeliveryLine"`, `"IMSalesOrderLine"`, `"IMInventoryPurchaseReturnLine"`, `"IMInventorySalesReturnLine"`, `"IMWarehouseTransferLine"`, `"IMInventoryDecreaseLine"`, `"IMInventoryIncreaseLine"`, `"IMInventoryRevaluationLine"`, `"IMInventoryTransferLine"`, `"IMInventoryAdjustmentLine"`, `"IMInventoryCountLine"`, `"IMInventoryPutAwayTask"`, `"IMInventoryPurchaseReturnReversal"`, `"PurchaseOrderLine"`, `"IMLandedCostAllocationLine"`, `"SalesOrderProductItem"`, `"IMWarehouseTransferOrderLine"`, `"VendorBillItemBase"`, `"InvPurchaseDeliveryLine"` | no | The kind of source document line this receipt line was created from. |
| `lines[].notes` | string | no | Free text on the line. |
| `lines[].batches` | array of object | no | The batches received on this line, 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. |
| `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 received, in the line's unit. |
| `lines[].batches[].inventoryQuantity` | string (decimal) | no | The same quantity in the item's stocking unit. |
| `lines[].batches[].openQuantity` | string (decimal) | no | The quantity of this batch still to be invoiced. |
| `lines[].batches[].returnedQuantity` | string (decimal) | no | The quantity of this batch that has gone back to the vendor. |
| `lines[].batches[].unitCost` | string (decimal) | no | The cost of one unit of this batch, in the receipt's currency. |
| `lines[].serials` | array of object | no | The serialized units received, 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 as stamped on the unit. |
| `lines[].serials[].openQuantity` | string (decimal) | no | The quantity of this unit still to be invoiced. |
| `lines[].serials[].returnedQuantity` | string (decimal) | no | The quantity of this unit that has gone back to the vendor. |
| `lines[].serials[].unitCost` | string (decimal) | no | The cost of this unit, in the receipt's currency. |
| `lines[].binLocations` | array of 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. |
| `lines[].binLocations[].binLocationId` | string | yes | The bin the goods went into. |
| `lines[].binLocations[].binLocationCode` | string | no | The short code of that bin. |
| `lines[].binLocations[].quantity` | string (decimal) | yes | The quantity put into 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. |

## Errors

| Code | Status |
| --- | --- |
| `NOT_FOUND` | 400 |

## Statuses

- `400` — Invalid request or business failure. Codes: NOT_FOUND
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests
- `500` — Internal server error
