ERPNext serial and batch tracking is built into the free Stock module: flip "Has Serial No" or "Has Batch No" on an item, and ERPNext then records the exact serial or lot at every receipt, transfer, and dispatch. Batches carry expiry dates and dispatch expiry-first (FEFO); serials give per-unit history for warranty and recalls. No add-on licence is required.
Short answer
To set up serial and batch tracking in ERPNext, open the Item master, tick "Has Serial No" for unit-level tracking or "Has Batch No" for lot-level tracking, then let ERPNext auto-generate numbers from a series. Batches accept an expiry date and shelf life, so ERPNext blocks expired stock and picks the nearest-to-expiry batch first. All of this ships free under GPLv3.
I am Manoj, an ERPNext implementation consultant at Mith Tech in Bengaluru, and traceability is the feature Indian pharma, food, and electronics buyers ask me about first. Serial and batch tracking looks like two checkboxes, but the decisions behind them are hard to reverse. Honestly, the most expensive traceability mistakes I fix are not wrong settings — they are items that went live with tracking switched off, then could not be corrected without recreating the item.
What is serial and batch tracking in ERPNext?
Serial and batch tracking are two optional, per-item settings inside the ERPNext Stock module that attach identity to inventory. A serial number pins down one individual unit and follows it through its whole life. A batch groups many interchangeable units that were made or received together, under one lot identifier with a shared expiry date.
Both features answer the same audit question — "where did this exact stock come from and go?" — at different resolutions. Once you enable either, ERPNext prompts for the serial or batch at every relevant document: purchase receipt, delivery note, stock entry, and manufacturing consumption. Because stock and accounting share one ledger, that identity travels with the value, giving regulated businesses the paper trail they are required to keep. For the wider context of how stock documents behave, my ERPNext inventory management guide covers the transaction model this sits on top of.
Skimmable summary: Serials track individual units, batches track lots — both add auditable identity to every stock movement in the free Stock module.
Serial numbers vs batch numbers: which should you use?
Choosing between serials and batches comes down to whether units are individually identifiable or interchangeable. Serial numbers fit high-value, warranty-bound goods where you need per-unit history. Batches fit anything produced or received in lots that share an expiry or manufacturing run. Some items even use both together — a serialised device built from batch-tracked components.
| Factor | Serial numbers | Batch numbers |
|---|---|---|
| Granularity | One unit = one number | Many units = one lot |
| Best for | Machinery, electronics, instruments | Pharma, food, chemicals, textiles |
| Warranty / AMC | Per-unit tracking supported | Not unit-specific |
| Expiry handling | Not the primary purpose | Core strength (expiry + shelf life) |
| Data entry effort | Higher (every unit) | Lower (per lot) |
| Recall precision | Exact unit | Whole affected lot |
The honest trade-off is effort versus precision. Serialising fast-moving, low-value stock buries your team in data entry for traceability nobody will ever query. Batching a unique high-value machine loses the per-unit warranty history you actually need. Match the method to how the goods are recalled, warrantied, and audited — not to a blanket policy.
Skimmable summary: Use serials for individually identifiable, warranty-bound units; use batches for lot-grouped goods with expiry; combine them only when the product genuinely needs both.
How do you set up serial number tracking in ERPNext?
Serial number setup happens on the Item master before any stock exists for that item. Enabling "Has Serial No" tells ERPNext to demand a serial at every inward and outward movement. Add a serial number series and ERPNext auto-generates the numbers, so your team never types them by hand during receipts.
Open the Item and enable serials
Go to the Item master, open the Inventory section, and tick "Has Serial No". Do this while the item has zero stock transactions — ERPNext will not let you enable it once stock has moved.
Define a serial number series
Set a "Serial No Series" on the item, for example a pattern like MACH-.#####. Leave the serial field blank on transactions and ERPNext fills the next number from this series automatically.
Receive stock and generate serials
On a Purchase Receipt or Stock Entry, use the generate option so ERPNext creates one Serial No record per unit received. Each serial now exists as its own document with a status and location.
Dispatch and trace
On a Delivery Note, pick the specific serials leaving the warehouse. ERPNext defaults to selecting serials on a first-in, first-out basis, and the unit's full movement history stays queryable for warranty or recall.
Serial status is your warranty backbone
Each Serial No record holds warranty and AMC dates, purchase details, and current location. For electronics and machinery businesses, that record is often more valuable than the stock quantity itself when a customer calls about a failed unit.
Skimmable summary: Tick "Has Serial No" on a zero-stock item, attach a series for auto-numbering, generate serials at receipt, and pick specific units at dispatch.
How do you set up batch tracking with expiry dates?
Batch setup also lives on the Item master and, like serials, must be enabled before any transaction. Ticking "Has Batch No" reveals batch options including expiry handling and sample retention. For perishables and regulated goods, the two fields that matter most are automatic batch creation and shelf life, which together drive expiry control.
Enable batches on the Item
In the Item master, tick "Has Batch No" while the item still has no stock transactions. This exposes the batch-related fields, including expiry and shelf life.
Turn on automatic batch creation
Enable "Automatically Create New Batch" and set a batch number series, for example BATCH-.#####. ERPNext then mints a fresh batch number whenever inward stock has no batch specified.
Set shelf life for expiry
Enter "Shelf Life In Days" on the item — the number of days a batch stays usable after manufacture. ERPNext uses this to derive the expiry date on each new batch, so you set the rule once instead of typing dates per lot.
Record manufacturing and expiry dates
At receipt or production, capture the manufacturing date on the Batch. ERPNext calculates or accepts the expiry date, and from then on the batch is flagged as not-expired until that date passes.
For batch-tracked raw materials feeding production, the same identity flows into your Work Orders and consumption entries — a link I explore in the ERPNext manufacturing guide for India.
Skimmable summary: Enable "Has Batch No" on a fresh item, switch on automatic batch creation with a series, and set shelf life so ERPNext derives expiry dates for every lot.
How does ERPNext handle expiry and FEFO dispatch?
Expiry control is where batch tracking earns its keep. Once a batch carries an expiry date, ERPNext compares it against each transaction's posting date and refuses to dispatch stock from an expired batch. When you leave the batch blank on a delivery, ERPNext selects the batch nearest to expiry first — the First-Expiry-First-Out (FEFO) logic that keeps perishable stock rotating correctly.
That single behaviour removes a whole class of manual errors. Nobody has to eyeball a shelf and guess which lot to ship; the system biases dispatch toward the oldest usable stock and hard-stops anything past its date. In Pick List operations, the same expiry-first priority carries through, so warehouse staff are guided to the right batch without cross-checking a separate expiry register.
Expiry only works if the date is set
If a batch has no expiry date, ERPNext treats it as "not set" and will not block or prioritise it. For pharma and food, make expiry mandatory in your process — either via shelf life on the item or a required manufacturing date at receipt — so no lot slips through undated.
FEFO is not a report you run — it is a default that quietly prevents the expired-goods dispatch that would otherwise cost you an audit finding.
Skimmable summary: ERPNext blocks expired batches and dispatches nearest-to-expiry first (FEFO) automatically, provided every batch actually carries an expiry date.
Serial and batch tracking for pharma, food, and electronics
Industry fit is what turns two checkboxes into a compliance backbone. Pharma and food lean on batch tracking for expiry, recall, and lot genealogy; electronics and machinery lean on serials for warranty and per-unit history. ERPNext supports both natively, which is why open-source ERP has become a realistic option for regulated Indian manufacturers.
Pharma & nutraceuticals
Batch tracking with mandatory expiry, shelf life, and FEFO dispatch supports lot recall and audit trails. Backward tracing shows which raw-material batches went into a finished lot. My deeper write-up on open-source ERP for pharma manufacturing covers the compliance angle.
Food & FMCG
Perishable goods need rotation, not guesswork. Automatic batch creation, expiry dates, and expiry-first dispatch keep near-date stock moving and stop expired product reaching customers.
Electronics & machinery
Serial numbers give each unit a warranty record, AMC schedule, and full movement history — essential when a customer reports a fault and you need the exact purchase and service trail.
Traceability reports tie it together. Newer ERPNext releases include a serial and batch traceability view that traces backward — which components and lots built a product — and forward, to every customer or location a batch reached. That is the report a recall or audit actually depends on.
Skimmable summary: Batches serve pharma and food expiry compliance; serials serve electronics and machinery warranty; traceability reports link raw lots to finished units in both directions.
Common setup mistakes and the Serial and Batch Bundle change
The single most common mistake is enabling tracking too late. ERPNext deliberately blocks turning on "Has Serial No" or "Has Batch No" once any stock transaction exists for the item, to protect ledger integrity. Recovering means deleting every stock transaction for that item or duplicating it as a new tracked item and re-inwarding — both painful after go-live.
A second point that trips up teams upgrading from older versions: how transactions store serials and batches changed. From v15 onward, ERPNext replaced the old free-text serial and batch fields with a dedicated Serial and Batch Bundle document. Each transaction gets its own bundle listing the serials or batches involved, and a bundle cannot be reused across transactions. The current line — ERPNext v16, released in January 2026 — carries this forward, and it also lets you enable the serial-and-batch feature for an item from Stock Settings. The change fixed real data-integrity problems from the old text fields, but it does mean scripts and reports written against the pre-v15 fields need updating.
Decide tracking during setup, not after
Before any item goes live, ask one question: will this ever need recall, expiry, or warranty tracing? If yes, enable serials or batches now. Retrofitting tracking onto an item with live stock is the costliest inventory rework I get called in to untangle.
Skimmable summary: Enable tracking before transactions exist, and know that v15 and v16 record serials and batches through a per-transaction Serial and Batch Bundle rather than free-text fields.
Frequently asked questions
Can I enable serial or batch tracking after stock already exists?
No. ERPNext blocks enabling "Has Serial No" or "Has Batch No" once any stock transaction exists for that item, to keep the ledger consistent. Your options are to delete all stock transactions for the item, or duplicate it as a new item with tracking on and re-inward the stock. Decide during setup instead.
Is serial and batch tracking free in ERPNext?
Yes. Serial and batch tracking is part of the core Stock module, and ERPNext is free and open source under GPLv3. There is no add-on licence, per-item charge, or premium tier for traceability. Hosting and implementation have costs, but the tracking capability itself ships in the free product.
Can one item use both serial numbers and batches?
Yes. An item can have both "Has Serial No" and "Has Batch No" enabled — useful when you build a serialised finished unit from batch-tracked components, or when a lot needs both an expiry and per-unit identity. Expect more data entry, so use the combination only when the product genuinely requires unit-level and lot-level tracing.
How does ERPNext choose which batch to dispatch?
ERPNext dispatches batches on a First-Expiry-First-Out basis. When the batch is left blank on an outward transaction, the system selects the batch nearest to expiry first and refuses any batch already past its expiry date, compared against the transaction's posting date. This keeps perishable stock rotating without manual checking.
What is the Serial and Batch Bundle in ERPNext?
The Serial and Batch Bundle is a document, introduced in v15, that records which serial numbers or batches are involved in a single stock transaction. It replaced the older free-text fields that caused data-integrity issues. Each transaction gets its own bundle, and a bundle cannot be shared across transactions.
Which version of ERPNext should I use for traceability?
Use a currently supported release. ERPNext v16 became production-ready in January 2026 and carries the Serial and Batch Bundle model along with performance improvements. If you are on an older version, plan the upgrade path carefully, since the way serials and batches are stored changed at v15.
About the author
I am Manoj, an ERPNext implementation consultant at Mith Tech, an independent open-source ERPNext and Frappe studio based in Bengaluru. I help Indian SMBs — including pharma, food, and electronics manufacturers — set up traceability, inventory, and compliance workflows on ERPNext. Mith Tech works only with open-source ERPNext and the Frappe platform, so the guidance here reflects real implementations, not vendor marketing.