# Create Batch

**POST** `/v1/inventory/batches`

Receives stock into inventory as a new batch (or increments an existing batch if the same `listing_id` + `location_id` + `lot_number` already exists). Also creates an immutable `receive` movement in the ledger.

Use this endpoint when receiving stock outside of a Purchase Order. For PO-based receiving, use `POST /v1/inventory/purchase-orders/:po_id/receive` instead.

### Request fields

| Field | Type | Required | Description |
|---|---|---|---|
| `listing_id` | integer | Yes | ID of the listing being received |
| `location_id` | integer | Yes | ID of the destination location |
| `quantity` | integer | Yes | Number of units received |
| `lot_number` | string | No | Supplier lot/batch code |
| `expiry_date` | date | No | Expiry date in `YYYY-MM-DD` format |

### Response fields

| Field | Type | Description |
|---|---|---|
| `batch` | object | The created or updated batch object |

> **Note:** If a batch with the same `listing_id`, `location_id`, and `lot_number` already exists, the `quantity` is incremented rather than creating a duplicate.
