Curd, bread, packaged snacks, medicines: everything with an expiry date turns into a loss if it sits too long. Most shops handle it the same way, by noticing late and dropping the price on the last day, or by throwing it away. Markdown pricing done properly starts earlier, discounts only the stock that will really be left over, and never sells below cost while there is still time to sell at a profit.
A product can have three batches on the shelf with three different expiry dates, so tracking by product name is not enough. The sheet behind this setup, called Batch Stock, has one row per batch: Item, Batch, Expiry Date, Quantity, Cost, MRP, Daily Sales Average and Category.
Shops whose billing software can export batches simply paste the export. Shops whose software cannot do that use a small receiving form on the store phone: item, quantity and expiry date, typed or scanned when the delivery arrives. Daily sales then come from the normal item-wise sales report, spread across batches with the oldest batch first.
Any batch without an expiry date is never priced. It goes on a list to be filled the same day.
Discounting by date alone wastes money, because some items with four days left will sell out anyway. The automation compares two numbers for each batch:
| Status | Rule | Action |
|---|---|---|
| Remove Today | Days left is zero or less | Remove from the shelf, never repriced |
| At Risk | Days of stock is more than days left | Goes to the markdown ladder |
| Will Sell | Days of stock is within days left | Nothing to do |
| Missing Expiry | No date entered | Listed for same-day entry |
Example, with illustrative numbers: a batch has 4 days left and 30 units, and the shop sells 12 a day. That is 2.5 days of stock, so it will sell without help. With 60 units, it is 5 days of stock: about 12 units would be left at expiry, so only that batch gets a markdown.
Each category gets its own bands, written by the owner, because curd and cough syrup do not behave the same. These starting values are examples; every shop sets its own.
| Category | Days left | Maximum discount | What happens |
|---|---|---|---|
| Dairy | 3 to 4 | 15% | Markdown |
| Dairy | 1 to 2 | 30% | Markdown, moved to the front fridge |
| Bakery | 2 to 3 | 20% | Markdown |
| Bakery | 1 | 40% | Markdown, counter basket |
| Packaged food | 15 to 30 | 10% | Markdown |
| Packaged food | 7 to 14 | 20% | Bundle with a fast seller |
| OTC products and supplements | 60 to 90 | 10% | Markdown |
| Prescription medicines | Any | 0% | Return to the distributor |
Prescription medicines are never discounted; near-expiry batches go back to the distributor instead.
New price = MRP × (1 − discount), rounded. While there are more than three days left, the price is never allowed below cost. In the last three days, a price below cost is allowed, because recovering something is better than recovering nothing.
Example: an item with ₹50 MRP and ₹42 cost falls in a 20% band with ten days left. 20% off gives ₹40, which is below cost, so the price is held at ₹42. With two days left, the full discount applies.
At 7 am, an n8n workflow reads Batch Stock, removes duplicate rows of the same item and batch, calculates days left and days of stock, and sorts every batch into the four statuses. At-risk batches are matched to their band and priced with the cost floor. For packaged food in the bundle band, an AI step suggests one partner from the shop’s top 40 fast sellers in the same category, or none; it cannot change any price or pick anything outside that list.
The owner gets one Telegram summary with three buttons: Approve all, Edit single prices, or Reject. If there is no reply by 9 am, nothing changes. Approved prices are written in the billing software’s import format, shelf labels go to a print list, and a Markdown Log records how many units sold at each new price the next morning. The n8n documentation covers the schedule, switch and approval steps.
A shop with no paid tools can run the same logic in Google Sheets with three formulas, for days left, days of stock and status, and an Apps Script trigger that emails only the at-risk rows every morning.
Before a festival, sales of some categories jump, which makes stock look safer than it is in normal weeks. Multiplying that category’s daily sales by a festival factor before calculating days of stock keeps the plan accurate, and a lower factor after the festival flags leftovers earlier. The same idea drives festival demand forecasting, so shops that already forecast festivals can reuse those numbers.
After a few weeks, the log shows which discounts actually moved stock, which is how markdown pricing gets better over time. Often a small, early discount on packaged food sells more than a large late one, while dairy needs both a bigger cut and a better spot near the door. Shift the bands to match what the log shows, and keep owner approval on until the rules have been tested through a full season.
Items without an expiry date follow a different path: when they stop selling, they become dead stock and are cleared with bundles over weeks, not days. Shops with two branches can often avoid a markdown entirely by sending at-risk stock to the branch that sells it faster through an inventory transfer. And the front-fridge and counter spots used for the last days work best when the rest of the shelves follow a planogram built on margin earned.