Skip to main content

ERPNext how-to & fixes

ERPNext Serial & Batch Tracking: Setup Guide (2026)

ERPNext serial and batch tracking step by step: serials vs batches, expiry dates, expiry-first picking, the v16 switch and traceability for recalls.

Updated 12 Oct 20269 min readBy ManojFirst published 20 Jul 2026

ERPNext serial and batch tracking is built into the Stock module: tick "Has Serial No" or "Has Batch No" on an item, and ERPNext records the exact serial or lot at every receipt, transfer and dispatch. Batches carry expiry dates and, once you set picking to "Expiry", go out expiry-first (FEFO); serials give per-unit history for warranty and recalls. No add-on licence is needed.

Short answer

Open the Item master and tick "Has Serial No" for unit-level tracking or "Has Batch No" for lot-level tracking, then let ERPNext generate numbers from a series. On v16, first turn on "Activate Serial / Batch No for Item" in Stock Settings. Batches take an expiry date and shelf life, so ERPNext blocks expired stock; set "Pick Serial / Batch Based On" to "Expiry" in Stock Settings to pick the nearest-to-expiry batch first (the default is FIFO). All of it ships free under GPLv3.

I lead ERPNext and Frappe implementations at MithTech, a team of Frappe specialists in Bengaluru. Traceability is the feature 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. The most expensive traceability mistakes I fix are not wrong settings; they are items that went live with tracking switched off and 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.

Serial numbers or 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 use both: a serialised device built from batch-tracked components.

GranularityOne unit = one numberMany units = one lot
Best forMachinery, electronics, instrumentsPharma, food, chemicals, textiles
Warranty / AMCPer-unit tracking supportedNot unit-specific
Expiry handlingNot the primary purposeCore strength (expiry + shelf life)
Data entry effortHigher (every unit)Lower (per lot)
Recall precisionExact unitWhole affected lot

The trade-off is effort against 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 generates the numbers, so your team never types them during receipts.

1

On v16, activate serial and batch numbers

Open Stock Settings → Serial & Batch Item and tick "Activate Serial / Batch No for Item". It is off by default on new v16 sites (an upgrade patch turns it on for sites that already have serials or batches); without it, ticking "Has Serial No" fails with "Cannot enable Has Serial No as Activate Serial / Batch No for Item is disabled".

2

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 no submitted stock transactions; ERPNext will not let you change it once stock has moved.

3

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.

4

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.

5

Dispatch and trace

On a Delivery Note, pick the specific serials leaving the warehouse. ERPNext selects serials first-in, first-out by default ("Pick Serial / Batch Based On" in Stock Settings), and the unit's movement history stays queryable for warranty or recall.

Skimmable summary: on v16 activate serial/batch in Stock Settings, tick "Has Serial No" on an item with no stock, attach a series, 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 (on v16, after the same Stock Settings switch). 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.

1

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.

2

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.

3

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.

4

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, covered 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 with each transaction's posting date and refuses to dispatch stock from an expired batch. Which batch it picks when you leave the batch blank depends on Stock Settings → Pick Serial / Batch Based On: FIFO (the default), LIFO or Expiry. Set it to Expiry and ERPNext picks the batch nearest to expiry first, the First-Expiry-First-Out (FEFO) rule that keeps perishable stock rotating.

With that set, nobody has to eyeball a shelf and guess which lot to ship: the system picks the usable batch that expires soonest and stops anything past its date. Pick Lists follow the same setting, so warehouse staff are guided to the right batch without a separate expiry register.

FEFO is not a report you run. It is one setting that quietly prevents the expired-goods dispatch that would otherwise cost you an audit finding.

Manoj — ERPNext implementation lead, MithTech

Skimmable summary: ERPNext blocks expired batches; set picking to "Expiry" for FEFO, and make sure every batch carries an expiry date.

How does serial and batch tracking work 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 as standard, which is part of why open-source ERP is 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 picking 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, which you need when a customer reports a fault and you want the exact purchase and service trail.

Traceability reports tie it together. ERPNext v16 adds a Serial & Batch Traceability report that traces backward (which components and lots built a product) and forward (every customer or location a batch reached). That is the report a recall or audit 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.

What are the common setup mistakes, and what changed with the Serial and Batch Bundle?

The single most common mistake is enabling tracking too late. ERPNext blocks changing "Has Serial No" or "Has Batch No" once submitted stock transactions exist for the item, to protect ledger integrity. Recovering means cancelling every stock transaction for that item, or creating a new tracked item and moving the stock to it; both are 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. With "Use Serial / Batch Fields" ticked in Stock Settings, users can still type the serial or batch on the row and ERPNext builds the bundle on submit. ERPNext v16 (January 2026) keeps the bundle model and adds the Stock Settings switch that must be on before items can be serialised or batched. The change fixed real data-integrity problems with the old text fields, but scripts and reports written against the pre-v15 fields need updating.

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 changing "Has Serial No" or "Has Batch No" once submitted stock transactions exist for that item, to keep the ledger consistent. Your options are to cancel all stock transactions for the item, or create a new item with tracking on and move the stock to it. 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?

It follows Stock Settings → Pick Serial / Batch Based On: FIFO by default, or LIFO or Expiry. With Expiry, a blank batch on an outward transaction picks the batch nearest to expiry first (FEFO). Either way, a batch already past its expiry date, compared with the transaction's posting date, is refused.

+

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 supported release: v15 (supported until the end of 2027, planned) or v16 (until the end of 2029, planned). v16, stable since January 2026, keeps the Serial and Batch Bundle model and adds the Serial & Batch Traceability report. If you are on v14 or older, plan the upgrade carefully, since the way serials and batches are stored changed at v15.

Your next step

Need serial and batch traceability set up right the first time?

See it live

Trace a bad batch

One complaint, and the batch is traced back to its supplier and forward to every buyer.

You end with every unit traced · 3 screens · about 5 min

No sign-up, no card, no account.

Next step · ERPNext how-to & fixes

Now see what an audit finds in yours

When the same problems keep coming back, tick what you see and get an audit of the ERPNext you have, then fixes in order of what costs you most.

Comments & ratings

No comments yet. Start a new discussion.

0

Manoj · Published on 20 July 2026

Worked with us? Leave a Google review

Questions about this? Talk to the team.

Book a 30-minute Google Meet, WhatsApp us, or send a message. The engineer who works on this replies.

Send us a message
Your details go to our team's CRM and are used only to reply.