Skip to content
Back to Blog
Case StudyHealthcareAI Agents

Pharmacy Delivery: How Agents Check Stock and Place Orders

Agent Checker4 min read

Online pharmacies deliver over-the-counter medications, health supplements, and personal care products, often across a large catalogue. A growing number of customers send AI agents to reorder regular items or find specific products. Those agents frequently struggle with a fundamental problem: they cannot tell what is in stock.

The Typical Starting Point

A common approach is to display stock availability using coloured circular badges next to each product. Green means in stock, amber means low stock, and red means out of stock. The badges are span elements with CSS background colours and no text content. No alt text, no ARIA label, no title attribute. A human glancing at the page sees the traffic light system instantly. An agent sees an empty span with a class name like "stock-indicator stock-green."

Some agents with sophisticated CSS analysis can infer that "stock-green" probably means in stock, but this is unreliable. Many sites reuse colours elsewhere, with green badges for "new arrival" and amber for "sale," so the colour classes are ambiguous even for agents that try to interpret them.

Product data is often sparse too. Each product page has the product name in an h1, the price in a span, and a description in a free-text div. There is no structured data markup. Product categories, active ingredients, dosage information, pack sizes, and suitability warnings (such as "not suitable for children under 12") exist only in the description prose.

The basket and checkout process usually uses standard form elements, so agents that manage to find an in-stock product can add it to the basket and proceed to checkout. The bottleneck is the stock check. If an agent cannot determine availability, it cannot confidently add items, and in an audit this is typically the single biggest blocker.

What to Change

Text-based stock labels. Supplement every coloured badge with a visible text label: "In stock," "Low stock (8 remaining)," or "Out of stock." Keep the coloured badge as a visual quick-reference, but make the text label the primary indicator. Wrap the text in a span with a data-availability attribute containing a machine-readable value (in_stock, low_stock, out_of_stock). This dual approach means human users get the quick visual scan they are used to, and agents get unambiguous text.

Schema.org Product markup. Give each product page JSON-LD markup using the Schema.org Product type. Include the product name, description, brand, price, currency, availability (using Schema.org ItemAvailability values), SKU, category, and relevant health warnings. Add pack size and dosage information as additional properties.

Product listing pages with structured data. Mark up category pages that list multiple products, with each product in the list receiving abbreviated structured data (name, price, availability, and link to the full product page). This lets agents scan a category page and quickly identify in-stock items without visiting each product page individually.

Reorder support. Add a /reorder endpoint that accepts a list of product SKUs as URL parameters and returns a page showing each product's current availability, price, and an "Add all to basket" button. Agents handling repeat orders can construct a single URL containing the customer's regular items and present the availability summary before proceeding to checkout.

What Improves

The decisive change is making availability readable as text. Once an agent can see "In stock" rather than an empty coloured span, it can complete orders it previously had to abandon, and customers stop receiving "out of stock" cancellation emails because the agent checks availability before adding items.

The reorder pattern tends to become popular quickly with customers who buy the same items on a regular cycle (vitamins, skincare, regular medications) and have their agents automate the process. There is usually a knock-on reduction in "is this in stock?" enquiries to customer service, because agents answer those availability questions that customers previously had to ask a human.

Lessons for Online Pharmacies and Health Retailers

The colour-coded badge problem extends well beyond pharmacies. Any site that communicates status through colour alone, without text labels, is invisible to agents. This includes stock indicators, severity ratings, freshness indicators, and any other traffic-light system.

The fix is simple: add text. Keep the colours if they help human users scan quickly, but make the text the primary indicator. This is also an accessibility requirement under WCAG guidelines, so there is a compliance benefit alongside the agent compatibility benefit.

For pharmacies specifically, the structured product data is worth prioritising because health products have specific attributes (active ingredients, dosage, suitability restrictions) that agents need to check before recommending a product. An agent asked to "reorder my usual vitamin D" needs to confirm the correct product, dosage, and pack size. Structured data makes this reliable. Free-text descriptions make it guesswork.

The reorder pattern is something every subscription-like business should consider. If your customers buy the same things regularly, give agents a clean URL-based way to check availability and reorder. This turns a five-minute browsing session into a thirty-second automated task, which is exactly what customers want from their agents.