AI Tools for a Grocery Store: Supplier Invoices and Shelf Prices

Coding Liquids tutorial cover featuring Sagnik Bhattacharya for AI Tools for a Grocery Store: Supplier Invoices and Shelf Prices.
Coding Liquids tutorial cover featuring Sagnik Bhattacharya for AI Tools for a Grocery Store: Supplier Invoices and Shelf Prices.

Photograph or forward each supplier invoice to an AI assistant and have it extract every line, with pack sizes, into a spreadsheet. Formulas then work out each unit cost, compare it with last week's and recalculate the shelf price that holds your target margin. Check each invoice total first, and approve every price change before it reaches the till.

The assistant reads and tidies, formulas do the sums, and you set the prices. Assistants misread digits and drop lines at page breaks, so the invoice total is the first check; one wrong digit in a unit cost can put a wrong price on a shelf for a week. This routine is about costs coming in. Short-date markdowns and promotional posters are separate jobs, covered in the tutorial on short-date markdowns and the one on weekly offer posters.

Follow me on Instagram@sagnikteaches

The example is a one-shop neighbourhood grocery with two tills and a till system that imports prices from a file. In one week it receives 11 invoices from six suppliers, 187 lines in all. Every figure is illustrative, so use your own costs and margins.

Connect on LinkedInSagnik Bhattacharya

Before Monday: one sheet that knows your items and your margins

Nothing works until the shop has a single sheet that says what each item is, how it is bought and what margin it must earn. Build it from your till's item export and ask the assistant to tidy the names. One row per item, with these columns:

Subscribe on YouTube@sagnikteaches
ColumnExampleWhat it is for
Item code100412The till's own code; every other table keys on it
Your nameButter 250 gThe name you recognise, not the supplier's abbreviation
Supplier and supplier codeDairy supplier, BT-250Lets an invoice line find its item
Units per case20Turns a case price into a unit cost
Last unit cost and date2.75, last FridayThe comparison point for every new invoice
Shelf price now3.89What the till charges today
Category, target margin, floor marginDairy, 30%, 26%The repricing rule
Key value itemNoLines you hold on purpose; see below
Shrink allowance0% (produce 6% to 8%)Spoilage and trimming, set from your own stock-takes

Two definitions prevent the commonest pricing error. Margin is profit as a share of the shelf price; markup is profit as a share of cost. They are not the same number. Suppose an old rule of thumb says "add 30%" to dairy. Butter costing $2.90 becomes $3.77, which earns a margin of only 23.1%. A 30% margin needs $2.90 divided by 0.70, which is $4.14. Dairy shelves priced by markup drift under their targets without anyone noticing.

The target is the margin a repriced line should reach. The floor is the margin below which the line stops being worth its space, and it triggers the review. Illustrative figures that a small store might start with:

CategoryTarget marginFloor
Dairy30%26%
Produce, after shrink35%30%
Bakery38%32%
Ambient grocery30%25%
Soft drinks30%25%
Snacks35%30%

Set yours from your own till reports. Key value items are the handful of lines customers use to judge whether the shop is dear, such as milk, eggs, bread and bananas. They are held on purpose, sometimes below their floor, and reviewed weekly by the owner rather than by formula.

Finally, put four standing rules into a ChatGPT Project or a Claude Project, so every invoice starts from the same instructions: copy digits exactly; write a question mark where a digit is unclear; never calculate a unit cost until asked; never recommend a price.

Monday: the dairy invoice, read once and checked twice

The dairy invoice arrives on paper with the delivery. Photograph it flat, in full, with no shadow across the figures; if the supplier also emails a PDF, use the PDF, which is cleaner than any photo. The first prompt asks for extraction and two checks, and nothing else:

Extract every line of the attached supplier invoice into a table with these columns: supplier code, description as printed, pack text as printed (for example 6x2L), quantity in cases, case price, printed line total.
Copy digits exactly. If a digit is unclear, write ? in that cell instead of guessing.
Below the table show: (1) for each line, quantity x case price and whether it equals the printed line total; (2) the sum of the printed line totals next to the printed invoice total.
Mark credit lines with a minus sign. Do not calculate unit costs yet.

The printed invoice had seven lines and a total of $503.40. The reply (illustrative) came back with six lines and two problems:

DescriptionPackCasesCase pricePrinted totalLine check
Whole milk 2 L6x2L109.8498.40OK
Semi-skimmed milk 2 L6x2L69.8459.04OK
Free-range eggs 126x12414.4057.60OK
Cheddar block 400 g12x400g342.60127.80OK
Butter 250 g20x250g238.00116.00Mismatch: 2 x 38.00 = 76.00
Credit, damaged milk6x2L-19.84-9.84OK

Two different checks caught two different errors. The line check exposed the butter: the case price had been read as 38.00 when the invoice says 58.00, which would have made the unit cost $1.90 instead of $2.90 and sent a very wrong figure into Friday's pricing. The total check exposed the other: the sum of the printed totals was $449.00 against $503.40 on the invoice, a gap of $54.40. A line was missing, in this case the natural yoghurt at the foot of the first page, which the model skipped at the page break. Neither check alone would have caught both.

Asking "re-read line 5's case price" and "check the foot of page one for a missing line" fixed both within a minute. The fixed table then gets one formula per line, which a person can audit: the unit cost is the case price divided by units per case, so $58.00 divided by 20 gives $2.90 for butter. If your invoices are mostly PDFs, the tutorial on AI invoice processing for supplier bills compares the paid capture tools, and why AI is bad at maths explains why the sums stay in the sheet.

Tuesday: matching supplier codes and pack sizes to your items

The second supplier writes descriptions in its own shorthand. Matching "WHL MLK 2L X6" to your "Whole milk 2 L" is exactly the sort of fuzzy job a language model does well, and it is safe because a person approves the match once and the sheet remembers it. Google Sheets has an AI function for this: you give it a prompt and the cells to read. Its help page says it fills the first 350 selected cells at a time, needs an eligible Google Workspace or Google AI plan, cannot be nested inside another formula, and does not refresh on its own, so you click "Refresh and Insert" when the data changes. A chat assistant does the same job if you paste the unmatched descriptions and your item list. The tutorial on Google Sheets AI prompts shows the syntax.

Whichever you use, tell it to answer CHECK when two items could fit. An illustrative run on four new descriptions:

Supplier textSuggested itemAction
CHD BLK 400GCheddar 400 gApprove; save the supplier code
SF OIL 1LSunflower oil 1 LApprove
YOG NAT 500Natural yoghurt 500 gApprove
TOM CHOP 400 X12CHECKTwo chopped tomato items on file; you choose

Pack text is the next trap, because "6x2L" and "2x6L" describe different cases. The assistant is told to flag any line whose pack text differs from the last invoice for the same code. That rule caught the week's quietest cost rise on Tuesday afternoon. A multipack of crisps, 24 bags of 40 g, arrived as 24 bags of 36 g at the same case price of $14.40. The cost per bag stayed at $0.60, so the margin did not move, but the cost per 100 g rose from $1.50 to $1.67, an increase of 11.1% for the customer who looks at the unit price. If the rules where you trade require a unit price on the label, it changes from $2.98 to $3.31 per 100 g at the unchanged $1.19 shelf price. The line goes onto the label list even though no shelf price changes.

Wednesday: produce by the kilo, a short delivery and shrink

Produce invoices price by weight, and what arrives can differ from what was ordered. The prompt gets one extra instruction:

Also list any handwriting, stamps or crossed-out quantities on the invoice. Do not apply them to the table; only list them with the line they sit next to.

The assistant read the printed 10 kg of loose apples at $2.34 a kilo, and listed a handwritten "8" with a signature next to the line. The driver had delivered 8 kg. The invoice total check passed, because the printed figures all added up. Only the extra instruction revealed that the shop was being charged for 2 kg it never received, a credit of $4.68 to claim from the produce supplier. Monday's damaged milk is not part of that claim, because the dairy supplier had already credited it on the invoice. Keep credits received and credits still owed in separate columns, or the same case of milk gets claimed twice.

The second produce rule is the shrink allowance. Bananas bought at $1.18 a kilo do not all get sold; some are bruised or thrown away. With a 6% allowance the effective cost is $1.18 divided by 0.94, which is $1.26 a kilo, and the margin is judged on that figure. Apples carry an 8% allowance, which turns $2.34 a kilo into an effective $2.54. The allowances come from your own stock-takes, and the formula uses them the same way every week.

Thursday: credit notes and promotional allowances

The ambient and drinks suppliers brought two kinds of line that look like cost changes but are not. A credit note is not a price. An off-invoice promotional allowance is a price that expires. Cola, 12 cans to a case, normally costs $9.60 a case, or $0.80 a can. This week's invoice charged $8.40 with a line reading "promo allowance". If the cost sheet recorded $0.70 a can as the new cost, next week's check would show a false price rise when the allowance ended, and a careless repricing would cut the shelf price for good.

The rule for the assistant is to flag any case price more than 5% below the average of the last four invoices, and to look for words such as promo, allowance, offer and deal. A flagged line goes onto a cost history with its type:

ItemWeekCase costType
Cola, 12 x 330 ml1 to 39.60Normal
Cola, 12 x 330 ml48.40Promotional allowance, ends Sunday

The base cost stays at $9.60 and the shelf price stays at $1.19. On normal cost the margin is 32.8%; on promotional stock it is 41.2%. If the shop buys 20 cases at the allowance price, the extra margin is $24.00, a one-off gain to record as such. The tutorial on catching supplier price creep on invoices applies the same idea in a kitchen.

Friday: the margin check on every changed line

By Friday the item sheet held all 187 lines. 164 were within 2% of their previous cost and need no action. 23 moved by 2% or more. Of those, 9 had fallen below their floor margin, and 14 were still above it. Nine lines of the 23 are shown here; the rules behind the decisions are the target and floor above, a cap of 8% on any one weekly shelf rise, and the key value items held by the owner. Margins on produce use the shrink-adjusted cost.

ItemUnit cost, last to newShelf nowMargin now / floorDecisionNew shelfMargin after
Butter 250 g2.75 to 2.90 (+5.5%)3.8925.4% / 26%Below floor: reprice to target4.1930.8%
Cheddar 400 g3.40 to 3.55 (+4.4%)4.9928.9% / 26%Above floor: hold4.9928.9%
Free-range eggs, 122.10 to 2.40 (+14.3%)3.1924.8% / 26%Key value item: 10-cent move3.2927.1%
Whole milk 2 L1.58 to 1.64 (+3.8%)2.2928.4% / 26%Key value item above floor: hold2.2928.4%
Bananas, per kg1.10 to 1.18 (+7.3%)1.6925.7% / 30%Key value item below floor: hold on purpose1.6925.7%
Loose apples, per kg2.10 to 2.34 (+11.4%)3.4927.1% / 30%Target price 3.99 is +14.3%, over the cap: owner sets3.6931.1%
Sunflower oil 1 L1.95 to 2.19 (+12.3%)2.9926.8% / 25%Above floor: hold and watch next week2.9926.8%
Orange juice 1 L1.20 to 1.38 (+15.0%)1.7922.9% / 25%Target price 1.99 is +11.2%, over the cap: owner sets1.8927.0%
Wholemeal loaf1.12 to 1.18 (+5.4%)1.9940.7% / 32%Above floor: hold1.9940.7%

Of the nine lines below floor, six were repriced (four are in the table) and three were held on purpose as key value items. The sheet does the calculation, with the rounding written once so every price ends in 9:

Required price:  =unit_cost / (1 - shrink) / (1 - target_margin)
Shelf price:     =CEILING(required_price + 0.01, 0.10) - 0.01

Rounding up with that second formula guarantees the shelf price is never below the required price. Two cases show why a person stays in the loop. The apples' target price was a 14.3% rise, bigger than the 8% cap, so the owner chose $3.69, a 5.7% rise that still clears the 30% floor with a margin of 31.1%, and put the apples at the top of next week's review. A 15% jump in juice cost is also worth one look at the original invoice, because a jump that size is sometimes a misread or a pack change. Here the supplier had confirmed the rise, so the owner accepted it and chose $1.89, below the $1.99 the formula wanted.

Saturday: getting new prices onto the shelf and the till together

A price that changes in the till but not on the shelf starts an argument at the checkout that can cost more than the margin it protects. So the output of Friday is not a price file; it is two lists made from the same approved rows. The first is a changed-lines list for the shop floor:

BayItemOldNewLabel printedChecked
4, chilledButter 250 g3.894.19
4, chilledFree-range eggs, 123.193.29
7, produceLoose apples, per kg3.493.69
9, drinksOrange juice 1 L1.791.89
12, snacksCrisps 36 g (unit price label)2.98 per 100 g3.31 per 100 g

The second is the file in the format your till imports, usually item code and price. Before uploading it, save the current price export, because that copy is your way back. Then give the assistant both files and ask one question: "List any item whose price in the import file differs from the approved changed-lines list, and any approved item missing from the file." After the upload, scan ten changed items at the till and read each shelf label against the screen. If the two agree, the week is done.

What the routine costs, and what each tool is for

As of October 2026, ChatGPT Plus is $20 a month and Claude Pro is $20 a month ($17 a month billed annually). That covers the reading, the extra-instruction prompts and the changed-lines list. Google Sheets' AI function needs an eligible Workspace or Google AI plan, so check what you hold before relying on it. A bookkeeping package may already capture the bill for the ledger (Xero announced free Smart Document Capture on all plans in July 2026), but capture built to post a bill is not always built to keep item lines, so check whether line items survive before counting on it for unit costs.

Paid capture tools are the alternative to photographing invoices yourself. Dext's business page lists a base plan at $25.21 a month billed annually ($302.50 a year) for up to 250 documents a month and 5 users, with line-item extraction as an add-on from $20.50 a month or $0.50 a document pay-as-you-go. A shop with 11 invoices a week handles about 48 documents a month, well inside the limit, so the add-on is the real cost: from about $45.71 a month in total against $20 for a chat assistant. What the extra money buys is not accuracy but time, since invoices arrive by email without anyone photographing them. Keep the two checks either way, because the printed total is the one piece of evidence that does not depend on the tool.

Questions grocers ask about invoices, AI and shelf prices

Which AI tool should a small grocer start with for invoices?

Start with the assistant you already have, ChatGPT or Claude, plus a spreadsheet. Photograph the invoice, ask for a table, and keep the arithmetic in formulas. Paid capture tools such as Dext become worth considering when you handle more invoices than you want to check by hand, or your bookkeeper wants every bill filed automatically.

Can the AI change prices on my till by itself?

It should not. Let it prepare a changed-lines list and a file in the format your till imports, then approve the list yourself before uploading. Keep the previous export so you can roll back, and scan a sample of items afterwards to confirm till and shelf labels match.

How often should I recalculate shelf prices?

Weekly works for most small stores, because invoices arrive in batches and a weekly review catches creeping costs without constant label changes. Check key value items such as milk and eggs more often, and review the whole range after any supplier tells you about a general price rise.

What if an invoice has handwritten corrections?

Photograph it anyway and ask the assistant to list handwriting, stamps and crossed-out quantities without applying them. Then compare each one with what actually arrived. Handwritten short deliveries are a common source of credits you only receive if you notice and claim them.

Further reads

Sources: Dext business pricing page, Google Docs Editors help (AI function in Sheets), Xero Smart Document Capture announcement, OpenAI and Anthropic plan pages, as checked in October 2026.

Want your invoice-to-shelf routine mapped?

On a 1:1 call we'll look at how invoices reach you and how prices reach your till, pick the one step worth automating first, and decide whether your current tools can handle it.

Book a 1:1 call with me