# Get Batch Transaction

`GET /inventory/batch-transactions/{id}`

Group: Inventory › Batch Transactions · Operation ID: `getBatchTransaction`

Returns the batch transaction with the given identifier. Use the batch line's identifier, not the ledger row's.

Returns the same fields as GET inventory/batch-transactions and POST inventory/batch-transactions/search. The id is the batch line's, not the ledger row's, and passing a ledger row's identifier returns NOT_FOUND. See transactionId for the ledger row, whose full detail is on GET inventory/inventory-transactions/:id.

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

## 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 batch transaction line to return. Use the batch line's identifier, not the ledger row's. |

## Response

`200` Success

Under `data` (getBatchTransactionOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the batch transaction line, not the ledger row. The ledger row's identifier is transactionId. |
| `batchNumberId` | string | yes | The unique identifier for the batch that moved. See id on GET inventory/batch-numbers/:id. |
| `batchNumber` | string | no | The batch number as printed on the label, for example 'LOT-2026-08-14'. It is not unique across items. |
| `expirationDate` | string (date) | no | The date the batch expires. Format YYYY-MM-DD. |
| `transactionId` | string | no | The unique identifier for the ledger row this batch line belongs to. See id on GET inventory/inventory-transactions/:id. |
| `itemId` | string | no | The unique identifier for the item. See id on GET inventory/items/:id. |
| `itemCode` | string | no | The code of the item. |
| `itemName` | string | no | The display name of the item. |
| `locationId` | string | no | The unique identifier for the warehouse the movement was at. See id on GET inventory/warehouses/:id. |
| `locationCode` | string | no | The code of that warehouse. |
| `locationName` | string | no | The display name of that warehouse. |
| `unitId` | string | no | The unique identifier for the unit the movement was recorded in. See id on GET inventory/unit-of-measures/:id. |
| `unitCode` | string | no | The code of that unit, for example 'BOX'. |
| `transactionDate` | string (date) | no | The date the movement was posted. Format YYYY-MM-DD. |
| `inQuantity` | string (decimal) | no | The quantity of this batch that moved into stock, in the item's stocking unit. |
| `outQuantity` | string (decimal) | no | The quantity of this batch that moved out of stock, in the item's stocking unit. |
| `unitInQuantity` | string (decimal) | no | The same inbound movement in the transaction's own unit. |
| `unitOutQuantity` | string (decimal) | no | The same outbound movement in the transaction's own unit. |
| `cost` | string (decimal) | no | The unit cost of the batch at this movement, in the currency named by currency. |
| `valueDelta` | string (decimal) | no | The change in the batch's carried value at this movement, in the currency named by currency. |
| `currency` | string | no | The currency the cost fields are stated in. Format ISO 4217, for example 'USD'. |
| `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 document line that produced the movement. |
| `lastModifiedDate` | string (date-time) | no | The date and time the batch line last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |

## 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
